File xdrawchem.spec of Package xdrawchem

#
# spec file for package xdrawchem 
#
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.



Name:           xdrawchem
Summary:        A 2D molecule drawing program
Version:        1.9.9
Release:        1
License:        GPL-2.0-or-later
Group:          Productivity/Scientific/Chemistry
Url:            http://xdrawchem.sourceforge.net/
Vendor:         openSUSE-Education
Source:         %name-%version.tar.bz2
Source1:        %{name}.desktop
Source2:        %{name}.png
Patch1:         xdrawchem-gcc43.patch
Patch2:         xdrawchem-ob22.patch
Patch3:         new-openbabel-string-type-fix.patch
BuildRequires:  libopenbabel-devel qt3-devel qt3-extensions
# xorg-x11-devel pkgconfig gcc-c++ libjpeg-devel 
%if 0%{?suse_version}
BuildRequires:  update-desktop-files
%endif
BuildRequires:  fdupes
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
XDrawChem is a two-dimensional molecule drawing program for Unix
operating systems.  It is similar in functionality to other molecule
drawing programs such as ChemDraw (TM, CambridgeSoft).  It can read
and write MDL Molfiles and CML files to allow sharing between
XDrawChem and other chemistry applications.

%prep
%setup -q
%patch -P 1 -p1
%patch -P 2 -p1
%patch -P 3 -p1
sed -i 1i\ '#include <unistd.h>' xdrawchem/application.cpp
sed -i 's|return(false)|return(0)|g' xdrawchem/molecule_obmol.cpp

%build
export GC_MACIMUM_HEAP_SIZE="134217728"
%configure --with-qtlibdir=/usr/lib/qt3/%{_lib}
#--disable-static \
#           --with-qtlibdir=/usr/lib/qt3/%{_lib}
sed -i 's|-Wall|-std=c++14|g' **/Makefile
%{__make} %{?jobs:-j%{jobs}}

%install
%makeinstall
# install -Dm644 %{SOURCE1} %{buildroot}%{_datadir}/applications/%{name}.desktop
install -Dm644 %{SOURCE2} %{buildroot}%{_datadir}/pixmaps/%{name}.png
rm -f $RPM_BUILD_ROOT%{_datadir}/xdrawchem/caslist.txt
# FIX ME, IT BREACKS BUILT
%suse_update_desktop_file -n -i -r %{name} Education Chemistry
%fdupes -s %{buildroot}

%files
%defattr(-,root,root)
%doc HISTORY.txt GPL.txt README.txt TODO.txt
%{_bindir}/xdrawchem
%dir %{_datadir}/xdrawchem
%{_datadir}/xdrawchem
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png

%changelog
* Mon Mar 17 2008 lars@linux-schulserver.de
- beautify specfile
- added %%clean section
- own the directories, too
- added xdrawchem-gcc43.patch to fix gcc43 build
* Tue Nov 20 2007 lars@linux-schulserver.de
- build for openSUSE-Education
* Wed Apr 12 2006 Leon Freitag <leon@links2linux.de>
- adapted to the current openbabel spec
* Tue Apr 11 2006 Leon Freitag <leon@links2linux.de>
- rewrote the spec file from scratch, it's portable across
  ix86/x86_64 now
- added the full source path
- changed the group to Productivity/Scientific/Chemistry according
  to Suse packaging conventions.
openSUSE Build Service is sponsored by