Name: mopac7
Summary: Semi-empirical quantum mechanics suite
Version: 1.15
Release: 8%{?dist}
License: Public Domain
Group: Applications/Engineering
URL: http://sourceforge.net/projects/mopac7/
Source0: http://www.uku.fi/~thassine/projects/download/current/%{name}-%{version}.tar.gz
BuildRequires: gcc-gfortran
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%description
MOPAC7 is a semi-empirical quantum-mechanics code written by James
J. P. Stewart and co-workers. The purpose of this project is to
maintain MOPAC7 as a stand-alone program as well as a library that
provides the functionality of MOPAC7 to other programs.
%package libs
Summary: Dynamic libraries from %{name}
Group: Development/Libraries
%description libs
Dynamic libraries from %{name}.
%package devel
Summary: Header files and static libraries from %{name}
Group: Development/Libraries
Requires: %{name}-libs = %{version}-%{release}
Requires: pkgconfig
%description devel
Libraries and header include files for developing programs based on %{name}.
%prep
%setup -q
perl -pi -e "s#-lg2c##g" libmopac7.pc.in
%build
%configure --disable-static
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
make DESTDIR="%{buildroot}" INSTALL="install -p" install
# make install does not actually install the main binary
# chrpath --delete fortran/.libs/%{name}
install -D -p -m 755 fortran/.libs/%{name} %{buildroot}%{_bindir}/%{name}
# install a convenience fortran wrapper for the main binary
sed "s;./fortran;%{_bindir};" run_mopac7 > %{buildroot}%{_bindir}/run_mopac7
chmod 755 %{buildroot}%{_bindir}/run_mopac7
# kill off the .la files
find %{buildroot}%{_libdir} -name *.la -exec rm -rf {} \;
# kill off the makefiles in tests directory so we can use them as samples in %doc
find tests -name 'Makefile*' -exec rm -rf {} \;
%clean
rm -rf %{buildroot}
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc tests
%{_bindir}/mopac7
%{_bindir}/run_mopac7
%files libs
%defattr(-,root,root,-)
%doc AUTHORS COPYING ChangeLog NEWS README
%{_libdir}/libmopac7.so.*
%files devel
%defattr(-,root,root,-)
%{_includedir}/mopac7/
%{_libdir}/libmopac7.so
%{_libdir}/pkgconfig/libmopac7.pc
%changelog
* Sat Jan 02 2010 Jussi Lehtola <jussi.lehtola@iki.fi> 1.15-8
- avoid use of chrpath.
* Wed Dec 23 2009 Carl Byington <carl@five-ten-sg.com> 1.15-7
- fedora review changes, remove rpath from binaries,
--disable-rpath not enough, needs chrpath.
- move the %%doc files to -libs package.
* Wed Dec 23 2009 Carl Byington <carl@five-ten-sg.com> 1.15-6
- proper installation of the main binary rather than the
libtool wrapper.
- fixup the fortran wrapper script to properly reference the
installed binary.
* Wed Dec 23 2009 Carl Byington <carl@five-ten-sg.com> 1.15-5
- devel requires pkgconfig for EPEL
- build requires gcc-gfortran
* Wed Dec 23 2009 Carl Byington <carl@five-ten-sg.com> 1.15-4
- install -p to preserve timestamps
- explicit includedir name
- add pkgconfig for EPEL
* Sun Dec 20 2009 Carl Byington <carl@five-ten-sg.com> 1.15-3
- explicit names in %%files section rather than wildcards
* Wed Dec 02 2009 Carl Byington <carl@five-ten-sg.com> 1.15-2
- fix source url path
- remove static libraries
* Wed Nov 25 2009 Carl Byington <carl@five-ten-sg.com> 1.15-1
- convert to fedora compatible spec file
* Tue Aug 22 2006 Per Øyvind Karlsen <pkarlsen@mandriva.com> 1.11-2mdv2007.0
- remove -lg2c from pkgconfig file
* Tue Aug 22 2006 Per Øyvind Karlsen <pkarlsen@mandriva.com> 1.11-1mdv2007.0
- 1.11
- %%mkrel
- fix mixed-use-of-spaces-and-tabs
* Sun Dec 04 2005 Austin Acton <austin@mandriva.org> 1.10-1mdk
- New release 1.10
* Fri Aug 12 2005 Austin Acton <austin@mandrake.org> 1.00-1mdk
- initial package