public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/s3cmd] rawhide: Adopt pyproject-rpm-macros and drop EL7 and python2
@ 2026-08-03  9:48 Frank Crawford
  0 siblings, 0 replies; only message in thread
From: Frank Crawford @ 2026-08-03  9:48 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/s3cmd
Branch : rawhide
Commit : a66a934506321d554708cc862560236b76c3f4f0
Author : Frank Crawford <frank@crawford.emu.id.au>
Date   : 2026-08-03T19:48:37+10:00
Stats  : +26/-148 in 3 file(s)
URL    : https://src.fedoraproject.org/rpms/s3cmd/c/a66a934506321d554708cc862560236b76c3f4f0?branch=rawhide

Log:
Adopt pyproject-rpm-macros and drop EL7 and python2

---
diff --git a/s3cmd-base64-py39-fix.patch b/s3cmd-base64-py39-fix.patch
deleted file mode 100644
index bc6c235..0000000
--- a/s3cmd-base64-py39-fix.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-diff --git a/S3/Crypto.py b/S3/Crypto.py
-index 315c98f..f866013 100644
---- a/S3/Crypto.py
-+++ b/S3/Crypto.py
-@@ -10,7 +10,11 @@ from __future__ import absolute_import
- 
- import sys
- import hmac
--import base64
-+try:
-+    from base64 import encodebytes as encodestring
-+except ImportError:
-+    # Python 2 support
-+    from base64 import encodestring
- 
- from . import Config
- from logging import debug
-@@ -63,7 +67,7 @@ def sign_string_v2(string_to_sign):
-     and returned signature will be utf-8 encoded "bytes".
-     """
-     secret_key = Config.Config().secret_key
--    signature = base64.encodestring(hmac.new(encode_to_s3(secret_key), string_to_sign, sha1).digest()).strip()
-+    signature = encodestring(hmac.new(encode_to_s3(secret_key), string_to_sign, sha1).digest()).strip()
-     return signature
- __all__.append("sign_string_v2")
- 
-diff --git a/S3/S3.py b/S3/S3.py
-index 24a5492..7fd7b7f 100644
---- a/S3/S3.py
-+++ b/S3/S3.py
-@@ -12,7 +12,6 @@ import sys
- import os
- import time
- import errno
--import base64
- import mimetypes
- import io
- import pprint
-@@ -25,6 +24,12 @@ try:
-     from urlparse import urlparse
- except ImportError:
-     from urllib.parse import urlparse
-+try:
-+    # Python 2 support
-+    from base64 import encodestring
-+except ImportError:
-+    # Python 3.9.0+ support
-+    from base64 import encodebytes as encodestring
- 
- import select
- 
-@@ -2054,7 +2059,7 @@ def parse_attrs_header(attrs_header):
- 
- def compute_content_md5(body):
-     m = md5(encode_to_s3(body))
--    base64md5 = base64.encodestring(m.digest())
-+    base64md5 = encodestring(m.digest())
-     base64md5 = decode_from_s3(base64md5)
-     if base64md5[-1] == '\n':
-         base64md5 = base64md5[0:-1]

diff --git a/s3cmd-python39-fixes.patch b/s3cmd-python39-fixes.patch
deleted file mode 100644
index a94a7c2..0000000
--- a/s3cmd-python39-fixes.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-:100644 100644 204f3db 9bb22c2 M	S3/Exceptions.py
-:100644 100644 c56d02a 1cf7f8d M	S3/Utils.py
-
-diff --git a/S3/Exceptions.py b/S3/Exceptions.py
-index 204f3db..9bb22c2 100644
---- a/S3/Exceptions.py
-+++ b/S3/Exceptions.py
-@@ -127,7 +127,7 @@ class S3Error (S3Exception):
-         if not error_node.tag == "Error":
-             error_node = tree.find(".//Error")
-         if error_node is not None:
--            for child in error_node.getchildren():
-+            for child in iter(error_node):
-                 if child.text != "":
-                     debug("ErrorXML: " + child.tag + ": " + repr(child.text))
-                     info[child.tag] = child.text
-diff --git a/S3/Utils.py b/S3/Utils.py
-index c56d02a..1cf7f8d 100644
---- a/S3/Utils.py
-+++ b/S3/Utils.py
-@@ -65,9 +65,9 @@ def parseNodes(nodes):
-     retval = []
-     for node in nodes:
-         retval_item = {}
--        for child in node.getchildren():
-+        for child in iter(node):
-             name = decode_from_s3(child.tag)
--            if child.getchildren():
-+            if list(child):
-                 retval_item[name] = parseNodes([child])
-             else:
-                 found_text = node.findtext(".//%s" % child.tag)
-@@ -124,8 +124,8 @@ __all__.append("getListFromXml")
- 
- def getDictFromTree(tree):
-     ret_dict = {}
--    for child in tree.getchildren():
--        if child.getchildren():
-+    for child in iter(tree):
-+        if list(child):
-             ## Complex-type child. Recurse
-             content = getDictFromTree(child)
-         else:

diff --git a/s3cmd.spec b/s3cmd.spec
index a7a0ad6..5d72450 100644
--- a/s3cmd.spec
+++ b/s3cmd.spec
@@ -1,42 +1,20 @@
-%if 0%{?rhel} && 0%{?rhel} <= 7
-%bcond_with python3
-%else
-%bcond_without python3
-%endif
-
-%define	name	s3cmd
-%define	version	2.4.0
-%define	release	13
-
-Name:           %{name}
-Version:        %{version}
-Release:        %{release}%{?dist}
+Name:           s3cmd
+Version:        2.4.0
+Release:        14%{?dist}
 Summary:        Tool for accessing Amazon Simple Storage Service
 
 License:        GPL-2.0-or-later
-URL:            https://s3tools.org/%{name}
+URL:            https://s3tools.org/s3cmd
 Source0:        https://github.com/s3tools/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz
 BuildArch:      noarch
 
-%if %{with python3}
 BuildRequires:  python3-devel
-BuildRequires:  python3-setuptools
+
 Requires:       python3-dateutil
-Requires:       ( python3-magic or python3-file-magic )
+Requires:       (python3-magic or python3-file-magic)
 
-# Disable auto dependencies as sources match Python2
+# Disable auto dependencies as sources has a selection
 %{?python_disable_dependency_generator}
-%else
-BuildRequires:  python2-devel
-BuildRequires:  python2-setuptools
-%if 0%{?rhel} && 0%{?rhel} <= 7
-Requires:       python-dateutil
-Requires:       python-magic
-%else
-Requires:       python2-dateutil
-Requires:       python2-magic
-%endif
-%endif
 
 %description
 S3cmd lets you copy files from/to Amazon S3
@@ -44,46 +22,49 @@ S3cmd lets you copy files from/to Amazon S3
 command line client.
 
 %prep
-%setup -q
-rm -rf *.egg-info
-%if %{without python3}
-# Not needed on Py2, RPM fails to Bytecompile it
-rm -f S3/Custom_httplib3x.py
+%autosetup
+
+%if ! 0%{?rhel} || 0%{?rhel} >= 9
+%generate_buildrequires
+%pyproject_buildrequires -R
 %endif
 
 %build
 export S3CMD_PACKAGING=1
-%if %{with python3}
+%if 0%{?rhel} && 0%{?rhel} <= 8
 %py3_build
 %else
-%py2_build
+%pyproject_wheel
 %endif
 
 %install
+%if 0%{?rhel} && 0%{?rhel} <= 8
 export S3CMD_PACKAGING=1
-%if %{with python3}
 %py3_install
 %else
-%py2_install
+%pyproject_install
+%pyproject_save_files S3
 %endif
 
 mkdir -p %{buildroot}%{_mandir}/man1
 install -D -p -m 0644 -t %{buildroot}%{_mandir}/man1 %{name}.1
 
+%if 0%{?rhel} && 0%{?rhel} <= 8
 %files
-%license LICENSE
-%doc NEWS README.md
-%{_bindir}/%{name}
-%{_mandir}/man1/%{name}.1*
-%if %{with python3}
 %{python3_sitelib}/%{name}-*.egg-info/
 %{python3_sitelib}/S3/
 %else
-%{python2_sitelib}/%{name}-*.egg-info/
-%{python2_sitelib}/S3/
+%files -f %{pyproject_files}
 %endif
+%license LICENSE
+%doc NEWS README.md
+%{_bindir}/%{name}
+%{_mandir}/man1/%{name}.1*
 
 %changelog
+* Mon Aug 03 2026 Frank Crawford <frank@crawford.emu.id.au> - 2.4.0-14
+- Adopt pyproject-rpm-macros and drop EL7 and python2
+
 * Fri Jul 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-13
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-03  9:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-03  9:48 [rpms/s3cmd] rawhide: Adopt pyproject-rpm-macros and drop EL7 and python2 Frank Crawford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox