Blob Blame History Raw
Summary: A program for 2D drawing organic molecules
Name: chemtool
Version: 1.6.13
Release: 1%{?dist}
License: GPLv2+
Group: Applications/Editors
Source0: http://ruby.chemie.uni-freiburg.de/~martin/chemtool/%{name}-%{version}.tar.gz
Patch0: %{name}-compile.patch
Patch1: %{name}-desktop.patch
Patch2: %{name}-gmd.patch
URL: http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
BuildRequires: desktop-file-utils
BuildRequires: gtk2-devel
BuildRequires: libXt-devel
BuildRequires: kdelibs
Requires: openbabel
Requires: transfig

%description
Chemtool is a program for drawing organic molecules easily and store them
in a variety of output formats including as a X bitmap, Xfig, SVG or EPS
file.  It runs under the X Window System using the GTK widget set.

%prep
%setup -q
%patch0 -p1 -b .compile
%patch1 -p1 -b .d
%patch2 -p1 -b .gmd

%build
%configure \
  --with-kdedir=%{_prefix} \
  --with-gnomedir=%{_prefix}
%{__make} %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT

install -d $RPM_BUILD_ROOT%{_datadir}/{applications,mimelnk/application,mime-info,mime-types,pixmaps} \
        $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/{32x32/mimetypes,48x48/apps}

# fix line endings
pushd examples
tr -d '\r' < 14263232.mol > 14263232.mol.unix && mv -f 14263232.mol.unix 14263232.mol
tr -d '\r' < sample.sdf > sample.sdf.unix && mv -f sample.sdf.unix sample.sdf
popd

%{__make} DESTDIR=$RPM_BUILD_ROOT install

install -p kde/mimelnk/application/x-chemtool.desktop     $RPM_BUILD_ROOT%{_datadir}/mimelnk/application
install -p kde/icons/hicolor/32x32/mimetypes/chemtool.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/mimetypes
install -p gnome/mime-types/chemtool.*                    $RPM_BUILD_ROOT%{_datadir}/mime-types
install -p gnome/gnome-application-chemtool.png           $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/chemtool.png
install -p chemtool.xpm                                   $RPM_BUILD_ROOT%{_datadir}/pixmaps
desktop-file-install --vendor=fedora \
                     --dir=$RPM_BUILD_ROOT%{_datadir}/applications \
                     --add-category=Education \
                     --add-category=Science \
                     --add-category=Chemistry \
                     pld/chemtool.desktop

%find_lang %{name}

%post
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%{_bindir}/update-desktop-database &> /dev/null ||:

%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
  touch --no-create %{_datadir}/icons/hicolor
  gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
%{_bindir}/update-desktop-database &> /dev/null ||:

%clean
rm -rf %{buildroot}

%files -f %{name}.lang
%defattr(644,root,root,755)
%doc ChangeLog README TODO examples
%attr(755,root,root) %{_bindir}/*
%{_datadir}/mimelnk/application/*
%{_datadir}/mime-types/chemtool.*
%{_datadir}/pixmaps/*.xpm
%{_datadir}/icons/hicolor/*/*/*.png
%{_datadir}/applications/*.desktop
%{_mandir}/man1/*

%changelog
* Mon Mar 12 2012 Dominik Mierzejewski <rpm@greysector.net> - 1.6.13-1
- updated to 1.6.13
- dropped upstreamed explicit libX11 linking patch

* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.12-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Dec 06 2011 Adam Jackson <ajax@redhat.com> - 1.6.12-4
- Rebuild for new libpng

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.12-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Mon Feb 15 2010 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.12-2
- fixed FTBFS with new ld (rhbz#564785)

* Sat Aug 22 2009 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.12-1
- updated to 1.6.12
- dropped obsolete patch hunks
- moved gtk-update-icon-cache to posttrans scriptlet

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.11-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.11-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.6.11-3
- Autorebuild for GCC 4.3

* Sun Sep 23 2007 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.11-2
- drop libEMF dependency (current transfig/fig2dev supports EMF output)

* Sun Aug 26 2007 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.11-1
- updated to 1.6.11
- updated license tag
- specfile cleanups
- fixed GNOME dir detection
- fixed build with libEMF

* Wed Apr 25 2007 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.10-1
- updated to 1.6.10

* Thu Dec 22 2006 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.9-7
- fix stupid directory creation bug

* Thu Dec 21 2006 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.9-6
- fix MIME type in desktop file (#220125)

* Mon Nov 20 2006 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.9-5
- keep the whole examples dir in docs
- add update-desktop-database call to post{,un} scripts

* Mon Nov 20 2006 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.9-4
- fix build without mock

* Sun Nov 19 2006 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.9-3
- added missing BRs
- add scriptlets to update icon cache

* Sun Nov 19 2006 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.9-2
- don't use non-standard macros

* Fri Nov 17 2006 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.9-1
- initial build, based on bioxray.dk and PLD specfiles