5af5e47
Summary: A program for 2D drawing organic molecules
5af5e47
Name: chemtool
af26aa3
Version: 1.6.10
af26aa3
Release: 1%{?dist}
5af5e47
License: GPL
5af5e47
Group: Applications/Editors
5af5e47
Source0: http://ruby.chemie.uni-freiburg.de/~martin/chemtool/%{name}-%{version}.tar.gz
5af5e47
Patch0: %{name}-compile.patch
5af5e47
Patch1: %{name}-desktop.patch
5af5e47
URL: http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html
5af5e47
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
5af5e47
BuildRequires: desktop-file-utils
5af5e47
BuildRequires: gtk2-devel
5af5e47
BuildRequires: libEMF-devel
5af5e47
BuildRequires: libXt-devel
5af5e47
BuildRequires: gnome-mime-data
5af5e47
BuildRequires: kdelibs
5af5e47
Requires: openbabel
5af5e47
Requires: transfig
5af5e47
5af5e47
%description
5af5e47
Chemtool is a program for drawing organic molecules easily and store them
5af5e47
in a variety of output formats including as a X bitmap, Xfig, SVG or EPS
5af5e47
file.  It runs under the X Window System using the GTK widget set.
5af5e47
5af5e47
%prep
5af5e47
%setup -q
5af5e47
%patch0 -p1 -b .compile
5af5e47
%patch1 -p1 -b .d
5af5e47
5af5e47
%build
5af5e47
%configure \
5af5e47
  --enable-emf \
5af5e47
  --with-kdedir=%{_prefix} \
5af5e47
  --with-gnomedir=%{_prefix}
5af5e47
%{__make} %{?_smp_mflags}
5af5e47
5af5e47
%install
5af5e47
rm -rf $RPM_BUILD_ROOT
5af5e47
5af5e47
install -d $RPM_BUILD_ROOT%{_datadir}/{applications,mimelnk/application,mime-info,mime-types,pixmaps} \
b572d8f
        $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/{32x32/mimetypes,48x48/apps}
5af5e47
5af5e47
# fix line endings
5af5e47
pushd examples
5af5e47
tr -d '\r' < 14263232.mol > 14263232.mol.unix && mv -f 14263232.mol.unix 14263232.mol
5af5e47
tr -d '\r' < sample.sdf > sample.sdf.unix && mv -f sample.sdf.unix sample.sdf
5af5e47
popd
5af5e47
5af5e47
%{__make} DESTDIR=$RPM_BUILD_ROOT install
5af5e47
5af5e47
install -p kde/mimelnk/application/x-chemtool.desktop     $RPM_BUILD_ROOT%{_datadir}/mimelnk/application
5af5e47
install -p kde/icons/hicolor/32x32/mimetypes/chemtool.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/mimetypes
5af5e47
desktop-file-install --vendor=fedora \
5af5e47
                     --dir=$RPM_BUILD_ROOT%{_datadir}/applications \
5af5e47
                     --add-category=Education \
5af5e47
                     --add-category=Science \
5af5e47
                     --add-category=Chemistry \
5af5e47
                     pld/chemtool.desktop
5af5e47
install -p gnome/gnome-application-chemtool.png           $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/chemtool.png
5af5e47
install -p chemtool.xpm                                   $RPM_BUILD_ROOT%{_datadir}/pixmaps
5af5e47
5af5e47
%{__rm} $RPM_BUILD_ROOT%{_datadir}/applnk/Graphics/chemtool.desktop
5af5e47
%{__rm} $RPM_BUILD_ROOT%{_datadir}/pixmaps/mc/gnome-application-chemtool.png
5af5e47
5af5e47
%find_lang %{name}
5af5e47
5af5e47
%post
5af5e47
touch --no-create %{_datadir}/icons/hicolor || :
5af5e47
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
5af5e47
%{_bindir}/update-desktop-database &> /dev/null ||:
5af5e47
5af5e47
%postun
5af5e47
touch --no-create %{_datadir}/icons/hicolor || :
5af5e47
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
5af5e47
%{_bindir}/update-desktop-database &> /dev/null ||:
5af5e47
5af5e47
%clean
5af5e47
rm -rf %{buildroot}
5af5e47
5af5e47
%files -f %{name}.lang
5af5e47
%defattr(644,root,root,755)
5af5e47
%doc ChangeLog README TODO examples
5af5e47
%attr(755,root,root) %{_bindir}/*
5af5e47
%{_datadir}/mimelnk/application/*
5af5e47
%{_datadir}/mime-types/chemtool.*
5af5e47
%{_datadir}/pixmaps/*.xpm
5af5e47
%{_datadir}/icons/hicolor/*/*/*.png
5af5e47
%{_datadir}/applications/*.desktop
5af5e47
%{_mandir}/man1/*
5af5e47
5af5e47
%changelog
af26aa3
* Wed Apr 25 2007 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.10-1
af26aa3
- updated to 1.6.10
af26aa3
b572d8f
* Thu Dec 22 2006 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.9-7
b572d8f
- fix stupid directory creation bug
b572d8f
384efe2
* Thu Dec 21 2006 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.9-6
384efe2
- fix MIME type in desktop file (#220125)
384efe2
5af5e47
* Mon Nov 20 2006 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.9-5
5af5e47
- keep the whole examples dir in docs
5af5e47
- add update-desktop-database call to post{,un} scripts
5af5e47
5af5e47
* Mon Nov 20 2006 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.9-4
5af5e47
- fix build without mock
5af5e47
5af5e47
* Sun Nov 19 2006 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.9-3
5af5e47
- added missing BRs
5af5e47
- add scriptlets to update icon cache
5af5e47
5af5e47
* Sun Nov 19 2006 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.9-2
5af5e47
- don't use non-standard macros
5af5e47
5af5e47
* Fri Nov 17 2006 Dominik 'Rathann' Mierzejewski <rpm@greysector.net> 1.6.9-1
5af5e47
- initial build, based on bioxray.dk and PLD specfiles