From 2878be6abb661403322e021a273a5551148aaf271956dc0bae4497081609d4f5 Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Wed, 25 Apr 2018 10:36:53 +0000 Subject: [PATCH] - convert to singlespec - use pypi as source - update url OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bugzilla?expand=0&rev=39 --- python-bugzilla.changes | 7 +++++++ python-bugzilla.spec | 40 +++++++++++++++++++++++++--------------- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/python-bugzilla.changes b/python-bugzilla.changes index 479a501..dea7fb5 100644 --- a/python-bugzilla.changes +++ b/python-bugzilla.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Apr 25 10:36:02 UTC 2018 - tbechtold@suse.com + +- convert to singlespec +- use pypi as source +- update url + ------------------------------------------------------------------- Wed Apr 25 10:21:27 UTC 2018 - tbechtold@suse.com diff --git a/python-bugzilla.spec b/python-bugzilla.spec index dfdcdef..1d52a9b 100644 --- a/python-bugzilla.spec +++ b/python-bugzilla.spec @@ -16,25 +16,26 @@ # +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-bugzilla Version: 2.1.0 Release: 0 Summary: Python library for bugzilla License: GPL-2.0-or-later Group: Development/Libraries/Python -Url: https://fedorahosted.org/python-bugzilla/ -Source: %{name}-%{version}.tar.gz -# https://gitorious.org/opensuse/python-bugzilla +Url: https://github.com/python-bugzilla/python-bugzilla +Source: https://files.pythonhosted.org/packages/source/p/python-bugzilla/python-bugzilla-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: python-devel -BuildRequires: python-setuptools -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 -%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%else -BuildArch: noarch -%endif +BuildRequires: %{python_module devel} +BuildRequires: %{python_module setuptools} +BuildRequires: python-rpm-macros Requires: python-requests Suggests: osc +Requires(post): update-alternatives +Requires(postun): update-alternatives +BuildArch: noarch + +%python_subpackages %description This is a python module that provides a nice, python-ish interface to Bugzilla @@ -51,16 +52,25 @@ but gosh - why not just write something in Python instead? %setup -q %build -CFLAGS="%{optflags}" python setup.py build +export CFLAGS="%{optflags}" +%python_build %install -python setup.py install --root=%{buildroot} --prefix=%{_prefix} +%python_install +%python_clone -a %{buildroot}%{_bindir}/bugzilla +%python_clone -a %{buildroot}%{_mandir}/man1/bugzilla.1 -%files +%post +%{python_install_alternative bugzilla bugzilla.1} + +%postun +%python_uninstall_alternative bugzilla + +%files %{python_files} %defattr(-,root,root,-) -%{_bindir}/bugzilla +%python_alternative %{_bindir}/bugzilla +%python_alternative %{_mandir}/man1/bugzilla.1%{ext_man} %{python_sitelib}/bugzilla %{python_sitelib}/python_bugzilla-%{version}-py%{py_ver}.egg-info -%{_mandir}/man1/bugzilla.1.gz %changelog