File webpin.spec of Package webpin
# vim: set sw=4 ts=4 et:
#
# spec file for package webpin
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2007-2012 Pascal Bleser <pascal.bleser@opensuse.org>
#
# 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/
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
%{!?py_ver: %global py_ver %(%__python -c "import sys; v=sys.version_info[:2]; print '%%d.%%d'%%v" 2>/dev/null || echo PYTHON-NOT-FOUND)}
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
Name: webpin
Version: 1.2.4
Release: 0
Summary: Command-Line Client for the openSUSE Package Search Web Service
License: GPL-2.0
Group: System/Packages
Source: https://github.com/pbleser/webpin/archive/v%{version}.tar.gz
Url: https://github.com/pbleser/webpin
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Provides: python-webpin = %{version}
Requires: python
Requires: python-xml
Requires: rpm-python
BuildRequires: python
BuildRequires: python-devel
PreReq: python >= %{py_ver}, python < %{py_ver}.999
%if 0%{?suse_version} > 1110
BuildArch: noarch
%endif
Patch0: webpin-1.2.4-openSUSE_13.1.patch
Patch1: webpin-1.2.4-openSUSE_13.2.patch
Patch2: webpin-1.2.4-openSUSE_Leap_42.1_42.2.patch
%description
Command-line client for the openSUSE Package Search web service
commonly known as "webpin": http://webpinstant.com/
The Package Search service is written and maintained by Benjamin Weber.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build
%__python ./setup.py build
%install
%__python ./setup.py install --prefix="%{_prefix}" --root="%{buildroot}" \
--record-rpm=files.lst
%__perl -n -i -e 'print $_ unless m{^(%{_mandir}|%{_sysconfdir})/}' files.lst
%clean
%{?buildroot:%__rm -rf "%{buildroot}"}
%files -f files.lst
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/webpinrc
%doc %{_mandir}/man5/webpinrc.5*
%doc %{_mandir}/man8/webpin.8*
%changelog