Blob Blame History Raw
Name:		towhee
Version:	7.0.1
Release:	1%{?dist}
Summary:	A Monte Carlo molecular simulation code
Group:		Applications/Engineering
License:	GPLv2+
URL:		http://towhee.sourceforge.net/
Source0:	http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Requires:	towhee-common = %{version}-%{release}

# Bug 502883
# Error: operand out of range (0x0000000000008008 is not between 0xffffffffffff8000 and 0x0000000000007fff)
# -mminimal-toc doesn't help
ExcludeArch:	ppc64

BuildRequires:	gcc-gfortran
BuildRequires:	openmpi-devel
BuildRequires:	mpich2-devel

%description
Towhee is a Monte Carlo molecular simulation code originally designed for the
prediction of fluid phase equilibria using atom-based force fields and the
Gibbs ensemble with particular attention paid to algorithms addressing
molecule conformation sampling. The code has subsequently been extended to
several ensembles, many different force fields, and solid (or at least porous)
phases.

This package contains binaries for serial operation and the utilities.

N.B. Due to some general names the utilities have a towhee- prefix, e.g.
analyse_movie is now towhee-analyse_movie.


%package openmpi
Summary:	Towhee, Open MPI version
Group:		Applications/Engineering
Requires:	towhee-common = %{version}-%{release}
Obsoletes:	towhee-mpi < %{version}-%{release}
Provides:	towhee-mpi = %{version}-%{release}
Requires:	openmpi

%description openmpi
This package contains MPI enabled binaries of Towhee, compiled against
Open MPI.

If you want the analysis tools, install the towhee package.

%package mpich2
Summary:	Towhee, MPICH2 version
Group:		Applications/Engineering
Requires:	towhee-common = %{version}-%{release}
Requires:	mpich2

%description mpich2
This package contains MPI enabled binaries of Towhee, compiled against MPICH2.

If you want the analysis tools, install the towhee package.


%package common
Summary:	Towhee common files
Group:		Applications/Engineering
# So that the package gets removed with the binaries
Requires:	%{name} = %{version}-%{release}
BuildArch:	noarch

%description common
This package contains files needed for operation of Towhee.

%package doc
Summary:	Towhee manual
Group:		Applications/Engineering
BuildArch:	noarch

%description doc
This package contains the HTML manual for Towhee.

%package examples
Summary:	Towhee examples
Group:		Applications/Engineering
BuildArch:	noarch

%description examples
This package contains examples for Towhee operation.

%prep
%setup -q
# Get rid of spurious executable flags
find ForceFields/ -type f -exec chmod 644 {} \;
find Examples/ -type f -exec chmod 644 {} \;

# Fix Force field locations in examples
for file in Examples/*/towhee_input; do
 sed "s|/towheebase/ForceFields|%{_datadir}/%{name}/ForceFields|g" $file > $file.new && \
 touch -r $file $file.new && \
 mv $file.new $file
done

%build
## Build the main binaries
# Use gfortran, not g77.
export F77=gfortran

# MPICH package is broken and needs to be specifically unloaded, first.
%{_mpich2_unload}

## Build serial version
mkdir nompi
cd nompi
ln -s ../configure .
%configure
make %{?_smp_mflags}

# Utilities
cd Utils
make %{?_smp_mflags}
cd ..

cd ..

## Build parallel versions
# Use mpif90 to build
export F77=mpif90

%{_openmpi_load}
mkdir openmpi
cd openmpi
ln -s ../configure .
%configure --enable-mpi --program-suffix=${MPI_SUFFIX}
make %{?_smp_mflags}
cd ..
%{_openmpi_unload}

%{_mpich2_load}
mkdir mpich2
cd mpich2
ln -s ../configure .
%configure --enable-mpi --program-suffix=${MPI_SUFFIX}
make %{?_smp_mflags}
cd ..
%{_mpich2_unload}


%install
rm -rf %{buildroot} 
# Install binaries
make -C openmpi install DESTDIR=%{buildroot} bindir=%{_libdir}/openmpi/bin INSTALL="install -p"
make -C mpich2 install DESTDIR=%{buildroot} bindir=%{_libdir}/mpich2/bin INSTALL="install -p"
make -C nompi install DESTDIR=%{buildroot} INSTALL="install -p"

# Install force fields
find ForceFields/ -name "Makefile*" -exec rm {} \;
mkdir -p %{buildroot}%{_datadir}/%{name}
cp -a ForceFields %{buildroot}%{_datadir}/%{name}

# Remove makefiles from the examples & remove executable permissions
find Manual/ -name "Makefile*" -exec rm {} \;
find Examples/ -name "Makefile*" -exec rm {} \;

# Rename utilities
for bin in {analyse_{movie,histogram},car2towhee,charmm2pdb,{faux,pdb,xmd,xtl,xyz}2towhee,fitcoex,jre_to_towhee,maftodensity,rdf2pmfpair,unitcell}; do
 mv %{buildroot}%{_bindir}/$bin %{buildroot}%{_bindir}/towhee-$bin
done
# Remove mpi versions of the utilities
for mpi in openmpi mpich2; do
 for bin in {analyse_{movie,histogram},car2towhee,charmm2pdb,{faux,pdb,xmd,xtl,xyz}2towhee,fitcoex,jre_to_towhee,maftodensity,rdf2pmfpair,unitcell}; do
  rm %{buildroot}%{_libdir}/$mpi/bin/${bin}_${mpi}
 done
done

%clean
rm -rf %{buildroot} 

%files
%defattr(-,root,root,-)
%doc license.gpl
%{_bindir}/forcefield
%{_bindir}/towhee
# Utils
%{_bindir}/towhee-*

%files openmpi
%defattr(-,root,root,-)
%{_libdir}/openmpi/bin/*_openmpi

%files mpich2
%defattr(-,root,root,-)
%{_libdir}/mpich2/bin/*_mpich2

%files common
%defattr(-,root,root,-)
%doc license.gpl
%{_datadir}/%{name}/

%files doc
%defattr(-,root,root,-)
%doc Manual/projects/towhee/*

%files examples
%defattr(-,root,root,-)
%doc Examples/*

%changelog
* Sun Aug 21 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 7.0.1-1
- Update to 7.0.1.

* Thu Aug 18 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 7.0.0-1
- Update to 7.0.0.

* Wed Aug 17 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.19-1
- Update to 6.2.19.

* Mon Aug 08 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.18-1
- Update to 6.2.18.

* Sat Aug 06 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.17-1
- Update to 6.2.17.

* Wed Aug 03 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.16-2
- Workaround broken MPICH2.

* Wed Aug 03 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.16-1
- Update to 6.2.16.

* Wed Mar 30 2011 Deji Akingunola <dakingun@gmail.com> - 6.2.15-3
- Rebuild for mpich2 soname bump

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.2.15-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sun Feb 06 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.15-1
- Update to 6.2.15.

* Fri Dec 10 2010 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.14-1
- Update to 6.2.14.

* Mon Oct 25 2010 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.12-2
- Bump spec due to upgrades of MPICH2 and OpenMPI.

* Wed Aug 18 2010 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.12-1
- Update to 6.2.12.

* Sat Jul 24 2010 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.11-1
- Update to 6.2.11.

* Sat Jun 19 2010 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.9-1
- Update to 6.2.9.

* Sat Dec 19 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.7-1
- Adopt MPI guidelines, fixing FTBFS in rawhide.

* Fri Oct 23 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.6-4
- Fix FTBFS problem caused by behaviour change of openmpi.

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.2.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Thu Jul 16 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.6-1
- Restore ExcludeArch: ppc64.

* Thu Jul 16 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.6-1
- Update to upstream 6.2.6.

* Wed Jun 17 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.5-1
- Update to upstream 6.2.5, which fixes the naming bug of fitcoex in 6.2.4.

* Tue Jun 16 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.4-1
- Update to upstream 6.2.4, which adds utilities.

* Wed May 27 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.3-5
- ExcludeArch: ppc64 which is not working due to operand out of range error.
  See RHBZ #502883.

* Wed May 27 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.3-4
- Fix MPI build on rawhide.

* Wed May 27 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.3-3
- Fix build in rawhide.

* Mon May 25 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.3-2
- Split examples into own subpackage.
- Make examples and doc noarch on >=F11.

* Fri May 01 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.3-1
- Update to 6.2.3 that fixes shebangs and executable bit problems.

* Thu Apr 30 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.2-3
- Removed Makefiles also from ForceFields.

* Wed Apr 29 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.2-2
- Changed defines to globals.
- Added missing BR: openmpi-devel.

* Wed Apr 29 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 6.2.2-1
- First release.