Merge branch 'master' of git.gromacs.org:gromacs
[gromacs/AngularHB.git] / admin / gromacs.spec
blobe90d079c9d3914264f394154aeef8b1facb40586
1 Name: gromacs
2 Version: 4.5
3 Release: 7%{?dist}
4 Summary: GROMACS binaries
5 Group: Applications/Engineering
6 License: GPLv2+
7 URL: http://www.gromacs.org
8 Source0: ftp://ftp.gromacs.org/pub/gromacs/gromacs-%{version}.tar.gz
9 Source1: ftp://ftp.gromacs.org/pub/manual/manual-4.0.pdf
10 Source2: gromacs-template-makefile-single
11 Source3: gromacs-template-makefile-double
12 Source4: gromacs-template-makefile-mpi-single
13 Source5: gromacs-template-makefile-mpi-double
14 Source6: gromacs-README.fedora
16 # Add shebangs to scripts
17 Patch0: gromacs-GMXRC.patch
19 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
20 Requires: gromacs-common = %{version}-%{release}
22 BuildRequires: fftw-devel
23 BuildRequires: gsl-devel
24 BuildRequires: libxml2-devel
25 BuildRequires: openmpi-devel
27 %if 0%{?rhel} == 4
28 BuildRequires: blas
29 BuildRequires: lapack
30 BuildRequires: xorg-x11-devel
31 %else
32 BuildRequires: blas-devel
33 BuildRequires: lapack-devel
34 BuildRequires: libX11-devel
35 %endif
37 # Check for mpi-selector or environment-modules
39 %define selector 0
40 %define modules 0
42 %if 0%{?fedora} > 9
43 %define modules 1
44 %endif
46 %if 0%{?rhel} == 4
47 %define selector 1
48 %endif
50 %if 0%{?rhel} == 5
51 %define selector 1
52 %endif
54 %if %modules == 1
55 BuildRequires: environment-modules
56 %endif
58 %if %selector == 1
59 BuildRequires: mpi-selector
60 %endif
63 %description
64 GROMACS is a versatile and extremely well optimized package
65 to perform molecular dynamics computer simulations and
66 subsequent trajectory analysis. It is developed for
67 biomolecules like proteins, but the extremely high
68 performance means it is used also in several other field
69 like polymer chemistry and solid state physics.
71 This package provides single and double precision binaries.
72 The documentation is in the package gromacs-common.
74 N.B. All binaries have names starting with g_, for example
75 mdrun has been renamed to g_mdrun.
77 %package libs
78 Summary: GROMACS libraries
79 Group: Applications/Engineering
80 Requires: gromacs-common = %{version}-%{release}
81 # Need to have this so that yum doesn't pull atlas instead
82 Requires: blas
83 Requires: lapack
85 %description libs
86 GROMACS is a versatile and extremely well optimized package
87 to perform molecular dynamics computer simulations and
88 subsequent trajectory analysis. It is developed for
89 biomolecules like proteins, but the extremely high
90 performance means it is used also in several other field
91 like polymer chemistry and solid state physics.
93 This package provides runtime libraries needed for the
94 single and double precision binaries.
97 %package mpi
98 Summary: GROMACS MPI binaries
99 Group: Applications/Engineering
100 Requires: gromacs-common = %{version}-%{release}
101 # Need to have this so that yum doesn't pull atlas instead
102 Requires: blas
103 Requires: lapack
105 %description mpi
106 GROMACS is a versatile and extremely well optimized package
107 to perform molecular dynamics computer simulations and
108 subsequent trajectory analysis. It is developed for
109 biomolecules like proteins, but the extremely high
110 performance means it is used also in several other field
111 like polymer chemistry and solid state physics.
113 This package provides MPI single precision and double
114 precision binaries.
117 %package common
118 Summary: GROMACS shared data and documentation
119 Group: Applications/Engineering
121 %description common
122 GROMACS is a versatile and extremely well optimized package
123 to perform molecular dynamics computer simulations and
124 subsequent trajectory analysis. It is developed for
125 biomolecules like proteins, but the extremely high
126 performance means it is used also in several other field
127 like polymer chemistry and solid state physics.
129 This package includes architecture independent data and
130 documentation.
133 %package devel
134 Summary: GROMACS header files and development libraries
135 Group: Applications/Engineering
136 Requires: gromacs-common = %{version}-%{release}
137 Requires: gromacs-libs = %{version}-%{release}
139 %description devel
140 GROMACS is a versatile and extremely well optimized package
141 to perform molecular dynamics computer simulations and
142 subsequent trajectory analysis. It is developed for
143 biomolecules like proteins, but the extremely high
144 performance means it is used also in several other field
145 like polymer chemistry and solid state physics.
147 This package contains header files, development libraries,
148 and a program example for the GROMACS molecular
149 dynamics software. You need it if you want to write your
150 own analysis programs.
153 %package mpi-devel
154 Summary: GROMACS MPI development libraries
155 Group: Applications/Engineering
156 Requires: gromacs-mpi-libs = %{version}-%{release}
157 Requires: gromacs-devel = %{version}-%{release}
158 # Need to have this so that yum doesn't install LAM instead
159 Requires: openmpi
161 %description mpi-devel
162 GROMACS is a versatile and extremely well optimized package
163 to perform molecular dynamics computer simulations and
164 subsequent trajectory analysis. It is developed for
165 biomolecules like proteins, but the extremely high
166 performance means it is used also in several other field
167 like polymer chemistry and solid state physics.
169 This package contains development libraries for GROMACS MPI.
170 You need it if you want to write your own analysis programs.
173 %package mpi-libs
174 Summary: GROMACS libraries
175 Group: Applications/Engineering
176 Requires: gromacs-common = %{version}-%{release}
177 # Need to have this so that yum doesn't install LAM instead
178 Requires: openmpi
179 # Need to have this so that yum doesn't pull atlas instead
180 Requires: blas
181 Requires: lapack
183 %description mpi-libs
184 GROMACS is a versatile and extremely well optimized package
185 to perform molecular dynamics computer simulations and
186 subsequent trajectory analysis. It is developed for
187 biomolecules like proteins, but the extremely high
188 performance means it is used also in several other field
189 like polymer chemistry and solid state physics.
191 This package provides runtime libraries needed for the
192 MPI single and double precision binaries.
195 %package bash
196 Summary: GROMACS bash completion
197 Group: Applications/Engineering
198 Requires: bash-completion
200 %description bash
201 GROMACS is a versatile and extremely well optimized package
202 to perform molecular dynamics computer simulations and
203 subsequent trajectory analysis. It is developed for
204 biomolecules like proteins, but the extremely high
205 performance means it is used also in several other field
206 like polymer chemistry and solid state physics.
208 This package provides the needed
209 bash completion for GROMACS
212 %package zsh
213 Summary: GROMACS zsh support
214 Group: Applications/Engineering
215 Requires: zsh
217 %description zsh
218 GROMACS is a versatile and extremely well optimized package
219 to perform molecular dynamics computer simulations and
220 subsequent trajectory analysis. It is developed for
221 biomolecules like proteins, but the extremely high
222 performance means it is used also in several other field
223 like polymer chemistry and solid state physics.
225 This package provides scripts needed to run GROMACS with
226 zsh, also it provides zsh completion.
229 %package csh
230 Summary: GROMACS csh support
231 Group: Applications/Engineering
232 Requires: csh
234 %description csh
235 GROMACS is a versatile and extremely well optimized package
236 to perform molecular dynamics computer simulations and
237 subsequent trajectory analysis. It is developed for
238 biomolecules like proteins, but the extremely high
239 performance means it is used also in several other field
240 like polymer chemistry and solid state physics.
242 This package provides scripts needed to run GROMACS with
243 csh and a completion script.
245 %package tutor
246 Summary: GROMACS tutorial files
247 Group: Applications/Engineering
248 Requires: gromacs-common = %{version}-%{release}
250 %description tutor
251 GROMACS is a versatile and extremely well optimized package
252 to perform molecular dynamics computer simulations and
253 subsequent trajectory analysis. It is developed for
254 biomolecules like proteins, but the extremely high
255 performance means it is used also in several other field
256 like polymer chemistry and solid state physics.
258 This package provides tutorials for the use of GROMACS.
260 %prep
261 %setup -q
262 %patch0 -p1
264 # Fix incorrect permission
265 chmod a-x src/tools/gmx_xpm2ps.c
269 %build
270 # Assembly kernels haven't got .note.GNU-stack sections
271 # because of incompatibilies with Microsoft Assembler.
272 # Add noexecstack to compiler flags
274 export CFLAGS="%optflags -Wa,--noexecstack -fPIC"
275 export LIBS="-lblas -llapack"
277 # Single precision
278 mkdir single
279 cd single
280 ln -s ../configure .
281 %configure --enable-shared \
282 --disable-static --enable-float \
283 --with-external-blas --with-external-lapack \
284 --with-gsl --with-x
285 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
286 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
288 make %{?_smp_mflags}
289 cd ..
291 # Double precision
292 mkdir double
293 cd double
294 ln -s ../configure .
295 %configure --disable-rpath --enable-shared \
296 --disable-static --disable-float \
297 --with-external-blas --with-external-lapack \
298 --with-gsl --with-x \
299 --program-suffix=_d
300 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
301 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
303 make %{?_smp_mflags}
304 cd ..
306 # Load MPI enviroment
308 %if %modules == 1
309 . /etc/profile.d/modules.sh
310 module load %{_libdir}/openmpi/*/openmpi.module
311 %endif
313 %if %selector == 1
314 # Set MPI environment
315 mpi-selector --set `mpi-selector --list | grep openmpi`
316 source /etc/profile.d/mpi-selector.sh
317 %endif
320 # MPI, single precision
322 mkdir mpi-single
323 cd mpi-single
324 ln -s ../configure .
325 %configure --enable-shared \
326 --disable-static --enable-float \
327 --with-external-blas --with-external-lapack \
328 --with-gsl --with-x --enable-mpi \
329 --program-suffix=_mpi
330 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
331 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
333 make %{?_smp_mflags} mdrun
334 #make %{?_smp_mflags}
335 cd ..
337 # MPI, double precision
338 mkdir mpi-double
339 cd mpi-double
340 ln -s ../configure .
341 %configure --enable-shared \
342 --disable-static --disable-float \
343 --with-external-blas --with-external-lapack \
344 --with-gsl --with-x --enable-mpi \
345 --program-suffix=_mpi_d
346 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
347 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
349 make %{?_smp_mflags} mdrun
350 #make %{?_smp_mflags}
351 cd ..
354 %install
355 rm -rf %{buildroot}
357 # Single precision
358 cd single
359 make DESTDIR=%{buildroot} INSTALL="install -p" install
360 cd ..
362 # Double precision
363 cd double
364 make DESTDIR=%{buildroot} INSTALL="install -p" install
365 cd ..
369 # MPI, single precision
370 cd mpi-single
371 make DESTDIR=%{buildroot} INSTALL="install -p" install-mdrun
372 cd ..
374 # MPI, double precision
375 cd mpi-double
376 make DESTDIR=%{buildroot} INSTALL="install -p" install-mdrun
377 cd ..
379 # Install manual & packager's note
380 install -cpm 644 %{SOURCE1} .
381 install -cpm 644 %{SOURCE6} README.fedora
383 # Remove broken makefiles generated by build process
384 rm -rf %{buildroot}%{_datadir}/%{name}/template/Makefil*
385 # Install template makefiles
386 install -cpm 644 %{SOURCE2} %{buildroot}%{_datadir}/%{name}/template/Makefile.single
387 install -cpm 644 %{SOURCE3} %{buildroot}%{_datadir}/%{name}/template/Makefile.double
388 install -cpm 644 %{SOURCE4} %{buildroot}%{_datadir}/%{name}/template/Makefile.mpi.single
389 install -cpm 644 %{SOURCE5} %{buildroot}%{_datadir}/%{name}/template/Makefile.mpi.double
392 # Fix GMXRC file permissions
393 chmod a+x %{buildroot}%{_bindir}/GMXRC %{buildroot}%{_bindir}/GMXRC.*
395 # Rename binaries and man pages to prevent clashes
396 # (This is done here so that we don't need to mess with machine generated makefiles.
397 for bin in anadock do_dssp editconf eneconv genbox genconf genion genrestr gmxcheck gmxdump grompp highway luck make_edi make_ndx mdrun mk_angndx ngmx pdb2gmx protonate sigeps tpbconv trjcat trjconv trjorder wheel x2top xpm2ps xrama ; do
398 mv %{buildroot}%{_bindir}/${bin} %{buildroot}%{_bindir}/g_${bin}
399 mv %{buildroot}%{_bindir}/${bin}_d %{buildroot}%{_bindir}/g_${bin}_d
400 done
402 for bin in demux.pl xplor2gmx.pl; do
403 mv %{buildroot}%{_bindir}/$bin %{buildroot}%{_bindir}/g_${bin}
404 done
406 # MPI-enabled binaries (list will continue when the makefile has
407 # the possibility to compile all mpi-enabled files
408 for mpibin in mdrun; do
409 mv %{buildroot}%{_bindir}/${mpibin}_mpi %{buildroot}%{_bindir}/g_${mpibin}_mpi
410 mv %{buildroot}%{_bindir}/${mpibin}_mpi_d %{buildroot}%{_bindir}/g_${mpibin}_mpi_d
411 done
413 # Man pages
414 for bin in anadock do_dssp editconf eneconv genbox genconf genion genrestr gmxcheck gmxdump grompp highway make_edi make_ndx mdrun mk_angndx ngmx pdb2gmx protonate sigeps tpbconv trjcat trjconv trjorder wheel x2top xpm2ps xrama ; do
415 mv %{buildroot}%{_mandir}/man1/${bin}.1 %{buildroot}%{_mandir}/man1/g_${bin}.1
416 mv %{buildroot}%{_mandir}/man1/${bin}_d.1 %{buildroot}%{_mandir}/man1/g_${bin}_d.1
417 done
419 # Move completion files around
420 chmod a-x %{buildroot}%{_bindir}/completion.*
421 # Zsh
422 mkdir -p %{buildroot}%{_datadir}/zsh/site-functions
423 mv %{buildroot}%{_bindir}/completion.zsh %{buildroot}%{_datadir}/zsh/site-functions/gromacs
424 # Bash
425 mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
426 mv %{buildroot}%{_bindir}/completion.bash %{buildroot}/etc/bash_completion.d/gromacs
427 # Tcsh
428 mv %{buildroot}%{_bindir}/completion.csh .
430 # Remove .la files
431 rm -rf %{buildroot}/%{_libdir}/*.la
433 # Post install for libs
435 %post libs -p /sbin/ldconfig
437 %postun libs -p /sbin/ldconfig
439 %post mpi-libs -p /sbin/ldconfig
441 %postun mpi-libs -p /sbin/ldconfig
444 %clean
445 rm -rf %{buildroot}
450 # Files section
452 %files
453 %defattr(-,root,root,-)
454 %{_bindir}/*
455 %exclude %{_bindir}/g_mdrun_mpi
456 %exclude %{_bindir}/g_mdrun_mpi_d
457 %exclude %{_bindir}/GMXRC*
459 %files libs
460 %defattr(-,root,root,-)
461 %{_libdir}/libgmx.so.*
462 %{_libdir}/libgmx_d.so.*
463 %{_libdir}/libgmxana.so.*
464 %{_libdir}/libgmxana_d.so.*
465 %{_libdir}/libmd.so.*
466 %{_libdir}/libmd_d.so.*
468 %files mpi
469 %defattr(-,root,root,-)
470 %{_bindir}/g_mdrun_mpi
471 %{_bindir}/g_mdrun_mpi_d
474 %files mpi-libs
475 %defattr(-,root,root,-)
476 %{_libdir}/libgmx_mpi.so.*
477 %{_libdir}/libgmx_mpi_d.so.*
478 %{_libdir}/libmd_mpi.so.*
479 %{_libdir}/libmd_mpi_d.so.*
483 %files common
484 %defattr(-,root,root,-)
485 %doc AUTHORS COPYING README manual-4.0.pdf README.fedora
486 %{_bindir}/GMXRC
487 %{_bindir}/GMXRC.bash
488 %{_mandir}/man1/*
489 %{_datadir}/%{name}
490 %exclude %{_datadir}/%{name}/template
491 %exclude %{_datadir}/%{name}/tutor
493 %files devel
494 %defattr(-,root,root,-)
495 %{_includedir}/%{name}
496 %{_libdir}/libgmx.so
497 %{_libdir}/libgmx_d.so
498 %{_libdir}/libgmxana.so
499 %{_libdir}/libgmxana_d.so
500 %{_libdir}/libmd.so
501 %{_libdir}/libmd_d.so
502 %{_datadir}/%{name}/template
503 %exclude %{_datadir}/%{name}/template/Makefile.mpi.*
505 %files mpi-devel
506 %defattr(-,root,root,-)
507 %{_libdir}/libgmx_mpi.so
508 %{_libdir}/libgmx_mpi_d.so
509 %{_libdir}/libmd_mpi.so
510 %{_libdir}/libmd_mpi_d.so
511 %{_datadir}/%{name}/template/Makefile.mpi.*
514 %files zsh
515 %defattr(-,root,root,-)
516 %{_datadir}/zsh/site-functions/gromacs
517 %{_bindir}/GMXRC.zsh
519 %files bash
520 %defattr(-,root,root,-)
521 %config(noreplace) %{_sysconfdir}/bash_completion.d/gromacs
524 %files csh
525 %defattr(-,root,root,-)
526 %doc completion.csh
527 %{_bindir}/GMXRC.csh
529 %files tutor
530 %defattr(-,root,root,-)
531 %{_datadir}/%{name}/tutor
534 %changelog
535 * Wed Jan 14 2009 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0.2-7
536 - Update manual to latest version.
537 - Removed Requires: blas and lapack.
539 * Mon Nov 10 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0.2-6
540 - Update to 4.0.2.
542 * Sun Nov 09 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0.1-5
543 - Add Requires: blas too.
545 * Sun Nov 09 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0.1-4
546 - Update to 4.0.1.
547 - Add Requires: lapack and openmpi to prevent yum from pulling atlas and lam
548 instead.
550 * Wed Oct 15 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-3
551 - Rename also man pages.
553 * Mon Oct 13 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-2
554 - Added noreplace to bash completion file.
555 - Changed double precision mpi binary suffix to _mpi_d.
557 * Sun Oct 12 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-1
558 - Update to Gromacs 4.0.
559 - Remove module system and patch file names to begin with g_.
561 * Wed Oct 08 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.15.rc3
562 - Changed location of binaries.
563 - Removed conflict of module file, as the program is binary compatible with older versions.
565 * Wed Oct 08 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.14.rc3
566 - The gromacs module is loaded automatically and it conflicts with gromacs3.
568 * Tue Oct 07 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.13.rc3
569 - Renamed module files from %%{name}-%%{version} to %%{name}.
571 * Mon Oct 06 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.12.rc3
572 - Fix BR to get GROMACS to build in mock for epel-4.
574 * Sat Oct 04 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.11.rc3
575 - Fix to get GROMACS to build in mock for epel-5.
577 * Sat Oct 04 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.10.rc3
578 - Implement module system & remove binary renaming.
579 - No need for autoreconf anymore.
580 - Update to rc3.
582 * Sat Oct 04 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.9.rc2
583 - Fall back to autoreconf due to binary renaming.
585 * Fri Oct 03 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.8.rc2
586 - Modified install commands to preserve timestamps.
588 * Fri Oct 03 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.7.rc2
589 - Even more review fixes.
590 - Binaries renamed:
591 highway -> g_highway
592 luck -> g_luck
593 sigeps -> g_sigeps
594 wheel -> g_wheel
596 * Thu Oct 02 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.6.rc2
597 - Final review fixes.
599 * Wed Oct 01 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.5.rc2
600 - Strip down requires by branching tutor to its own package.
602 * Tue Sep 30 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.4.rc2
603 - Extensive package review fixes.
604 - Unclear licenses on some files, filed upstream bug 217.
605 http://bugzilla.gromacs.org/show_bug.cgi?id=217
607 * Mon Sep 29 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.3.rc2
608 - Move .so files to -devel package.
609 - Remove .la files.
611 * Mon Sep 29 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.2.rc2
612 - Implement out-of-tree-builds.
613 - Add --noexecstack to CFLAGS.
614 - Remove execstack procedure and prelink from buildreqs.
615 - Filed upstream bug 215 to add .note.GNU-stack .
616 - Fix incorrect file permission on src/tools/gmx_xpm2ps.c .
618 * Mon Sep 29 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.1.rc2
619 - Alphabetized buildrequires.
620 - Changed gromacs-share to gromacs-common.
622 * Fri Sep 26 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.0.rc2
623 - Initial build.