Add listing of programs by topic to HTML output.
[alexxy/gromacs.git] / admin / gromacs.spec
1 Name:           gromacs
2 Version:        4.5
3 Release:        7%{?dist}
4 Summary:        GROMACS binaries
5 Group:          Applications/Engineering
6 License:        LGPLv2.1
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
15
16 # Add shebangs to scripts
17 Patch0:         gromacs-GMXRC.patch
18
19 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
20 Requires:       gromacs-common  = %{version}-%{release}
21
22 BuildRequires:  fftw-devel
23 BuildRequires:  gsl-devel
24 BuildRequires:  libxml2-devel
25 BuildRequires:  openmpi-devel
26
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
36
37 # Check for mpi-selector or environment-modules
38
39 %define selector 0
40 %define modules 0
41
42 %if 0%{?fedora} > 9
43 %define modules 1
44 %endif
45
46 %if 0%{?rhel} == 4
47 %define selector 1
48 %endif
49
50 %if 0%{?rhel} == 5
51 %define selector 1
52 %endif
53
54 %if %modules == 1
55 BuildRequires:  environment-modules
56 %endif
57
58 %if %selector == 1
59 BuildRequires:  mpi-selector
60 %endif
61
62
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.
70
71 This package provides single and double precision binaries.
72 The documentation is in the package gromacs-common.
73
74 N.B. All binaries have names starting with g_, for example
75 mdrun has been renamed to g_mdrun.
76
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
84
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.
92
93 This package provides runtime libraries needed for the
94 single and double precision binaries.
95
96
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
104
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.
112
113 This package provides MPI single precision and double
114 precision binaries.
115
116
117 %package common
118 Summary:        GROMACS shared data and documentation
119 Group:          Applications/Engineering
120
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.
128
129 This package includes architecture independent data and
130 documentation.
131
132
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}
138
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.
146
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.
151
152
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
160
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.
168
169 This package contains development libraries for GROMACS MPI.
170 You need it if you want to write your own analysis programs.
171
172
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
182
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.
190
191 This package provides runtime libraries needed for the
192 MPI single and double precision binaries.
193
194
195 %package bash
196 Summary:        GROMACS bash completion
197 Group:          Applications/Engineering
198 Requires:       bash-completion
199
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.
207
208 This package provides the needed 
209 bash completion for GROMACS
210
211
212 %package zsh
213 Summary:        GROMACS zsh support
214 Group:          Applications/Engineering
215 Requires:       zsh
216
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.
224
225 This package provides scripts needed to run GROMACS with
226 zsh, also it provides zsh completion.
227
228
229 %package csh
230 Summary:        GROMACS csh support
231 Group:          Applications/Engineering
232 Requires:       csh
233
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.
241
242 This package provides scripts needed to run GROMACS with
243 csh and a completion script.
244
245 %package tutor
246 Summary:        GROMACS tutorial files
247 Group:          Applications/Engineering
248 Requires:       gromacs-common = %{version}-%{release}
249
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.
257
258 This package provides tutorials for the use of GROMACS.
259
260 %prep
261 %setup -q
262 %patch0 -p1
263
264 # Fix incorrect permission
265 chmod a-x src/tools/gmx_xpm2ps.c
266
267
268
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
273
274 export CFLAGS="%optflags -Wa,--noexecstack -fPIC"
275 export LIBS="-lblas -llapack"
276
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
287
288 make %{?_smp_mflags}
289 cd ..
290
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
302
303 make %{?_smp_mflags}
304 cd ..
305
306 # Load MPI enviroment
307
308 %if %modules == 1
309 . /etc/profile.d/modules.sh
310 module load %{_libdir}/openmpi/*/openmpi.module
311 %endif
312
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
318
319
320 # MPI, single precision
321
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
332
333 make %{?_smp_mflags} mdrun
334 #make %{?_smp_mflags}
335 cd ..
336
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
348
349 make %{?_smp_mflags} mdrun
350 #make %{?_smp_mflags}
351 cd ..
352
353
354 %install
355 rm -rf %{buildroot}
356
357 # Single precision
358 cd single
359 make DESTDIR=%{buildroot} INSTALL="install -p" install
360 cd ..
361
362 # Double precision
363 cd double
364 make DESTDIR=%{buildroot} INSTALL="install -p" install
365 cd ..
366
367
368
369 # MPI, single precision
370 cd mpi-single
371 make DESTDIR=%{buildroot} INSTALL="install -p" install-mdrun
372 cd ..
373
374 # MPI, double precision
375 cd mpi-double
376 make DESTDIR=%{buildroot} INSTALL="install -p" install-mdrun
377 cd ..
378
379 # Install manual & packager's note
380 install -cpm 644 %{SOURCE1} .
381 install -cpm 644 %{SOURCE6} README.fedora
382
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
390
391
392 # Fix GMXRC file permissions
393 chmod a+x %{buildroot}%{_bindir}/GMXRC %{buildroot}%{_bindir}/GMXRC.*
394
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 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
401
402 for bin in demux.pl xplor2gmx.pl; do
403 mv %{buildroot}%{_bindir}/$bin %{buildroot}%{_bindir}/g_${bin}
404 done
405
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
412
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
418
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 . 
429
430 # Remove .la files
431 rm -rf %{buildroot}/%{_libdir}/*.la
432
433 # Post install for libs
434
435 %post libs -p /sbin/ldconfig
436
437 %postun libs -p /sbin/ldconfig
438
439 %post mpi-libs -p /sbin/ldconfig
440
441 %postun mpi-libs -p /sbin/ldconfig
442
443
444 %clean
445 rm -rf %{buildroot}
446
447
448
449
450 # Files section
451
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*
458
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.*
467
468 %files mpi
469 %defattr(-,root,root,-)
470 %{_bindir}/g_mdrun_mpi
471 %{_bindir}/g_mdrun_mpi_d
472
473
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.*
480
481
482
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
492
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.*
504
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.*
512
513
514 %files zsh
515 %defattr(-,root,root,-)
516 %{_datadir}/zsh/site-functions/gromacs
517 %{_bindir}/GMXRC.zsh
518
519 %files bash
520 %defattr(-,root,root,-)
521 %config(noreplace) %{_sysconfdir}/bash_completion.d/gromacs
522
523
524 %files csh
525 %defattr(-,root,root,-)
526 %doc completion.csh
527 %{_bindir}/GMXRC.csh
528
529 %files tutor
530 %defattr(-,root,root,-)
531 %{_datadir}/%{name}/tutor
532
533
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.
538
539 * Mon Nov 10 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0.2-6
540 - Update to 4.0.2.
541
542 * Sun Nov 09 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0.1-5
543 - Add Requires: blas too.
544
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.
549
550 * Wed Oct 15 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-3
551 - Rename also man pages.
552
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.
556
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_.
560
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.
564
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.
567
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}.
570
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.
573
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.
576
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.
581
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.
584
585 * Fri Oct 03 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.8.rc2
586 - Modified install commands to preserve timestamps.
587
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
595
596 * Thu Oct 02 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.6.rc2
597 - Final review fixes.
598
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.
601
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
606
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.
610
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 .
617
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.
621
622 * Fri Sep 26 2008 Jussi Lehtola <jussi.lehtola@iki.fi> - 4.0-0.0.rc2
623 - Initial build.