public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/fedfind] test-pr-branch-2: Py3 on EPEL 7, split CLI and lib packages, py3 exec
@ 2026-06-19 22:30 Adam Williamson
  0 siblings, 0 replies; only message in thread
From: Adam Williamson @ 2026-06-19 22:30 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/fedfind
Branch : test-pr-branch-2
Commit : 61ce0af0d14008dcd88873785ed719eba3800215
Author : Adam Williamson <awilliam@redhat.com>
Date   : 2017-02-10T19:24:48-08:00
Stats  : +64/-41 in 1 file(s)
URL    : https://src.fedoraproject.org/rpms/fedfind/c/61ce0af0d14008dcd88873785ed719eba3800215?branch=test-pr-branch-2

Log:
Py3 on EPEL 7, split CLI and lib packages, py3 exec

---
diff --git a/fedfind.spec b/fedfind.spec
index fdb0b4d..f782448 100644
--- a/fedfind.spec
+++ b/fedfind.spec
@@ -1,21 +1,22 @@
-# RHEL 6 compatibility.
-%if 0%{?fedora} > 12
-%global with_python3 1
+# Enable Python 3 builds for Fedora + EPEL >6
+%if 0%{?fedora} || 0%{?rhel} > 6
+# If the definition isn't available for python3_pkgversion, define it
+%{?!python3_pkgversion:%global python3_pkgversion 3}
+%bcond_without  python3
 %else
-%{!?__python2: %global __python2 /usr/bin/python2}
-%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
+%bcond_with     python3
 %endif
 
 # packages required at both test time and run time
 %global test_requires2 python2-cached_property python2-productmd python-six python-setuptools
-%global test_requires3 python3-cached_property python3-productmd python3-six python3-setuptools
+%global test_requires3 python%{python3_pkgversion}-cached_property python%{python3_pkgversion}-productmd python%{python3_pkgversion}-six python%{python3_pkgversion}-setuptools
 
 %global srcname fedfind
 
 Name:           fedfind
 Version:        3.4.1
-Release:        1%{?dist}
-Summary:        Fedora Finder finds Fedora
+Release:        2%{?dist}
+Summary:        Fedora compose and image finder
 
 Group:          Applications/Productivity
 License:        GPLv3+
@@ -30,51 +31,65 @@ BuildRequires:  pytest
 BuildRequires:  python-mock
 BuildRequires:  %{test_requires2}
 %if 0%{?with_python3}
-BuildRequires:  python3-devel
-BuildRequires:  python3-setuptools
-BuildRequires:  python3-pytest
-BuildRequires:  python3-mock
+BuildRequires:  python%{python3_pkgversion}-devel
+BuildRequires:  python%{python3_pkgversion}-setuptools
+BuildRequires:  python%{python3_pkgversion}-pytest
+BuildRequires:  python%{python3_pkgversion}-mock
 BuildRequires:  %{test_requires3}
 %endif # if with_python3
-# Not available on EPEL, so made optional in code
-# Recommends:   python-subprocess32
-Requires:       %{test_requires2}
 # Required on EL 6 but no longer provided on F>25, hence this annoying
 # conditional
 %if 0%{?rhel} && 0%{?rhel} < 7
 BuildRequires:  python-argparse
 Requires:       python-argparse
 %endif # rhel < 7
-Provides:       python2-fedfind = %{version}-%{release}
-Provides:       python-fedfind = %{version}-%{release}
+%if 0%{?with_python3}
+Requires:  python%{python3_pkgversion}-fedfind
+%else
+Requires:  python2-fedfind
+%endif
 
 %description
 Fedora Finder finds Fedora. For now, that means it finds Fedora images
-- for stable releases, milestone pre-releases, TC/RC composes, and
-nightly builds. It provides a simple CLI for showing image URLs, and
-can be used as a library by tools which need to find and do stuff with
-Fedora images.
+- for stable releases, milestone pre-releases, candidate composes, and
+nightly composes. The fedfind package provides a simple CLI for showing
+image URLs.
+
+%package -n python2-fedfind
+Summary:        Fedora compose and image finder library
+%{?python_provide:%python_provide python2-fedfind}
+Group:          Applications/Productivity
+Requires:       %{test_requires2}
+# Not available on EPEL, so made optional in code
+# Recommends:   python-subprocess32
+
+%description -n python2-fedfind
+Fedora Finder finds Fedora. For now, that means it finds Fedora images
+- for stable releases, milestone pre-releases, candidate composes, and
+nightly composes. The fedfind library provides a handy interface for
+interacting with Fedora composes and discovering various properties of
+them, along with some miscellaneous helper functions. This is the
+Python 2 library package.
 
 %if 0%{?with_python3}
-%package -n python3-fedfind
+%package -n python%{python3_pkgversion}-fedfind
 Summary:        Fedora Finder finds Fedora (using Python 3)
+%{?python_provide:%python_provide python3-fedfind}
 Group:          Applications/Productivity
 Requires:       %{test_requires3}
-# old name from pre-Fedora packaging on happyassassin
-Obsoletes:      fedfind3 < %{version}-%{release}
-Provides:       fedfind3 = %{version}-%{release}
 
-%description -n python3-fedfind
+%description -n python%{python3_pkgversion}-fedfind
 Fedora Finder finds Fedora. For now, that means it finds Fedora images
-- for stable releases, milestone pre-releases, TC/RC composes, and
-nightly builds. It provides a simple CLI for showing image URLs, and
-can be used as a library by tools which need to find and do stuff with
-Fedora images. This is the Python 3 build of the fedfind package.
+- for stable releases, milestone pre-releases, candidate composes, and
+nightly composes. The fedfind library provides a handy interface for
+interacting with Fedora composes and discovering various properties of
+them, along with some miscellaneous helper functions. This is the
+Python 3 library package.
 %endif # with_python3
 
 
 %prep
-%setup -q -n %{srcname}-%{version}
+%autosetup -n %{srcname}-%{version} -p1
 %if 0%{?with_python3}
 rm -rf %{py3dir}
 cp -a . %{py3dir}
@@ -82,27 +97,25 @@ find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!.*python2|#!%{__python3}|'
 %endif # with_python3
 
 %build
-%{__python2} setup.py build
-
+%py2_build
 %if 0%{?with_python3}
 pushd %{py3dir}
-%{__python3} setup.py build
+%py3_build
 popd
 %endif # with_python3
 
 %install
 rm -rf %{buildroot}
 
-# Must do the python3 install first because the scripts in /usr/bin are
-# overwritten with every setup.py install (and we want the python2 version
-# to be the default for now).
+# We want the Python 3 executable to be default where it builds, so
+# go with this install order
+%py2_install
 %if 0%{?with_python3}
 pushd %{py3dir}
-%{__python3} setup.py install --skip-build --root %{buildroot}
+%py3_install
 popd
 %endif # with_python3
 
-%{__python2} setup.py install --skip-build --root %{buildroot}
 
 %check
 %{__python2} setup.py test
@@ -116,11 +129,15 @@ popd
 %files
 %doc README.md CHANGELOG.md
 %license COPYING
-%{python2_sitelib}/%{srcname}*
 %{_bindir}/fedfind
 
+%files -n python2-fedfind
+%doc README.md CHANGELOG.md
+%license COPYING
+%{python2_sitelib}/%{srcname}*
+
 %if 0%{?with_python3}
-%files -n python3-fedfind
+%files -n python%{python3_pkgversion}-fedfind
 %doc README.md CHANGELOG.md
 %license COPYING
 %{python3_sitelib}/%{srcname}*
@@ -128,6 +145,12 @@ popd
 
 
 %changelog
+* Fri Feb 10 2017 Adam Williamson <awilliam@redhat.com> - 3.4.1-2
+- Enable Python 3 build for EPEL 7
+- Split CLI and library packages
+- Use Python 3 executable on distros where Python 3 build is enabled
+- Drop the old fedfind3 provides/obsoletes, it's been long enough
+
 * Fri Feb 10 2017 Adam Williamson <awilliam@redhat.com> - 3.4.1-1
 - New release 3.4.1:
 - * Include `composeinfo` dict in synthesized metadata

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

only message in thread, other threads:[~2026-06-19 22:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-19 22:30 [rpms/fedfind] test-pr-branch-2: Py3 on EPEL 7, split CLI and lib packages, py3 exec Adam Williamson

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