ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/lhapdf.spec
Revision: 1.29
Committed: Tue Aug 17 15:53:24 2010 UTC (14 years, 8 months ago) by eulisse
Branch: MAIN
CVS Tags: pe20100825a-for39Xrb, pe20100824c-for39Xrb, pe20100824b-for39Xrb
Changes since 1.28: +13 -2 lines
Log Message:
Fix for building on macosx.

* Looks like configure was generated with an ancient version of autotools
  which does not work on snow leopard. This uses libtoolize & co to regenerate
  it.

File Contents

# User Rev Content
1 elmer 1.15 ### RPM external lhapdf 5.6.0
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 elmer 1.15 Patch0: lhapdf-5.6.0-g77
6 elmer 1.17 Patch1: lhapdf-5.6.0-32bit-on-64bit-recheck-workaround
7 dlange 1.22
8 ratnik 1.1 %prep
9 ratnik 1.2 %setup -q -n %{n}/%{realversion}
10 elmer 1.16 # This applies both old and new fixes, probably the gcc4 ones can go (to check)
11 elmer 1.14 case %gccver in
12     4.*)
13     # Switch to gfortran
14     perl -p -i -e 's|^export F77\=g77|export F77=gfortran|' .scripts/platform_functions
15     perl -p -i -e 's| -Wno-globals||' configure
16     ;;
17 elmer 1.15 3.*)
18     %patch0 -p2
19     ;;
20 elmer 1.14 esac
21 elmer 1.17 %patch1 -p2
22 andreasp 1.23
23     %build
24 eulisse 1.29 case %cmsplatf in
25     # Looks like configure was generated with an ancient version
26     # of autotools which does not work on snow leopard.
27     # This seems to fix it.
28     osx*)
29     glibtoolize --force --copy
30     autoupdate
31     aclocal -Im4
32     autoconf
33     automake --add-missing
34     ./configure --disable-pyext --enable-low-memory --prefix=%i --with-max-num-pdfsets=1
35     ;;
36     esac
37 ratnik 1.1
38 elmer 1.16 perl -p -i -e 's|/usr/lib64/libm.a||g' config.status
39     perl -p -i -e 's|/usr/lib64/libc.a||g' config.status
40 elmer 1.20 perl -p -i -e 's|/usr/lib64/libm.a||g' Makefile */Makefile */*/Makefile */*/*/Makefile
41     perl -p -i -e 's|/usr/lib64/libc.a||g' Makefile */Makefile */*/Makefile */*/*/Makefile
42 ratnik 1.1 make
43    
44     %install
45 elmer 1.16 make install
46 elmer 1.24 # do another install-round for full libs
47     make distclean
48     %define fulllibpath %(echo %i"/full")
49     %define fullname %(echo %n"full")
50     ./configure --disable-pyext --prefix=%fulllibpath --disable-pdfsets
51     perl -p -i -e 's|/usr/lib64/libm.a||g' config.status
52     perl -p -i -e 's|/usr/lib64/libc.a||g' config.status
53     perl -p -i -e 's|/usr/lib64/libm.a||g' Makefile */Makefile */*/Makefile */*/*/Makefile
54     perl -p -i -e 's|/usr/lib64/libc.a||g' Makefile */Makefile */*/Makefile */*/*/Makefile
55     make
56     make install
57    
58 muzaffar 1.9 %post
59 elmer 1.25 %{relocateConfig}lib/libLHAPDF.la
60     %{relocateConfig}lib/libLHAPDFWrap.la