Boost logo

Boost-Build :

From: Malte Starostik (malte_at_[hidden])
Date: 2002-10-12 22:39:32


Hi,

this patch changes some things for the generation of the boost-jam RPM:
* changed boost-jam-3.1.3.src.tar.gz to boost-jam-3.1.3.tar.bz
somehow with src in there I couldn't get bjam to build the rpm, bz2 as this
seems to be where other RPMs are going
* Added a variable RPMARCH to Jamfile, which defaults to a hopefully sane
value for the target plaform and can be overridden with e.g. -sRPMARCH=i686
to enable 686 optimizations (not that important for jam, but helps making
the arch consistent with what some distribution uses as default (like i586
on Mandrake)
* remove the .tar.gz and .tar.bz2 before recreating them. gzip asks for
confirmation otherwise, bzip2 just dies.
* Get rid of hardcoded /usr/src/redhat/... as it's a) distribution-specific
and b) a user can override the build root to use.

Regards,
-Malte

-- 
#!/usr/bin/perl
$t='char|short|int|long|void';%m=qw(U "unsigned\040$3" W "w$3_t");while(<>)
{/#define UNICODE/and$m{T}=$m{W};s/\b(LP)?([UWT])?($t)\b/lc(eval$m{$2}||$3)
.($1?'*':'')/gei;print;}print"/* Cleaned by Malte's WinAPI sanitizer */\n";
 --Boundary-00=_0rOq9GBzub6r8Wr Content-Type: text/x-diff;
charset="iso-8859-1";
name="boost-jam.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="boost-jam.diff"
? bin.linuxx86
? boost-jam-3.1.3-1.src.rpm
? boost-jam-3.1.3.tar.bz2
? boost-jam-3.1.3.tar.gz
? jam0
? rpm.out
Index: Jamfile
=================================RCS file: /cvsroot/boost/boost/tools/build/jam_src/Jamfile,v
retrieving revision 1.14
diff -u -3 -d -p -r1.14 Jamfile
--- Jamfile	4 Oct 2002 14:25:11 -0000	1.14
+++ Jamfile	13 Oct 2002 03:21:04 -0000
@@ -181,6 +181,7 @@ ALLSOURCE builds/win32-visualc.mk
builds/win32-borlandc.mk
builds/win32-gcc.mk
+ boost-jam.spec
;
@@ -217,11 +218,24 @@ rule Package
VERSION = boost-jam-3.1.3 ;
RELEASE = 1 ;
+switch $(OSPLAT)
+{
+case X86 : RPMARCH ?= i386 ;
+case PPC : RPMARCH ?= ppc ;
+case AXP : RPMARCH ?= alpha ;
+# no guaranty for these:
+case IA64 : RPMARCH ?= ia64 ;
+case ARM : RPMARCH ?= arm ;
+case SPARC : RPMARCH ?= sparc ;
+case * : RPMARCH ?= other ;
+}
+
actions Tar-Gz
{
ln -s . $(VERSION)
tar cvhf $(<) $(VERSION)/$(>)
rm $(VERSION)
+ rm -f $(<).gz
gzip -9 $(<)
}
@@ -230,6 +244,7 @@ actions Tar-Bz2
ln -s . $(VERSION)
tar cvhf $(<) $(VERSION)/$(>)
rm $(VERSION)
+ rm -f $(<).bz2
bzip2 -9 $(<)
}
@@ -260,26 +275,23 @@ rule Rpm 
NOTFILE $(2) ;
local tar = $(2).tar ;
- local rpm = $(2)-$(3).i386.rpm ;
+ local rpm = $(2)-$(3).$(RPMARCH).rpm ;
local srpm = $(2)-$(3).src.rpm ;
local result = $(rpm) $(srpm) ;
DEPENDS $(<) : $(result) ;
DEPENDS $(result) : $(tar) ;
- DEPENDS $(result) : boost-jam.spec ;
- tar on $(1) = $(tar).gz ;
- source on $(1) = $(2).src.tar.gz ;
+ tar on $(1) = $(tar).bz2 ;
rpm on $(1) = $(rpm) ;
srpm on $(1) = $(srpm) ;
}
actions Rpm
{
- cp $(tar) /usr/src/redhat/SOURCES/$(source)
- rpm -ba boost-jam.spec
- cp /usr/src/redhat/RPMS/i386/$(rpm) .
- cp /usr/src/redhat/SRPMS/$(srpm) . 
+ rpm -ta --target $(RPMARCH) $(2).tar.bz2 | tee rpm.out
+ cp `grep -e '^Wrote:' rpm.out | sed 's/^Wrote: //'` .
+ rm -f rpm.out
}
if $(NT)
Index: boost-jam.spec
=================================RCS file: /cvsroot/boost/boost/tools/build/jam_src/boost-jam.spec,v
retrieving revision 1.6
diff -u -3 -d -p -r1.6 boost-jam.spec
--- boost-jam.spec	4 Oct 2002 14:25:11 -0000	1.6
+++ boost-jam.spec	13 Oct 2002 03:21:04 -0000
@@ -2,7 +2,7 @@ Name: boost-jam
Version: 3.1.3
Summary: Build tool
Release: 1
-Source: boost-jam-%{version}.src.tar.gz
+Source: boost-jam-%{version}.tar.bz2
License: GPL
Group: Development/Tools
 --Boundary-00=_0rOq9GBzub6r8Wr-- 

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk