df0ce7a11efe90f45024fe64f3da09e5623ad9c6
[alexxy/gromacs.git] / admin / gromacs.spec
1 #
2 # RPM specification file to make normal gromacs packages (without mpi)
3 # If you have mpi installed, you can create an mpi mdrun executable
4 # and libs with the gromacs-mpi spec file!
5
6 #
7 # Main package - only dynamic libs, and no header files
8 #
9 Summary: Molecular dynamics package (non-parallel)
10 Name: gromacs
11 Version: 3.0
12 Release: 1
13 Copyright: GPL
14 Group: Applications/Science
15 Prefix: /usr/local/gromacs
16 Requires: fftw >= 2.1.3 
17 Source: ftp://ftp.gromacs.org/pub/gromacs/source/gromacs-%{version}.tar.gz
18 URL: http://www.gromacs.org
19 Packager: Erik Lindahl <lindahl@gromacs.org>
20 %description
21 GROMACS is a versatile and extremely well optimized package
22 to perform molecular dynamics computer simulations and
23 subsequent trajectory analysis. It is developed for
24 biomolecules like proteins, but the extremely high 
25 performance means it is used also in several other field 
26 like polymer chemistry and solid state physics. This
27 version has the dynamic libs and executables; to hack new
28 utility programs you also need the headers and static
29 libs in gromacs-dev. Linux kernel 2.4 or later is STRONGLY
30 recommended on Pentium III and later processors since
31 GROMACS then can use assembly loops with SSE instructions.
32
33 #
34 # The header files and static libraries go into gromacs-devel...
35 #
36 %package devel
37 Summary: Header files and static libraries for GROMACS
38 Group: Applications/Science
39 Prefix: %{prefix}
40 Requires: fftw-devel >=2.1.3, gromacs = %{version}-%{release}
41 %description devel
42 This package contains header files, static libraries,
43 and a program example for the GROMACS molecular
44 dynamics software. You need it if you want to write your
45 own analysis programs. A word of warning, though; 
46 this package is still somewhat untidy, and might put a 
47 lot of files in your standard include dir if you change
48 the default prefix!
49
50 %prep
51 %setup
52
53 %build
54 # We can actually install in /usr/local/bin, /usr/local/lib, etc,  by using the options
55 # --prefix=/usr/local, --exec-prefix=/usr/local  and --datadir=/usr/local/share/gromacs, 
56 # but since the development package puts a lot of include files in {prefix}/include we
57 # default to /usr/local/gromacs. Will try to fix that in gromacs 4.0 :-)
58
59 ./configure
60 make 
61
62 %install
63 make DESTDIR=${RPM_BUILD_ROOT} install
64 # Move mdrun to mdrun_nompi - we make a link at post-install script time!
65 (cd ${RPM_BUILD_ROOT}%{prefix}/%{_target}/bin && mv mdrun mdrun_nompi)
66
67 %clean
68 rm -rf ${RPM_BUILD_ROOT}
69
70 %post
71 #
72 # Add our (final) library directory to /etc/ld.so.conf if it is not already there
73 #
74 if test -z `grep ${RPM_INSTALL_PREFIX}/%{_target}/lib /etc/ld.so.conf`; then
75      cat >> /etc/ld.so.conf < ${RPM_INSTALL_PREFIX}/%{_target}/lib
76 fi
77 # Make a link from mdrun_nompi to mdrun - if it doesn't already exist!
78 (cd ${RPM_INSTALL_PREFIX}/%{_target}/bin && test ! -e mdrun && ln -s mdrun_nompi mdrun)
79
80 # run ldconfig to update the runtime linker database with the new libraries
81 # (make sure /sbin is in the $PATH)
82 PATH="/sbin:$PATH" ldconfig
83
84 %postun
85 # after uninstall, run ldconfig to remove the libs from the linker database
86 PATH="/sbin:$PATH" ldconfig
87 # and remove the link from mdrun_nompi to mdrun
88 (cd ${RPM_INSTALL_PREFIX}/%{_target}/bin && rm -f mdrun)
89
90 %files
91 %defattr(-,root,root)
92 %doc /usr/local/gromacs/README
93 /usr/local/gromacs/%{_target}/bin/*
94 /usr/local/gromacs/share/top/*
95 /usr/local/gromacs/share/tutor/*
96 %docdir /usr/local/gromacs/share/html
97 /usr/local/share/gromacs/html/
98 %docdir /usr/local/gromacs/man
99 /usr/local/gromacs/man/*
100 /usr/local/gromacs/%{_target}/lib/libgmx.so.1.0.0
101 /usr/local/gromacs/%{_target}/lib/libgmx.so.1
102 /usr/local/gromacs/%{_target}/lib/libmd.so.1.0.0
103 /usr/local/gromacs/%{_target}/lib/libmd.so.1
104 %files devel
105 %defattr(-,root,root)
106 /usr/local/gromacs/share/template/*
107 /usr/local/gromacs/%{_target}/lib/libgmx.so
108 /usr/local/gromacs/%{_target}/lib/libgmx.a
109 /usr/local/gromacs/%{_target}/lib/libgmx.la
110 /usr/local/gromacs/%{_target}/lib/libmd.so
111 /usr/local/gromacs/%{_target}/lib/libmd.a
112 /usr/local/gromacs/%{_target}/lib/libmd.la
113 /usr/local/gromacs/include/*