File python-mmkeys.spec of Package python-mmkeys

#
# spec file for package python-mmkeys
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%endif
Name:           python-mmkeys
Version:        1.6.2.1
Release:        0
Summary:        Multimedia key support as a PyGTK object
License:        GPL-2.0
Group:          Development/Languages/Python
Url:            http://packages.ubuntu.com/wily/python-mmkeys
Source0:        http://archive.ubuntu.com/ubuntu/pool/universe/s/sonata/sonata_%{version}.orig.tar.gz
Source1:        setup.py.in
Patch:          from_upstream__fix-mmkeys.patch	
BuildRequires:  gcc-c++
BuildRequires:  gtk2-devel
BuildRequires:  pkg-config
BuildRequires:  python-devel
BuildRequires:  python-gtk-devel
BuildRequires:  python-setuptools
Requires:       python-gtk
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Multimedia key support as a PyGTK object.

%prep
%setup -T -c mmkeys-%{version}
tar -xf %{SOURCE0}
cd sonata-%{version}
%patch -p1
cp -r mmkeys/* ../
cd ..
rm -rf sonata-%{version}
cp -r %{SOURCE1} setup.py

%build
sed -i "s/@PY_VER@/%{py_ver}/" setup.py
sed -i "s/@LIB@/%{_lib}/" setup.py
python setup.py build

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}

%files
%defattr(-,root,root,-)
%doc COPYING README
%{python_sitearch}/mmkeys.so
%{python_sitearch}/mmkeys-%{version}-py%{py_ver}.egg-info

%changelog
openSUSE Build Service is sponsored by