File bkchem.spec of Package BKchem

#
# spec file for package bkchem
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define		oasa_version 0.13.1
Name:		bkchem
Summary:	A 2D molecule drawing program
Version:	0.13.0
Release:	0
License:	GPL-2.0
Group:		Productivity/Scientific/Chemistry
Source0:	http://bkchem.zirael.org/download/%{name}-%{version}.tar.bz2
Source1:	http://bkchem.zirael.org/download/oasa-%{oasa_version}.tar.bz2
BuildRoot:	%{_tmppath}/build-root-%{name}
Url:		http://bkchem.zirael.org/
Requires:	python-base python tcl tk python-tk
BuildRequires:	update-desktop-files python-devel fdupes
%if 0%{?suse_version} > 1110
BuildArch:      noarch
%endif

%description
BKchem is a free/libre chemical drawing program written in Python.

%prep
%setup -q -b 0 
tar xf %{SOURCE1}
cp -aR oasa-%{oasa_version}/* bkchem/oasa/

%build
# nothing to do

%install
python setup.py install --prefix=/usr \
                        --root=%{buildroot} \
                        --strip=%{buildroot}

install -D -m 644 images/bkchem.png %{buildroot}%{_datadir}/pixmaps/%{name}.png

%suse_update_desktop_file -n -c %name "BKchem" BKchem bkchem bkchem Education Science Chemistry

rm -rf  %{buildroot}%{_datadir}/doc/bkchem/INSTALL

%if 0%{?suse_version} >= 1120
chmod +x %{buildroot}%{python_sitelib}/bkchem/oasa/setup.py
%else
chmod +x %{buildroot}%{py_sitedir}/bkchem/oasa/setup.py
%endif

%fdupes %{buildroot}%{_prefix}

%find_lang BKchem

%files -f BKchem.lang
%defattr(-,root,root)
%{_bindir}/bkchem
%if 0%{?suse_version} >= 1120
%{python_sitelib}/bkchem*
%else
%{py_sitedir}/bkchem* 
%endif
%dir %{_datadir}/bkchem
%dir %{_datadir}/doc/bkchem
%{_datadir}/bkchem/*
%if %suse_version <= 1120
%dir %{_datadir}/locale/tw/LC_MESSAGES/
%dir %{_datadir}/locale/tw
%endif
%{_datadir}/doc/bkchem/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png

%changelog
openSUSE Build Service is sponsored by