1 |
fabiocos |
1.32 |
### RPM external lhapdf 5.8.5
|
2 |
andreasp |
1.23 |
|
3 |
ratnik |
1.2 |
%define realversion %(echo %v | cut -d- -f1)
|
4 |
|
|
Source: http://cern.ch/service-spi/external/MCGenerators/distribution/%{n}-%{realversion}-src.tgz
|
5 |
fabiocos |
1.32 |
Patch0: lhapdf-5.8.5-32bit-on-64bit-recheck-workaround
|
6 |
|
|
Patch1: lhapdf-5.8.5-gzio
|
7 |
|
|
Patch2: lhapdf-data-5.8.5-gzio
|
8 |
eulisse |
1.33 |
|
9 |
fabiocos |
1.32 |
Requires: zlib
|
10 |
eulisse |
1.39 |
%define keep_archives true
|
11 |
eulisse |
1.38 |
%if "%(case %cmsplatf in (osx*_*_gcc421) echo true ;; (*) echo false ;; esac)" == "true"
|
12 |
eulisse |
1.31 |
Requires: gfortran-macosx
|
13 |
|
|
%endif
|
14 |
davidlt |
1.42 |
|
15 |
|
|
%if "%{?cms_cxx:set}" != "set"
|
16 |
|
|
%define cms_cxx c++
|
17 |
|
|
%endif
|
18 |
|
|
|
19 |
|
|
%if "%{?cms_cxxflags:set}" != "set"
|
20 |
davidlt |
1.43 |
%define cms_cxxflags -O2 -std=c++0x
|
21 |
davidlt |
1.42 |
%endif
|
22 |
|
|
|
23 |
ratnik |
1.1 |
%prep
|
24 |
ratnik |
1.2 |
%setup -q -n %{n}/%{realversion}
|
25 |
elmer |
1.15 |
%patch0 -p2
|
26 |
fabiocos |
1.32 |
|
27 |
|
|
touch src/gzio.inc ; touch src/gzio.F ; touch src/ftn_gzio.c
|
28 |
elmer |
1.17 |
%patch1 -p2
|
29 |
andreasp |
1.23 |
|
30 |
fabiocos |
1.32 |
cd share/lhapdf/PDFsets
|
31 |
|
|
%patch2 -p5
|
32 |
eulisse |
1.33 |
|
33 |
fabiocos |
1.32 |
rm -f *gz NNPDF*1000*
|
34 |
eulisse |
1.36 |
cat <<\EOF > ../compress.mk
|
35 |
|
|
FILES=$(addsuffix .gz,$(wildcard *))
|
36 |
|
|
all: ${FILES}
|
37 |
|
|
%.gz: %
|
38 |
|
|
gzip -9 $<
|
39 |
|
|
EOF
|
40 |
|
|
|
41 |
|
|
make -j 4 -f ../compress.mk all
|
42 |
fabiocos |
1.32 |
cd ../../..
|
43 |
|
|
|
44 |
andreasp |
1.23 |
%build
|
45 |
eulisse |
1.33 |
# We do everything in install because we need to do it twice.
|
46 |
|
|
%install
|
47 |
eulisse |
1.35 |
# Regenerate the configure and makefiles since we modified
|
48 |
|
|
# the Makefile.am to include the gzip stuff.
|
49 |
|
|
LIBTOOLIZE=`which glibtoolize || which libtoolize`
|
50 |
|
|
$LIBTOOLIZE --force --copy
|
51 |
|
|
autoupdate
|
52 |
|
|
aclocal -I m4
|
53 |
|
|
autoconf
|
54 |
|
|
automake --add-missing
|
55 |
|
|
|
56 |
eulisse |
1.36 |
# Only old platform can be build using shared librari
|
57 |
|
|
case %cmsplatf in
|
58 |
|
|
slc5_*_gcc4[01234]*)
|
59 |
|
|
FC="`which gfortran`"
|
60 |
davidlt |
1.42 |
CXX="`which %cms_cxx`"
|
61 |
eulisse |
1.36 |
CC="`which gcc`"
|
62 |
eulisse |
1.33 |
;;
|
63 |
eulisse |
1.36 |
*)
|
64 |
|
|
PLATF_CONF_OPTS="--enable-static --disable-shared"
|
65 |
|
|
FC="`which gfortran` -fPIC"
|
66 |
davidlt |
1.42 |
CXX="`which %cms_cxx` -fPIC"
|
67 |
eulisse |
1.36 |
CC="`which gcc` -fPIC"
|
68 |
eulisse |
1.29 |
;;
|
69 |
|
|
esac
|
70 |
fabiocos |
1.32 |
|
71 |
eulisse |
1.33 |
# Remove tests and examples since they have duplicate symbols
|
72 |
|
|
# when linking against the archive library.
|
73 |
|
|
perl -p -i -e 's|ac_config_files=".ac_config_files examples/Makefile"||' configure
|
74 |
|
|
perl -p -i -e 's|ac_config_files=".ac_config_files tests/Makefile"||' configure
|
75 |
|
|
rm -rf tests examples
|
76 |
|
|
|
77 |
|
|
# Configure first with low memory.
|
78 |
|
|
./configure --prefix=%i $PLATF_CONF_OPTS --disable-pyext \
|
79 |
|
|
--disable-octave --disable-doxygen \
|
80 |
|
|
--enable-low-memory --with-max-num-pdfsets=1 \
|
81 |
eulisse |
1.36 |
FC="$FC" CXX="$CXX" CC="$CC" \
|
82 |
davidlt |
1.42 |
CPPFLAGS="-I ${ZLIB_ROOT}/include" CXXFLAGS="%cms_cxxflags" LDFLAGS="-L${ZLIB_ROOT}/lib -lz"
|
83 |
eulisse |
1.33 |
perl -p -i -e 's|examples||;s|tests||' Makefile
|
84 |
|
|
find . -name Makefile -o -name config.status -exec perl -p -i -e 's|/usr/lib64/lib[cm].a||g' {} \;
|
85 |
|
|
make %makeprocesses; make install
|
86 |
fabiocos |
1.32 |
mkdir %i/share/lhapdf/PDFsets
|
87 |
|
|
mv share/lhapdf/PDFsets/*gz %i/share/lhapdf/PDFsets
|
88 |
eulisse |
1.41 |
pushd %i/share/lhapdf/PDFsets
|
89 |
|
|
for x in `ls *.gz`; do
|
90 |
|
|
ln -sf $x `echo $x | sed -e's|\.gz$||'`
|
91 |
|
|
done
|
92 |
|
|
popd
|
93 |
fabiocos |
1.32 |
|
94 |
elmer |
1.24 |
# do another install-round for full libs
|
95 |
|
|
make distclean
|
96 |
eulisse |
1.33 |
./configure --prefix=%i/full $PLATF_CONF_OPTS \
|
97 |
|
|
--disable-pyext \
|
98 |
|
|
--disable-octave --disable-doxygen\
|
99 |
eulisse |
1.36 |
FC="$FC" CXX="$CXX" CC="$CC" \
|
100 |
eulisse |
1.33 |
CPPFLAGS="-I ${ZLIB_ROOT}/include" LDFLAGS="-L${ZLIB_ROOT}/lib -lz"
|
101 |
|
|
perl -p -i -e 's|examples||;s|tests||' Makefile
|
102 |
|
|
find . -name Makefile -o -name config.status -exec perl -p -i -e 's|/usr/lib64/lib[cm].a||g' {} \;
|
103 |
|
|
make %makeprocesses; make install
|
104 |
|
|
rm -rf %{i}/lib/*.la
|