From dec3e81542d153271d1f2ed62d029d70f070cf11 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Fri, 20 Nov 2015 16:16:19 +0100 Subject: [PATCH 1/2] do not use py3dir --- python-cups.spec | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/python-cups.spec b/python-cups.spec index a06a4e3..fdd2017 100644 --- a/python-cups.spec +++ b/python-cups.spec @@ -6,11 +6,10 @@ Summary: Python bindings for CUPS Name: python-cups Version: 1.9.72 -Release: 3%{?dist} +Release: 4%{?dist} URL: http://cyberelk.net/tim/software/pycups/ Source: http://cyberelk.net/tim/data/pycups/pycups-%{version}.tar.bz2 License: GPLv2+ -Group: Development/Languages BuildRequires: cups-devel BuildRequires: python2-devel python3-devel BuildRequires: epydoc @@ -22,7 +21,6 @@ system-config-printer, but can be put to other uses as well. %package -n python3-cups Summary: Python3 bindings for CUPS API, known as pycups. -Group: Development/Languages %description -n python3-cups This package provides Python bindings for CUPS API, @@ -33,34 +31,24 @@ This is a ported release for python 3 %package doc Summary: Documentation for python-cups -Group: Documentation %description doc Documentation for python-cups. %prep -%setup -q -n pycups-%{version} - -rm -rf %{py3dir} -cp -a . %{py3dir} +%setup -n pycups-%{version} %build -make CFLAGS="%{optflags} -fno-strict-aliasing" make doc - -pushd %{py3dir} +%py2_build %py3_build -popd %install -make install DESTDIR="%{buildroot}" - -pushd %{py3dir} +make install-rpmhook DESTDIR="%{buildroot}" +%py2_install %py3_install chmod 755 %{buildroot}%{python3_sitearch}/cups*.so -popd - %files @@ -69,7 +57,7 @@ popd %{python_sitearch}/pycups*.egg-info %files -n python3-cups -%doc COPYING README NEWS +%doc COPYING README NEWS TODO %{python3_sitearch}/cups.cpython-3*.so %{python3_sitearch}/pycups*.egg-info %{_rpmconfigdir}/fileattrs/psdriver.attr @@ -79,6 +67,9 @@ popd %doc examples html %changelog +* Fri Nov 20 2015 Jiri Popelka - 1.9.72-4 +- do not use py3dir + * Tue Aug 11 2015 Jiri Popelka - 1.9.72-3 - %%py3_build && %%py3_install From 8f4b37f47fcf3179607465bef08d4c7cd680c63f Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Fri, 20 Nov 2015 16:19:21 +0100 Subject: [PATCH 2/2] use python_provide macro --- python-cups.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python-cups.spec b/python-cups.spec index fdd2017..9c9e873 100644 --- a/python-cups.spec +++ b/python-cups.spec @@ -14,6 +14,11 @@ BuildRequires: cups-devel BuildRequires: python2-devel python3-devel BuildRequires: epydoc +# defined in /usr/lib/rpm/macros.d/macros.python +# if python_provide() is defined, call python_provide(python-cups) +# which may eventually add Provides: ... (see the function definition) +%{?python_provide:%python_provide python-cups} + %description This package provides Python bindings for CUPS API, known as pycups. It was written for use with @@ -21,6 +26,7 @@ system-config-printer, but can be put to other uses as well. %package -n python3-cups Summary: Python3 bindings for CUPS API, known as pycups. +%{?python_provide:%python_provide python3-cups} %description -n python3-cups This package provides Python bindings for CUPS API, @@ -69,6 +75,7 @@ chmod 755 %{buildroot}%{python3_sitearch}/cups*.so %changelog * Fri Nov 20 2015 Jiri Popelka - 1.9.72-4 - do not use py3dir +- use python_provide macro * Tue Aug 11 2015 Jiri Popelka - 1.9.72-3 - %%py3_build && %%py3_install