public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/fedpkg] 1.48-1: Switch to Python 3 on Fedora > 28 and EL > 7
@ 2026-08-10 21:45 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-08-10 21:45 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/fedpkg
            Branch : 1.48-1
            Commit : f8f9d99f7c0765d314fd68f9dd58c90e37a66918
            Author : Miro Hrončok <miro@hroncok.cz>
            Date   : 2018-05-10T12:32:42+02:00
            Stats  : +59/-16 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/fedpkg/c/f8f9d99f7c0765d314fd68f9dd58c90e37a66918?branch=1.48-1

            Log:
            Switch to Python 3 on Fedora > 28 and EL > 7

- Drop Groups
- Switch to %{buildroot}
- Switch to %py_build and _install

---
diff --git a/fedpkg.spec b/fedpkg.spec
index d1fef0a..9a247c6 100644
--- a/fedpkg.spec
+++ b/fedpkg.spec
@@ -5,25 +5,41 @@
 
 Name:           fedpkg
 Version:        1.32
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Fedora utility for working with dist-git
 
-Group:          Applications/System
 License:        GPLv2+
 URL:            https://pagure.io/fedpkg
 Source0:        https://pagure.io/releases/fedpkg/%{name}-%{version}.tar.bz2
 
 BuildArch:      noarch
 
+# fedpkg command switched to python3 on Fedora 29 and RHEL > 7:
+%if 0%{?fedora} > 28 || 0%{?rhel} > 7
+%bcond_with python2
+%else
+%bcond_without python2
+%endif
+
 BuildRequires:  pkgconfig
+BuildRequires:  bash-completion
+BuildRequires:  git
+
+Requires:       bodhi-client
+Requires:       fedora-packager
+Requires:       koji
+Requires:       redhat-rpm-config
+
+%if %{with python2}
+# This package redefines __python and can use the python_ macros
+%global __python %{__python2}
+
 BuildRequires:  python2-devel
 # We br these things for man page generation due to imports
 BuildRequires:  python2-rpkg >= 1.51
-BuildRequires:  bash-completion
 # This until fedora-cert gets fixed
 BuildRequires:  python2-fedora
 # For testing
-BuildRequires:  git
 BuildRequires:  python2-mock
 
 %if 0%{?rhel}
@@ -48,21 +64,37 @@ BuildRequires:  python2-bugzilla
 Requires:       python2-bugzilla
 %endif
 
-Requires:       bodhi-client
-Requires:       fedora-packager
-Requires:       koji
-Requires:       redhat-rpm-config
 Requires:       python2-rpkg >= 1.51
 Requires:       python2-fedora
 Requires:       python2-openidc-client
 
+%else  # python3
+# This package redefines __python and can use the python_ macros
+%global __python %{__python3}
+
+BuildRequires:  python3-devel
+BuildRequires:  python3-rpkg >= 1.51
+# This until fedora-cert gets fixed
+BuildRequires:  python3-fedora
+# For testing
+BuildRequires:  python3-mock
+BuildRequires:  python3-unittest2
+BuildRequires:  python3-nose
+BuildRequires:  python3-setuptools
+BuildRequires:  python3-bugzilla
+
+Requires:       python3-bugzilla
+Requires:       python3-rpkg >= 1.51
+Requires:       python3-fedora
+Requires:       python3-openidc-client
+%endif
+
 
 %description
 Provides the fedpkg command for working with dist-git
 
 %package        -n fedpkg-stage
 Summary:        Fedora utility for working with dist-git
-Group:          Applications/System
 Requires:       %{name} = %{version}-%{release}
 
 %description    -n fedpkg-stage
@@ -72,22 +104,27 @@ Provides the fedpkg command for working with dist-git
 %setup -q
 
 %build
-%{__python} setup.py build
+%py_build
 %{__python} doc/fedpkg_man_page.py > fedpkg.1
 
 
 %install
-%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
-%{__install} -d $RPM_BUILD_ROOT%{_mandir}/man1
-%{__install} -p -m 0644 fedpkg.1 $RPM_BUILD_ROOT%{_mandir}/man1
+%py_install
+%{__install} -d %{buildroot}%{_mandir}/man1
+%{__install} -p -m 0644 fedpkg.1 %{buildroot}%{_mandir}/man1
 %if 0%{?rhel} && 0%{?rhel} == 7
 # The completion file must be named similarly to the command.
-mv $RPM_BUILD_ROOT%{compdir}/fedpkg.bash $RPM_BUILD_ROOT%{compdir}/fedpkg
+mv %{buildroot}%{compdir}/fedpkg.bash %{buildroot}%{compdir}/fedpkg
 %endif
 
 
 %check
+%if 0%{?rhel} == 6
+# cannot use -m nose on EL6 (python 2.6)
 nosetests
+%else
+%{__python} -m nose
+%endif
 
 
 
@@ -99,8 +136,8 @@ nosetests
 %{_bindir}/%{name}
 %{_mandir}/*/*
 # For noarch packages: sitelib
-%{python2_sitelib}/%{name}
-%{python2_sitelib}/%{name}-%{version}-py*.egg-info
+%{python_sitelib}/%{name}
+%{python_sitelib}/%{name}-%{version}-py*.egg-info
 # zsh completion
 %{_datadir}/zsh/site-functions/_%{name}
 
@@ -110,6 +147,12 @@ nosetests
 
 
 %changelog
+* Thu May 10 2018 Miro Hrončok <mhroncok@redhat.com> - 1.32-2
+- Switch to Python 3 on Fedora > 28 and EL > 7
+- Drop Groups
+- Switch to %%{buildroot}
+- Switch to %%py_build and _install
+
 * Thu Mar 01 2018 Chenxiong Qi <cqi@redhat.com> - 1.32-1
 - Add requests-tests-repo command (mvadkert)
 - Use PDC instead of Bodhi to get the active release branches - #187 (mprahl)

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

only message in thread, other threads:[~2026-08-10 21:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-10 21:45 [rpms/fedpkg] 1.48-1: Switch to Python 3 on Fedora > 28 and EL > 7 

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