%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
Name: avogadro
Version: 0.9.2
Release: 1%{?dist}
Summary: An advanced molecular editor for chemical purposes
Group: Applications/Editors
License: GPLv2
URL: http://avogadro.openmolecules.net/
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
Patch0: %{name}-icon.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: cmake >= 2.6.0
BuildRequires: qt4-devel >= 4.4.0
BuildRequires: eigen2-devel >= 2.0.0
BuildRequires: openbabel-devel >= 2.2.0
BuildRequires: boost-devel >= 1.34
BuildRequires: numpy >= 1.2.0
BuildRequires: sip-devel >= 4.7.9
BuildRequires: glew-devel >= 1.5.0
BuildRequires: desktop-file-utils
BuildRequires: docbook-utils
BuildRequires: python
%description
An advanced molecular editor designed for
cross-platform use in computational chemistry,
molecular modeling, bioinformatics, materials science,
and related areas, which offers flexible rendering and
a powerful plugin architecture.
%package libs
Summary: Shared libraries for Avogadro
Group: System Environment/Libraries
%description libs
This package contains the shared libraries for the
molecular editor Avogadro.
%package devel
Summary: Development files for Avogadro
Group: Development/Libraries
Requires: %{name}-libs = %{version}-%{release}
%description devel
This package contains files to develop applications using
Avogadros libraries.
%prep
%setup -q
%patch0 -p1
%build
mkdir -p %{_target_platform}
pushd %{_target_platform}
%{cmake} %{?BUILD_TESTS} -DCMAKE_BUILD_TYPE=Release -DENABLE_GLSL=ON -DENABLE_PYTHON=ON -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR=%{_libdir} ..
popd
make %{?_smp_mflags} -C %{_target_platform}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT -C %{_target_platform}
# system menu entry
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
desktop-file-install --vendor="" \
--dir=$RPM_BUILD_ROOT%{_datadir}/applications \
%{SOURCE1}
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/pixmaps/%{name}_icon.png
%{_datadir}/applications/%{name}.desktop
%files devel
%defattr(-,root,root,-)
%{_datadir}/libavogadro
%{_includedir}/*.h
%{_libdir}/*.so
%files libs
%defattr(-,root,root,-)
%{_libdir}/%{name}
%{_libdir}/*.so.*
%{python_sitelib}/Avogadro.so
%changelog
* Sat Mar 14 2009 Sebastian Dziallas <sebastian@when.com> 0.9.2-1
- update to new release
* Wed Feb 25 2009 Sebastian Dziallas <sebastian@when.com> 0.9.1-1
- update to new release
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Thu Jan 22 2009 Sebastian Dziallas <sebastian@when.com> 0.9.0-1
- update to new release
* Sun Sep 14 2008 Sebastian Dziallas <sebastian@when.com> 0.8.1-6
- add handbook to docs
* Sun Sep 14 2008 Sebastian Dziallas <sebastian@when.com> 0.8.1-5
- add build requirements and fix group names
* Wed Aug 13 2008 Sebastian Dziallas <sebastian@when.com> 0.8.1-4
- fix typos
* Sat Aug 9 2008 Sebastian Dziallas <sebastian@when.com> 0.8.1-3
- reorganize spec file
* Sat Aug 9 2008 Sebastian Dziallas <sebastian@when.com> 0.8.1-2
- rename shared library package and structure spec file
* Sun Aug 3 2008 Sebastian Dziallas <sebastian@when.com> 0.8.1-1
- initial pacakging release based on PackMan release