@ -1,23 +1,31 @@
%{?filter_setup:
%filter_provides_in %{python_sitearch}/.*\.so$
%filter_provides_in %{python3 _sitearch}/.*\.so$
%filter_setup
}
Summary: Python bindings for CUPS
Name: python-cups
Version: 1.9.72
Release: 21%{?dist}
URL: http://cyberelk.net/tim/software/pycups/
Source: http://cyberelk.net/tim/data/pycups/pycups-%{version}.tar.bz2
Version: 2.0.1
Release: 10%{?dist}
# older URL, but still with useful information about pycups
#URL: http://cyberelk.net/tim/software/pycups/
URL: https://github.com/OpenPrinting/pycups/
Source: https://github.com/OpenPrinting/pycups/releases/download/v%{version}/pycups-%{version}.tar.gz
License: GPLv2+
# all taken from upstream
Patch01: 0001-examples-cupstree.py-remove-shebang.patch
Patch02: 0001-postscriptdriver.prov-ignore-driverless-utilities.patch
Patch03: pycups-invalid-pointer.patch
# gcc is no longer in buildroot by default
BuildRequires: gcc
# for autosetup
BuildRequires: git-core
# uses make
BuildRequires: make
BuildRequires: cups-devel
%if 0%{?rhel} <= 7
BuildRequires: python2-devel
%endif
BuildRequires: python3-devel
%description
@ -25,20 +33,6 @@ This package provides Python bindings for CUPS API,
known as pycups. It was written for use with
system-config-printer, but can be put to other uses as well.
%if 0%{?rhel} <= 7
%package -n python2-cups
Summary: Python2 bindings for CUPS API, known as pycups.
# defined in /usr/lib/rpm/macros.d/macros.python
# if python_provide() is defined, call python_provide(python2-cups)
# which may eventually add Provides: ... (see the function definition)
%{?python_provide:%python_provide python2-cups}
%description -n python2-cups
This package provides Python 2 bindings for CUPS API,
known as pycups. It was written for use with
system-config-printer, but can be put to other uses as well.
%endif
%package -n python3-cups
Summary: Python3 bindings for CUPS API, known as pycups.
%{?python_provide:%python_provide python3-cups}
@ -55,37 +49,19 @@ Summary: Documentation for python-cups
Documentation for python-cups.
%prep
%setup -n pycups-%{version}
sed -i '/^#!\/usr\/bin\/python/d' examples/cupstree.py
sed -i '1s=^#!/usr/bin/python3=#!%{__python3}=' \
postscriptdriver.prov
%autosetup -S git -n pycups-%{version}
%build
%if 0%{?rhel} <= 7
%py2_build
%endif
%py3_build
%install
make install-rpmhook DESTDIR="%{buildroot}"
%if 0%{?rhel} <= 7
%py2_install
%endif
%py3_install
export PYTHONPATH=%{buildroot}%{python3_sitearch}
%{_bindir}/pydoc3 -w cups
%{__python3} -m pydoc -w cups
%{_bindir}/mkdir html
%{_bindir}/mv cups.html html
%if 0%{?rhel} <= 7
%files -n python2-cups
%doc README NEWS TODO
%license COPYING
%{python2_sitearch}/cups.so
%{python2_sitearch}/pycups*.egg-info
%endif
%files -n python3-cups
%doc README NEWS TODO
%license COPYING
@ -98,11 +74,64 @@ export PYTHONPATH=%{buildroot}%{python3_sitearch}
%doc examples html
%changelog
* Wed Jul 26 2023 MSVSphere Packaging Team <packager@msvsphere.ru> - 1.9.72-21
- Rebuilt for MSVSphere 8.8
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 2.0.1-10
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.0.1-9
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Dec 14 2020 Zdenek Dohnal <zdohnal@redhat.com> - 2.0.1-7
- fix invalid delete (upstream ticket #11)
* Thu Nov 05 2020 Zdenek Dohnal <zdohnal@redhat.com> - 2.0.1-6
- make is no longer in buildroot by default
- use smaller git-core instead of git
* Fri Aug 28 2020 Zdenek Dohnal <zdohnal@redhat.com> - 2.0.1-5
- 1873385 - ignore driverless utilities during tags creation
* Wed Jul 29 2020 Zdenek Dohnal <zdohnal@redhat.com> - 2.0.1-4
- use %%python3_sitearch in filter_provides_in, otherwise the package fails to build
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.0.1-2
- Rebuilt for Python 3.9
* Fri Apr 24 2020 Zdenek Dohnal <zdohnal@redhat.com> - 2.0.1-1
- 2.0.1, fixes #1816107
* Mon Mar 16 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.9.74-7
- use __python macro for calling pydoc
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.74-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.9.74-5
- Rebuilt for Python 3.8
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.74-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.74-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Oct 03 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.9.74-2
- 1578356 - Remove python2 subpackage
* Wed Sep 26 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.9.74-1
- 1.9.74
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.72-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Thu Jun 07 2018 Tomas Orsava <torsava@redhat.com> - 1.9.72-21
- Switch hardcoded python3 shebangs into the %%{__python3} macro
* Tue Jun 19 2018 Miro Hrončok <mhroncok @redhat.com> - 1.9.72-21
- Rebuilt for Python 3.7
* Fri Apr 20 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.9.72-20
- adding docs back