3 |
|
%define perlversion %(perl -e 'printf "%%vd", $^V') |
4 |
|
%define perlarch %(perl -MConfig -e 'print $Config{archname}') |
5 |
|
%define downloadn XML-Parser |
6 |
< |
Requires: expat |
7 |
< |
Source: http://mirror.switch.ch/ftp/mirror/CPAN/authors/id/M/MS/MSERGEANT/%{downloadn}-%{v}.tar.gz |
6 |
> |
%define expatversion 2.0.0 |
7 |
> |
Source0: http://mirror.switch.ch/ftp/mirror/CPAN/authors/id/M/MS/MSERGEANT/%{downloadn}-%{v}.tar.gz |
8 |
> |
Source1: http://dl.sourceforge.net/sourceforge/expat/expat-%expatversion.tar.gz |
9 |
|
%prep |
10 |
< |
%setup -n %downloadn-%v |
10 |
> |
%setup -T -b 0 -n %{downloadn}-%v |
11 |
> |
%setup -D -T -b 1 -n expat-%expatversion |
12 |
|
%build |
13 |
+ |
# We statically compile expat so that the perl module itself, |
14 |
+ |
# and hence scram, do not depend on the expat rpm. |
15 |
+ |
# This way we can change the expat version in CMSSW/externals |
16 |
+ |
# without having to rebuild scram. |
17 |
+ |
which gcc |
18 |
+ |
rm -rf %_builddir/tmp |
19 |
+ |
cd ../expat-%expatversion |
20 |
+ |
mkdir -p %_builddir/tmp |
21 |
+ |
./configure --prefix=%_builddir/tmp --disable-shared --enable-static |
22 |
+ |
make clean |
23 |
+ |
make |
24 |
+ |
make install |
25 |
+ |
cd ../%{downloadn}-%v |
26 |
|
|
27 |
|
perl Makefile.PL PREFIX=%i LIB=%i/lib/site_perl/%perlversion \ |
28 |
< |
EXPATLIBPATH=$EXPAT_ROOT/lib \ |
29 |
< |
EXPATINCPATH=$EXPAT_ROOT/include |
28 |
> |
EXPATLIBPATH=%_builddir/tmp/lib \ |
29 |
> |
EXPATINCPATH=%_builddir/tmp/include |
30 |
|
make |
31 |
|
|
32 |
+ |
# If we are building on a machine which has a system compiler which |
33 |
+ |
# can produce 64 bit binaries, than we also compile a 64 bit version |
34 |
+ |
# of the module, so that scram can work also on 64bit platforms disguised |
35 |
+ |
# as 32 bit via linux32. |
36 |
|
case %{cmsos} in |
37 |
|
slc4_ia32) |
38 |
|
if ldd /usr/bin/gcc | grep -q /lib64/ |
43 |
|
|
44 |
|
export PATH=/usr/bin/:$PATH |
45 |
|
export GCC_EXEC_PREFIX=/usr/lib/gcc/ |
46 |
+ |
cd ../expat-%expatversion |
47 |
+ |
CXX="/usr/bin/c++ -fPIC" CC="/usr/bin/gcc -fPIC" setarch x86_64 ./configure --prefix=%_builddir/tmp --bindir=%_builddir/tmp/bin/64 --libdir=%_builddir/tmp/lib64 --disable-shared --enable-static |
48 |
+ |
echo "Building 64bit version" |
49 |
+ |
setarch x86_64 make clean |
50 |
+ |
setarch x86_64 make |
51 |
+ |
setarch x86_64 make install |
52 |
+ |
cd ../%{downloadn}-%{v} |
53 |
|
perl Makefile.PL PREFIX=%i LIB=%i/lib/site_perl/%perlversion \ |
54 |
< |
EXPATLIBPATH=$EXPAT_ROOT/lib64 \ |
55 |
< |
EXPATINCPATH=$EXPAT_ROOT/include |
54 |
> |
EXPATLIBPATH=%_builddir/tmp/lib64 \ |
55 |
> |
EXPATINCPATH=%_builddir/tmp/include |
56 |
|
make |
57 |
+ |
make install |
58 |
|
fi;; |
59 |
|
*) |
60 |
|
;; |
61 |
|
esac |
62 |
|
|
63 |
|
%install |
37 |
– |
make install |