1 |
< |
### RPM external lhapdf 5.2.3-cms |
1 |
> |
### RPM external lhapdf 5.6.0 |
2 |
> |
## BUILDIF case $(uname):$(uname -p) in Linux:i*86 ) true ;; Linux:x86_64 ) true ;; Linux:ppc64 ) false ;; Darwin:* ) false ;; * ) false ;; esac |
3 |
> |
|
4 |
|
%define realversion %(echo %v | cut -d- -f1) |
5 |
|
Source: http://cern.ch/service-spi/external/MCGenerators/distribution/%{n}-%{realversion}-src.tgz |
6 |
< |
Requires: gcc-wrapper |
7 |
< |
%define gccwrapperarch slc4_ia32_gcc345 |
6 |
> |
Patch0: lhapdf-5.6.0-g77 |
7 |
> |
Patch1: lhapdf-5.6.0-32bit-on-64bit-recheck-workaround |
8 |
> |
|
9 |
|
%prep |
10 |
|
%setup -q -n %{n}/%{realversion} |
11 |
< |
./configure |
11 |
> |
# This applies both old and new fixes, probably the gcc4 ones can go (to check) |
12 |
> |
case %gccver in |
13 |
> |
4.*) |
14 |
> |
# Switch to gfortran |
15 |
> |
perl -p -i -e 's|^export F77\=g77|export F77=gfortran|' .scripts/platform_functions |
16 |
> |
perl -p -i -e 's| -Wno-globals||' configure |
17 |
> |
;; |
18 |
> |
3.*) |
19 |
> |
%patch0 -p2 |
20 |
> |
;; |
21 |
> |
esac |
22 |
> |
%patch1 -p2 |
23 |
|
|
24 |
|
%build |
25 |
< |
%if "%{cmsplatf}" == "%{gccwrapperarch}" |
26 |
< |
echo "Using gcc wrapper for %cmsplatf" |
27 |
< |
source $GCC_WRAPPER_ROOT/etc/profile.d/init.sh |
28 |
< |
%endif |
25 |
> |
./configure --disable-pyext --enable-low-memory --prefix=%i --with-max-num-pdfsets=1 |
26 |
> |
|
27 |
> |
which perl |
28 |
> |
cp Makefile Makefile.orig |
29 |
> |
perl -p -i -e 's|/usr/lib64/libm.a||g' config.status |
30 |
> |
perl -p -i -e 's|/usr/lib64/libc.a||g' config.status |
31 |
> |
perl -p -i -e 's|/usr/lib64/libm.a||g' Makefile */Makefile */*/Makefile */*/*/Makefile |
32 |
> |
perl -p -i -e 's|/usr/lib64/libc.a||g' Makefile */Makefile */*/Makefile */*/*/Makefile |
33 |
|
make |
34 |
|
|
35 |
|
%install |
36 |
< |
tar -c lib include PDFsets | tar -x -C %i |
36 |
> |
make install |
37 |
> |
# SCRAM ToolBox toolfile |
38 |
> |
mkdir -p %i/etc/scram.d |
39 |
> |
cat << \EOF_TOOLFILE >%i/etc/scram.d/%n |
40 |
> |
<doc type=BuildSystem::ToolDoc version=1.0> |
41 |
> |
<Tool name=lhapdf version=%v> |
42 |
> |
<lib name=LHAPDF> |
43 |
> |
<Client> |
44 |
> |
<Environment name=LHAPDF_BASE default="%i"></Environment> |
45 |
> |
<Environment name=LIBDIR default="$LHAPDF_BASE/lib"></Environment> |
46 |
> |
<Environment name=INCLUDE default="$LHAPDF_BASE/include"></Environment> |
47 |
> |
<Environment name=LHAPATH default="$LHAPDF_BASE/share/lhapdf/PDFsets"></Environment> |
48 |
> |
</Client> |
49 |
> |
<Runtime name=LHAPATH value="$LHAPDF_BASE/share/lhapdf/PDFsets" type=path> |
50 |
> |
<use name=f77compiler> |
51 |
> |
</Tool> |
52 |
> |
EOF_TOOLFILE |
53 |
> |
|
54 |
> |
cat << \EOF_TOOLFILE >%i/etc/scram.d/lhapdfwrap |
55 |
> |
<doc type=BuildSystem::ToolDoc version=1.0> |
56 |
> |
<Tool name=lhapdfwrap version=%v> |
57 |
> |
<lib name=LHAPDFWrap> |
58 |
> |
<use name=lhapdf> |
59 |
> |
</Tool> |
60 |
> |
EOF_TOOLFILE |
61 |
> |
|
62 |
> |
%post |
63 |
> |
%{relocateConfig}etc/scram.d/%n |