diff --git a/0001-examples-cupstree.py-remove-shebang.patch b/0001-examples-cupstree.py-remove-shebang.patch new file mode 100644 index 0000000..9d5f63c --- /dev/null +++ b/0001-examples-cupstree.py-remove-shebang.patch @@ -0,0 +1,22 @@ +From 09145aa3ad0ce6e0558aceccabcafdf6c1b282d8 Mon Sep 17 00:00:00 2001 +From: zdohnal +Date: Fri, 28 Aug 2020 07:48:20 +0200 +Subject: [PATCH] examples/cupstree.py: remove shebang + +It is unneeded within examples. +--- + examples/cupstree.py | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/examples/cupstree.py b/examples/cupstree.py +index e954615..af19b07 100755 +--- a/examples/cupstree.py ++++ b/examples/cupstree.py +@@ -1,4 +1,3 @@ +-#!/usr/bin/python + import cups + + def do_indent (indent): +-- +2.26.2 + diff --git a/0001-postscriptdriver.prov-ignore-driverless-utilities.patch b/0001-postscriptdriver.prov-ignore-driverless-utilities.patch new file mode 100644 index 0000000..a4066d0 --- /dev/null +++ b/0001-postscriptdriver.prov-ignore-driverless-utilities.patch @@ -0,0 +1,28 @@ +From 845c65358e3ba6e5972df1dd37756be97130cc90 Mon Sep 17 00:00:00 2001 +From: zdohnal +Date: Fri, 28 Aug 2020 08:23:24 +0200 +Subject: [PATCH] postscriptdriver.prov: ignore driverless utilities + +Driverless utilities are generic tools for driverless support, which generate 'drivers' based on communication with a device, so it is not usable to try to generate rpm tags for specific models. +Creating generic ```postscriptdriver(driverless)``` doesn't make sense too, because utilities are shipped within core printing packages (CUPS/cups-filters), so just ignore postscriptdriver tag creation for them. +--- + postscriptdriver.prov | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/postscriptdriver.prov b/postscriptdriver.prov +index 7447def..c9e3cee 100755 +--- a/postscriptdriver.prov ++++ b/postscriptdriver.prov +@@ -243,7 +243,8 @@ class TagBuilder: + self.ids = DeviceIDs () + + for path in paths: +- if path.find ("/usr/lib/cups/driver/") != -1: ++ if path.find ("/usr/lib/cups/driver/") != -1 and \ ++ path.find("driverless") == -1: + try: + self.ids += DynamicDriver (path).list () + except TimedOut: +-- +2.26.2 + diff --git a/python-cups.spec b/python-cups.spec index 1e3bdca..cbc8f40 100644 --- a/python-cups.spec +++ b/python-cups.spec @@ -6,15 +6,21 @@ Summary: Python bindings for CUPS Name: python-cups Version: 2.0.1 -Release: 4%{?dist} +Release: 5%{?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 + # gcc is no longer in buildroot by default BuildRequires: gcc +# for autosetup +BuildRequires: git BuildRequires: cups-devel BuildRequires: python3-devel @@ -40,9 +46,7 @@ Summary: Documentation for python-cups Documentation for python-cups. %prep -%setup -n pycups-%{version} - -sed -i '/^#!\/usr\/bin\/python/d' examples/cupstree.py +%autosetup -S git -n pycups-%{version} %build %py3_build @@ -67,6 +71,9 @@ export PYTHONPATH=%{buildroot}%{python3_sitearch} %doc examples html %changelog +* Fri Aug 28 2020 Zdenek Dohnal - 2.0.1-5 +- 1873385 - ignore driverless utilities during tags creation + * Wed Jul 29 2020 Zdenek Dohnal - 2.0.1-4 - use %%python3_sitearch in filter_provides_in, otherwise the package fails to build