From 5183f92ac92ca1b17eb1b88cafb7f314fe056ff35fc41a6a2e96087072832f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Mon, 16 Jun 2025 13:48:18 +0000 Subject: [PATCH] - Convert to libalternatives OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dkimpy?expand=0&rev=19 --- .gitattributes | 23 +++++++ .gitignore | 1 + dkimpy-1.1.6.tar.gz | 3 + dkimpy-1.1.8.tar.gz | 3 + no-optional.patch | 35 +++++++++++ python-dkimpy.changes | 141 ++++++++++++++++++++++++++++++++++++++++++ python-dkimpy.spec | 92 +++++++++++++++++++++++++++ 7 files changed, 298 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 dkimpy-1.1.6.tar.gz create mode 100644 dkimpy-1.1.8.tar.gz create mode 100644 no-optional.patch create mode 100644 python-dkimpy.changes create mode 100644 python-dkimpy.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/dkimpy-1.1.6.tar.gz b/dkimpy-1.1.6.tar.gz new file mode 100644 index 0000000..a5c60ff --- /dev/null +++ b/dkimpy-1.1.6.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ce72d961f443e8f9f05694b354542dee534e08e2b8c5b60c62d5daca7c1da0f +size 66557 diff --git a/dkimpy-1.1.8.tar.gz b/dkimpy-1.1.8.tar.gz new file mode 100644 index 0000000..fc570bd --- /dev/null +++ b/dkimpy-1.1.8.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5f60fb47bbf5d8d762f134bcea0c388eba6b498342a682a21f1686545094b77 +size 66979 diff --git a/no-optional.patch b/no-optional.patch new file mode 100644 index 0000000..22dc7c7 --- /dev/null +++ b/no-optional.patch @@ -0,0 +1,35 @@ +Index: dkimpy-1.1.5/dkim/__init__.py +=================================================================== +--- dkimpy-1.1.5.orig/dkim/__init__.py ++++ dkimpy-1.1.5/dkim/__init__.py +@@ -43,18 +43,9 @@ import binascii + # Set to False to not use async functions even though aiodns is installed. + USE_ASYNC = True + +-# only needed for arc +-try: +- import authres +-except ImportError: +- pass +- +-# only needed for ed25519 signing/verification +-try: +- import nacl.signing +- import nacl.encoding +-except ImportError: +- pass ++import authres ++import nacl.signing ++import nacl.encoding + + from dkim.canonicalization import ( + CanonicalizationPolicy, +@@ -1181,7 +1172,7 @@ class ARC(DomainSigner): + if chain_validation_status == CV_Fail: + self.headers.reverse() + if b'h' in as_fields: +- raise ValidationError("h= tag not permitted in ARC-Seal header field") ++ raise ValidationError("h= tag not permitted in ARC-Seal header field") + res = self.gen_header(as_fields, as_include_headers, canon_policy, + b"ARC-Seal", pk, standardize) + diff --git a/python-dkimpy.changes b/python-dkimpy.changes new file mode 100644 index 0000000..11f2b91 --- /dev/null +++ b/python-dkimpy.changes @@ -0,0 +1,141 @@ +------------------------------------------------------------------- +Mon Jun 16 13:47:02 UTC 2025 - Markéta Machová + +- Convert to libalternatives + +------------------------------------------------------------------- +Sat Aug 31 15:09:54 UTC 2024 - Dirk Müller + +- update to 1.1.8: + * Correctly handle verification of signatures without t= + (timestamp) and with x= (expiration); both are optional + * Fix error in validate_signature_fields which prevented + signature expiration from being properly evaluated + * Correct ARC signing for AR headers with authres-version + or comments before resinfo + * Correct line separtor after AAR header field + * Correct signature in ARC-Seal on LF as linesep + +------------------------------------------------------------------- +Sat Apr 20 13:41:46 UTC 2024 - Dirk Müller + +- update to 1.1.6: + * Use raw byte string for regex; fixes SyntaxWarning in + Python 3.12 due to invalid escape sequence + +------------------------------------------------------------------- +Thu Feb 29 03:25:54 UTC 2024 - Steve Kowalik + +- Switch to autosetup and pyproject macros. +- No more greedy globs in %files. + +------------------------------------------------------------------- +Sat Jan 6 18:02:16 UTC 2024 - Dirk Müller + +- update to 1.1.5: + * Use dns.resolver.resolve instead of dns.resolver.query + due to deprecation + * Treat dns.resolver.NoNameservers like NXDOMAIN (not an + error) + * Confine errors from dnspython to dnsplug and use dkim + errors, since dkim.__init__.py doesn't import dns and + needs dkim errors + * Catch nacl.exceptions.ValueError and raise + KeyFormatError, similar to how RSA key errors are treated + * Create ed25519 key files with secure permissions to + avoid risk of insecure chmode call/race condition + * Properly cleanup temporary directories in tests + * Verify correct AMS header is used for ARC seal + verification (André Cruz) + * Document dropping of Python 2 support + * Fix traceback when attempting to verify an unsigned + message using async verify + * Add domain validity check for ascii domains (no + specials) + * Add option to specify index number of signature to + verify to dkimverify + * Correct signature indexing error introduced in 1.0.0 + that prevents verification of multiple signatures in a + single message + * Correct dkim.verify processing to avoid errors when + verifying messages with no DKIM signatures + * Update dnsplug for DNS Python (dns) 2.0 compatibility + * Provide more specific error message when ed25519 + private key is invalid + * Add support for PKCS#8 for private keys, openssl 3 + default + * Add limitations section to README to document current + IDN status + * Add USE_ASYNC flag to allow async to be disabled when + aiodns is installed (LP: #1954331) + * Add new dkim.DnsTimeoutError class to report queried + domain and selector along with timeout error from dnspython + * Invalid Authentication-Results header fields are + ignored for ARC signing + +------------------------------------------------------------------- +Sun Jun 18 15:52:47 UTC 2023 - Andreas Schneider + +- Use sle15_python_module_pythons + +------------------------------------------------------------------- +Tue Dec 8 07:18:07 UTC 2020 - Jiri Slaby + +- update to 1.0.5 + - Update dnsplug for DNS Python (dns) 2.0 compatibility (LP: #1888583) + - Fix @param srv_id typos (LP: #1890532) + - Correct dkim.verify processing to avoid errors when verifying messages + with no DKIM signatures + +------------------------------------------------------------------- +Tue May 26 07:22:41 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + +------------------------------------------------------------------- +Fri Apr 3 07:55:20 UTC 2020 - Marketa Calabkova + +- update to 1.0.3 + * dknewkey: On posix operating systems set file permissions to 600 for + ed25519 private key files (as is already done for RSA) (LP: #1857827) + * Set minimum dnspython version to 1.16 because previous versions can not + support the timeout parameter (LP: #1856546) + * Follow CNAMES when looking up key records when using DNS (pydns) + * Add support for RFC 8460 tlsrpt DKIM signature processing (LP: #1847020) + * Add async support with aiodns for DKIM verification (ARC not supported) + * Add new timeout parameter to enable DNS lookup timeouts to be adjusted + * Add new DKIM.present function to allow applications to test if a DKIM + signature is present without doing validation (LP: #1851141) + * Support signature verification with RSAPublicKey formatted keys + since, although rare, they are RFC 6376 specified (LP: #1851862) + * Drop usage of pymilter Milter.dns in dnsplug since it doesn't support + having a timeout passed to it + * Catch binascii related key format errors (LP: #1854477) + * Ignore unknown service types in key records (LP: #1847020) + * Add LICENSE to MANIFEST.in so it is included in the tarball +- Drop shipped LICENSE file +- Reapplied patch no-optional.patch + +------------------------------------------------------------------- +Mon Dec 2 10:47:11 UTC 2019 - pgajdos@suse.com + +- call spec-cleaner + +------------------------------------------------------------------- +Wed Sep 25 14:24:39 UTC 2019 - Tomáš Chvátal + +- Drop the pynacl workaround as fix was submitted to the TW + integration + +------------------------------------------------------------------- +Wed Sep 25 11:55:29 UTC 2019 - Tomáš Chvátal + +- Add patch to not optionaly import stuff, as it hides import + errors and we want those to be hard enabled anyway: + * no-optional.patch + +------------------------------------------------------------------- +Wed Sep 25 09:07:37 UTC 2019 - pgajdos@suse.com + +- initial version 0.9.3, required by pyton-authheaders [SLE-7686] + diff --git a/python-dkimpy.spec b/python-dkimpy.spec new file mode 100644 index 0000000..0bb8c51 --- /dev/null +++ b/python-dkimpy.spec @@ -0,0 +1,92 @@ +# +# spec file for package python-dkimpy +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define commands arcsign arcverify dkimsign dkimverify dknewkey +%bcond_without libalternatives +%{?sle15_python_module_pythons} +Name: python-dkimpy +Version: 1.1.8 +Release: 0 +Summary: DKIM (DomainKeys Identified Mail) +License: BSD-2-Clause +URL: https://launchpad.net/dkimpy +Source: https://files.pythonhosted.org/packages/source/d/dkimpy/dkimpy-%{version}.tar.gz +Patch0: no-optional.patch +BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: alts +BuildRequires: fdupes +BuildRequires: openssl +BuildRequires: python-rpm-macros +Requires: alts +Requires: python-PyNaCl +Requires: python-authres +Requires: python-dnspython >= 1.16 +Requires: python-setuptools +BuildArch: noarch +# SECTION test requirements +BuildRequires: %{python_module PyNaCl} +BuildRequires: %{python_module authres} +BuildRequires: %{python_module dnspython >= 1.16} +BuildRequires: %{python_module pytest} +# /SECTION +%python_subpackages + +%description +DKIM (DomainKeys Identified Mail) + +%prep +%autosetup -p1 -n dkimpy-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +for c in %{commands}; do + %python_clone -a %{buildroot}%{_mandir}/man1/$c.1 + %python_clone -a %{buildroot}%{_bindir}/$c +done +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest + +%pre +for c in %{commands}; do + %python_libalternatives_reset_alternative $c +done + +%files %{python_files} +%doc ChangeLog README.md +%license LICENSE +%python_alternative %{_bindir}/arcsign +%python_alternative %{_bindir}/arcverify +%python_alternative %{_bindir}/dkimsign +%python_alternative %{_bindir}/dkimverify +%python_alternative %{_bindir}/dknewkey +%python_alternative %{_mandir}/man1/arcsign.1%{?ext_man} +%python_alternative %{_mandir}/man1/arcverify.1%{?ext_man} +%python_alternative %{_mandir}/man1/dkimsign.1%{?ext_man} +%python_alternative %{_mandir}/man1/dkimverify.1%{?ext_man} +%python_alternative %{_mandir}/man1/dknewkey.1%{?ext_man} +%{python_sitelib}/dkim +%{python_sitelib}/dkimpy-%{version}.dist-info + +%changelog