Compare commits

...

No commits in common. "c8s" and "imports/c10s/python-cups-2.0.1-22.el10" have entirely different histories.

12 changed files with 278 additions and 51 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

19
.gitignore vendored
View File

@ -1,2 +1,19 @@
SOURCES/pycups-1.9.72.tar.bz2 /pycups-1.9.52.tar.bz2
/pycups-1.9.53.tar.bz2
/pycups-1.9.54.tar.bz2
/pycups-1.9.55.tar.bz2
/pycups-1.9.57.tar.bz2
/pycups-1.9.59.tar.bz2
/pycups-1.9.60.tar.bz2
/pycups-1.9.61.tar.bz2
/pycups-1.9.62.tar.bz2
/pycups-1.9.63.tar.bz2
/pycups-1.9.65.tar.bz2
/pycups-1.9.66.tar.bz2
/pycups-1.9.67.tar.bz2
/pycups-1.9.68.tar.bz2
/pycups-1.9.69.tar.bz2
/pycups-1.9.70.tar.bz2
/pycups-1.9.72.tar.bz2 /pycups-1.9.72.tar.bz2
/pycups-1.9.74.tar.bz2
/pycups-2.0.1.tar.gz

View File

@ -0,0 +1,22 @@
From 09145aa3ad0ce6e0558aceccabcafdf6c1b282d8 Mon Sep 17 00:00:00 2001
From: zdohnal <zdohnal@redhat.com>
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

View File

@ -0,0 +1,28 @@
From 845c65358e3ba6e5972df1dd37756be97130cc90 Mon Sep 17 00:00:00 2001
From: zdohnal <zdohnal@redhat.com>
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

1
EMPTY
View File

@ -1 +0,0 @@

1
ci.fmf Normal file
View File

@ -0,0 +1 @@
resultsdb-testcase: separate

View File

@ -1,7 +1,25 @@
--- !Policy --- !Policy
product_versions: product_versions:
- rhel-8 - fedora-*
decision_context: bodhi_update_push_testing
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/tier1-public.functional}
#Rawhide
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/tier1-public.functional}
#gating rhel
--- !Policy
product_versions:
- rhel-*
decision_context: osci_compose_gate decision_context: osci_compose_gate
rules: rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} - !PassingTestCaseRule {test_case_name: osci.brew-build./plans/tier1-public.functional}
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tedude.validation} - !PassingTestCaseRule {test_case_name: osci.brew-build./plans/tier1-internal.functional}

36
plans.fmf Normal file
View File

@ -0,0 +1,36 @@
/tier1-internal:
plan:
import:
url: https://src.fedoraproject.org/tests/python-cups.git
name: /plans/tier1/internal
/tier1-public:
plan:
import:
url: https://src.fedoraproject.org/tests/python-cups.git
name: /plans/tier1/public
/tier2-tier3-internal:
plan:
import:
url: https://src.fedoraproject.org/tests/python-cups.git
name: /plans/tier2-tier3/internal
/tier2-tier3-public:
plan:
import:
url: https://src.fedoraproject.org/tests/python-cups.git
name: /plans/tier2-tier3/public
/others-internal:
plan:
import:
url: https://src.fedoraproject.org/tests/python-cups.git
name: /plans/others/internal
/others-public:
plan:
import:
url: https://src.fedoraproject.org/tests/python-cups.git
name: /plans/others/public

View File

@ -0,0 +1,21 @@
diff --git a/cupsconnection.c b/cupsconnection.c
index 132dd25..d54a7fa 100644
--- a/cupsconnection.c
+++ b/cupsconnection.c
@@ -3827,7 +3827,7 @@ Connection_printTestPage (Connection *self, PyObject *args, PyObject *kwds)
const char *datadir;
char filename[PATH_MAX];
char uri[HTTP_MAX_URI];
- ipp_t *request, *answer;
+ ipp_t *request, *answer = NULL;
ipp_attribute_t *attr;
char *resource;
int jobid = 0;
@@ -3923,6 +3923,7 @@ Connection_printTestPage (Connection *self, PyObject *args, PyObject *kwds)
Connection_end_allow_threads (self);
if (answer && ippGetStatusCode (answer) == IPP_NOT_POSSIBLE) {
ippDelete (answer);
+ answer = NULL;
// Perhaps it's a class, not a printer.
construct_uri (uri, sizeof (uri),
"ipp://localhost/classes/", printer);

View File

@ -0,0 +1,13 @@
diff --git a/cupsipp.h b/cupsipp.h
index 2a15ce6..b890198 100644
--- a/cupsipp.h
+++ b/cupsipp.h
@@ -21,6 +21,8 @@
#ifndef HAVE_CUPSIPP_H
#define HAVE_CUPSIPP_H
+#define PY_SSIZE_T_CLEAN
+
#include <Python.h>
#include <cups/ipp.h>

View File

@ -1,44 +1,42 @@
%{?filter_setup: %{?filter_setup:
%filter_provides_in %{python_sitearch}/.*\.so$ %filter_provides_in %{python3_sitearch}/.*\.so$
%filter_setup %filter_setup
} }
Summary: Python bindings for CUPS Summary: Python bindings for CUPS
Name: python-cups Name: python-cups
Version: 1.9.72 Version: 2.0.1
Release: 21%{?dist} Release: 22%{?dist}
URL: http://cyberelk.net/tim/software/pycups/ # older URL, but still with useful information about pycups
Source: http://cyberelk.net/tim/data/pycups/pycups-%{version}.tar.bz2 #URL: http://cyberelk.net/tim/software/pycups/
License: GPLv2+ URL: https://github.com/OpenPrinting/pycups/
Source: https://github.com/OpenPrinting/pycups/releases/download/v%{version}/pycups-%{version}.tar.gz
License: GPL-2.0-or-later
# 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
Patch04: pycups-pyssizet_clean.patch
# gcc is no longer in buildroot by default # gcc is no longer in buildroot by default
BuildRequires: gcc BuildRequires: gcc
# for autosetup
BuildRequires: git-core
# uses make
BuildRequires: make
BuildRequires: cups-devel BuildRequires: cups-devel
%if 0%{?rhel} <= 7
BuildRequires: python2-devel
%endif
BuildRequires: python3-devel BuildRequires: python3-devel
# distutils are removed from python3 project, use the one
# from setuptools
BuildRequires: python3-setuptools
%description %description
This package provides Python bindings for CUPS API, This package provides Python bindings for CUPS API,
known as pycups. It was written for use with known as pycups. It was written for use with
system-config-printer, but can be put to other uses as well. 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 %package -n python3-cups
Summary: Python3 bindings for CUPS API, known as pycups. Summary: Python3 bindings for CUPS API, known as pycups.
%{?python_provide:%python_provide python3-cups} %{?python_provide:%python_provide python3-cups}
@ -55,37 +53,19 @@ Summary: Documentation for python-cups
Documentation for python-cups. Documentation for python-cups.
%prep %prep
%setup -n pycups-%{version} %autosetup -S git -n pycups-%{version}
sed -i '/^#!\/usr\/bin\/python/d' examples/cupstree.py
sed -i '1s=^#!/usr/bin/python3=#!%{__python3}=' \
postscriptdriver.prov
%build %build
%if 0%{?rhel} <= 7
%py2_build
%endif
%py3_build %py3_build
%install %install
make install-rpmhook DESTDIR="%{buildroot}" make install-rpmhook DESTDIR="%{buildroot}"
%if 0%{?rhel} <= 7
%py2_install
%endif
%py3_install %py3_install
export PYTHONPATH=%{buildroot}%{python3_sitearch} export PYTHONPATH=%{buildroot}%{python3_sitearch}
%{_bindir}/pydoc3 -w cups %{__python3} -m pydoc -w cups
%{_bindir}/mkdir html %{_bindir}/mkdir html
%{_bindir}/mv cups.html 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 %files -n python3-cups
%doc README NEWS TODO %doc README NEWS TODO
%license COPYING %license COPYING
@ -98,8 +78,99 @@ export PYTHONPATH=%{buildroot}%{python3_sitearch}
%doc examples html %doc examples html
%changelog %changelog
* Thu Jun 07 2018 Tomas Orsava <torsava@redhat.com> - 1.9.72-21 * Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 2.0.1-22
- Switch hardcoded python3 shebangs into the %%{__python3} macro - Bump release for June 2024 mass rebuild
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Nov 16 2023 Zdenek Dohnal <zdohnal@redhat.com> - 2.0.1-19
- SPDX migration
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 2.0.1-17
- Rebuilt for Python 3.12
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Wed Oct 19 2022 Zdenek Dohnal <zdohnal@redhat.com> - 2.0.1-15
- distutils will be removed in Python3.12, use setuptools instead
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 2.0.1-13
- Rebuilt for Python 3.11
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Mon Jun 28 2021 Zdenek Dohnal <zdohnal@redhat.com> - 2.0.1-10
- IPPRequest.writeIO() tracebacks because PY_SSIZE_T_CLEAN is not defined
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 2.0.1-9
- Rebuilt for Python 3.10
* 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
* 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 * Fri Apr 20 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.9.72-20
- adding docs back - adding docs back

View File

@ -1 +1 @@
SHA512 (pycups-1.9.72.tar.bz2) = db8b06378bf398073e34c89d62aa64cc8e56e93553346484c2e5dd67d046a3aa2f44020b68a7d479203fb2eeba005f8860ad4cebf72f8d7aa9aa15952a36d816 SHA512 (pycups-2.0.1.tar.gz) = fdebf1cac8cc4fffb8a76a938aa91965dae4a3dcdb6d8ee26e8e6054809d26dd3fb20b10c2351fb9265c03b16d6bde011815111c452ccb058518372f22d9d617