1 |
fabiocos |
1.32 |
### RPM external lhapdf 5.8.5
|
2 |
andreasp |
1.23 |
|
3 |
davidlt |
1.47 |
%define realversion %(echo %{v} | cut -d- -f1)
|
4 |
ratnik |
1.2 |
Source: http://cern.ch/service-spi/external/MCGenerators/distribution/%{n}-%{realversion}-src.tgz
|
5 |
fabiocos |
1.32 |
Patch1: lhapdf-5.8.5-gzio
|
6 |
|
|
Patch2: lhapdf-data-5.8.5-gzio
|
7 |
davidlt |
1.47 |
Patch3: lhapdf-5.8.5-disable-examples-and-tests
|
8 |
eulisse |
1.33 |
|
9 |
fabiocos |
1.32 |
Requires: zlib
|
10 |
eulisse |
1.45 |
BuildRequires: autotools
|
11 |
|
|
|
12 |
eulisse |
1.39 |
%define keep_archives true
|
13 |
davidlt |
1.47 |
%if "%(case %{cmsplatf} in (osx*_*_gcc421) echo true ;; (*) echo false ;; esac)" == "true"
|
14 |
eulisse |
1.31 |
Requires: gfortran-macosx
|
15 |
|
|
%endif
|
16 |
davidlt |
1.42 |
|
17 |
eulisse |
1.45 |
|
18 |
davidlt |
1.42 |
%if "%{?cms_cxx:set}" != "set"
|
19 |
|
|
%define cms_cxx c++
|
20 |
|
|
%endif
|
21 |
|
|
|
22 |
|
|
%if "%{?cms_cxxflags:set}" != "set"
|
23 |
davidlt |
1.43 |
%define cms_cxxflags -O2 -std=c++0x
|
24 |
davidlt |
1.42 |
%endif
|
25 |
|
|
|
26 |
ratnik |
1.1 |
%prep
|
27 |
ratnik |
1.2 |
%setup -q -n %{n}/%{realversion}
|
28 |
davidlt |
1.47 |
%patch3 -p2
|
29 |
fabiocos |
1.32 |
|
30 |
|
|
touch src/gzio.inc ; touch src/gzio.F ; touch src/ftn_gzio.c
|
31 |
elmer |
1.17 |
%patch1 -p2
|
32 |
andreasp |
1.23 |
|
33 |
fabiocos |
1.32 |
cd share/lhapdf/PDFsets
|
34 |
|
|
%patch2 -p5
|
35 |
eulisse |
1.33 |
|
36 |
fabiocos |
1.32 |
rm -f *gz NNPDF*1000*
|
37 |
eulisse |
1.36 |
cat <<\EOF > ../compress.mk
|
38 |
|
|
FILES=$(addsuffix .gz,$(wildcard *))
|
39 |
|
|
all: ${FILES}
|
40 |
|
|
%.gz: %
|
41 |
|
|
gzip -9 $<
|
42 |
|
|
EOF
|
43 |
|
|
|
44 |
davidlt |
1.47 |
make -j %{makeprocesses} -f ../compress.mk all
|
45 |
fabiocos |
1.32 |
|
46 |
andreasp |
1.23 |
%build
|
47 |
eulisse |
1.33 |
# We do everything in install because we need to do it twice.
|
48 |
|
|
%install
|
49 |
eulisse |
1.45 |
libtoolize --force --copy
|
50 |
eulisse |
1.35 |
autoupdate
|
51 |
|
|
aclocal -I m4
|
52 |
|
|
autoconf
|
53 |
|
|
automake --add-missing
|
54 |
|
|
|
55 |
davidlt |
1.47 |
FC="`which gfortran` -fPIC"
|
56 |
|
|
CXX="`which %{cms_cxx}` -fPIC"
|
57 |
|
|
CC="`which gcc` -fPIC"
|
58 |
eulisse |
1.33 |
|
59 |
|
|
# Configure first with low memory.
|
60 |
davidlt |
1.47 |
./configure --prefix=%{i} --enable-static --disable-shared --disable-pyext \
|
61 |
|
|
--disable-octave --disable-doxygen --enable-low-memory \
|
62 |
|
|
--with-max-num-pdfsets=1 \
|
63 |
eulisse |
1.36 |
FC="$FC" CXX="$CXX" CC="$CC" \
|
64 |
davidlt |
1.42 |
CPPFLAGS="-I ${ZLIB_ROOT}/include" CXXFLAGS="%cms_cxxflags" LDFLAGS="-L${ZLIB_ROOT}/lib -lz"
|
65 |
davidlt |
1.47 |
make %{makeprocesses}
|
66 |
|
|
make install
|
67 |
|
|
|
68 |
|
|
mkdir %{i}/share/lhapdf/PDFsets
|
69 |
|
|
mv share/lhapdf/PDFsets/*gz %{i}/share/lhapdf/PDFsets
|
70 |
|
|
pushd %{i}/share/lhapdf/PDFsets
|
71 |
eulisse |
1.41 |
for x in `ls *.gz`; do
|
72 |
|
|
ln -sf $x `echo $x | sed -e's|\.gz$||'`
|
73 |
|
|
done
|
74 |
|
|
popd
|
75 |
fabiocos |
1.32 |
|
76 |
elmer |
1.24 |
# do another install-round for full libs
|
77 |
|
|
make distclean
|
78 |
davidlt |
1.47 |
./configure --prefix=%{i}/full --enable-static --disable-shared \
|
79 |
|
|
--disable-pyext --disable-octave --disable-doxygen \
|
80 |
eulisse |
1.36 |
FC="$FC" CXX="$CXX" CC="$CC" \
|
81 |
davidlt |
1.44 |
CPPFLAGS="-I ${ZLIB_ROOT}/include" CXXFLAGS="%cms_cxxflags" LDFLAGS="-L${ZLIB_ROOT}/lib -lz"
|
82 |
davidlt |
1.47 |
make %{makeprocesses}
|
83 |
|
|
make install
|
84 |
|
|
|
85 |
|
|
# Remove all libtool archives
|
86 |
|
|
find %{i} -name '*.la' -exec rm -f {} \;
|
87 |
|
|
|
88 |
eulisse |
1.46 |
%post
|
89 |
|
|
%{relocateConfig}%i/bin/lhapdf-config
|
90 |
|
|
%{relocateConfig}%i/full/bin/lhapdf-config
|