# Enable Python 3 builds for Fedora/RHEL8 %if 0%{?fedora} || 0%{?rhel} >= 8 %bcond_without python3 # If the definition isn't available for python3_pkgversion, define it %{?!python3_pkgversion:%global python3_pkgversion 3} %else %bcond_with python3 %endif # Compatibility with RHEL. These macros have been added to EPEL but # not yet to RHEL proper. # https://bugzilla.redhat.com/show_bug.cgi?id=1307190 %{!?__python2: %global __python2 /usr/bin/python2} %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %{!?py2_build: %global py2_build %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} build --executable="%{__python2} -s"}} %{!?py2_install: %global py2_install %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot}}} %define baserelease 1 #build with --define 'testbuild 1' to have a timestamp appended to release %if x%{?testbuild} == x1 %define release %{baserelease}.%(date +%%y%%m%%d.%%h%%m.%%s) %else %define release %{baserelease} %endif Name: brewkoji Version: 1.23 Release: %{release}%{?dist} License: redhat-internal Summary: brew compatibility interface for koji Group: Applications/System Source: %{name}-%{version}.tar.bz2 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch Requires: koji >= 1.13 %if 0%{with python3} Requires: python%{python3_pkgversion}-%{name} = %{version}-%{release} %else Requires: python2-%{name} = %{version}-%{release} %endif Obsoletes: brew BuildRequires: python-devel %description Brew is a Koji instance. This package makes it easier to connect to Brew by providing configuration and a wrapper for the command line. For information about connecting to Brew, see: https://mojo.redhat.com/docs/DOC-1071519 When you want to report an issue, consult: https://mojo.redhat.com/docs/DOC-1084598 %package -n python2-%{name} Summary: Brew python2 library %{?python_provide:%python_provide python2-%{name}} BuildRequires: python2-devel Requires: python2-koji >= 1.13 %description -n python2-%{name} desc %if 0%{with python3} %package -n python%{python3_pkgversion}-%{name} Summary: Brew python3 library %{?python_provide:%python_provide python%{python3_pkgversion}-%{name}} BuildRequires: python%{python3_pkgversion}-devel Requires: python%{python3_pkgversion}-koji >= 1.13 %description -n python%{python3_pkgversion}-%{name} desc %endif %package test Summary: CLI and configuration for Brew instance used for testing new code Group: Applications/Internet %description test CLI and configuration for Brew instance used for testing new code. %package qe Summary: CLI and configuration for Brew-qe instance Group: Applications/Internet %description qe CLI and configuration for Brew-stage instance. for more information see documentation for this instance: https://mojo.redhat.com/docs/DOC-1022698 %package stage Summary: CLI and configuration for Brew-stage instance Group: Applications/Internet %description stage CLI and configuration for Brew-stage instance. for more information see documentation for this instance: https://mojo.redhat.com/docs/DOC-1022698 %prep %setup -q %build %install export PYTHON_DISALLOW_AMBIGUOUS_VERSION=0 export RHEL_ALLOW_PYTHON2_FOR_BUILD=1 rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT BINDIR=%{_bindir} PYTHON=%{__python2} LINK=yes install %if 0%{with python3} cd lib make DESTDIR=$RPM_BUILD_ROOT BINDIR=%{_bindir} PYTHON=%{__python3} install %endif %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %{_bindir}/brew %config(noreplace) %{_sysconfdir}/koji.conf.d/brewkoji.conf %{_sysconfdir}/pki/brew/legacy.crt %doc Authors COPYING README %files -n python2-%{name} %defattr(-,root,root) %{python2_sitelib}/brew %if 0%{with python3} %files -n python%{python3_pkgversion}-%{name} %defattr(-,root,root) %{python3_sitelib}/brew %endif %files test %defattr(-,root,root) %{_bindir}/brew-test %config(noreplace) %{_sysconfdir}/koji.conf.d/brewtest.conf %{_sysconfdir}/pki/brew/legacy.crt %files qe %defattr(-,root,root) %{_bindir}/brew-qe %config(noreplace) %{_sysconfdir}/koji.conf.d/brewqe.conf %{_sysconfdir}/pki/brew/legacy.crt %files stage %defattr(-,root,root) %{_bindir}/brew-stage %config(noreplace) %{_sysconfdir}/koji.conf.d/brewstage.conf %{_sysconfdir}/pki/brew/legacy.crt %changelog * Thu Jan 31 2019 Yu Ming Zhu 1.23-1 - alter binfile of brew* to symlink from /usr/bin/koji (yzhu@redhat.com) - Revert "use python2 on fedora" (yzhu@redhat.com) - remove 'U' open mode (tkopecek@redhat.com) * Tue Dec 04 2018 Yu Ming Zhu 1.22-2 - use python2 on fedora (yzhu@redhat.com) - fix runroot output for PY3 (yzhu@redhat.com) * Mon Nov 12 2018 Yu Ming Zhu 1.22-1 - fix spec for python shebang replacement (yzhu@redhat.com) * Tue Nov 06 2018 Yu Ming Zhu 1.21-1 - change stage/qe hub url from /kojihub to /brewhub (yzhu@redhat.com) * Mon Oct 15 2018 Yu Ming Zhu 1.20-1 - BREW-2205: enable python3 build which is required by RHEL8 by default (yzhu@redhat.com) - tito releaser for f29 (tkopecek@redhat.com) - alter binfile of brew-* to symlink from /usr/bin/brew (yzhu@redhat.com) * Wed Apr 11 2018 Tomas Kopecek 1.19-1 - tito releasers update up to f28 (tkopecek@redhat.com) * Fri Dec 08 2017 Mike McLean 1.18-1 - Explicitly require python2 koji (tkopecek@redhat.com) - Add link for reporting issues (tkopecek@redhat.com) - python3 compatible syntax (tkopecek@redhat.com) - enforce python2 usage (tkopecek@redhat.com) - f25/26 tito release targets (mikem@redhat.com) - tito releasers file (mikem@redhat.com) * Tue Oct 10 2017 Mike McLean 1.17-1 - include Red Hat IT Root CA in legacy bundle for forward compatibility (mikem@redhat.com) * Thu Aug 17 2017 Mike McLean 1.16-1 - Initialized to use tito. - brew 1.12 and koji 1.13 compat * Mon Jun 26 2017 Mike McLean - 1.15-1 - Use koji.grab_session_options if available * Tue Feb 14 2017 Tomas Kopecek - 1.14-1 - use bundled legacy.crt * Thu Apr 14 2016 Mike McLean - 1.13-1 - add containerbuild handler to stage wrapper * Tue Mar 29 2016 Mike McLean - 1.12-1 - update for pdi migration - fix logging on brewkoji cli commands * Tue Jan 19 2016 Mike McLean - 1.11-1 - use standard cnames for brewstage config * Thu Jan 14 2016 Mike McLean - 1.10-1 - fix session opts in cli wrappers - make koji-containerbuild a soft requirement - add containerbuild handler to prod wrapper - add runroot handler to stage and test cli wrappers * Fri May 01 2015 Pavol Babincak - 1.9-1 - Add brew-test subpackage for brew-test instance with CLI and config - Add container-build to brew-test - Update link to documentation - Move configuration to /etc/koji.confi.d/ - Fix Group value in spec to make rpmlint happy - Add brew-stage subpackage for brew-stage instance with CLI and config * Thu Dec 13 2012 Mike McLean 1.8-1 - remove pkgurl config - update description * Mon Jan 18 2010 Mike McLean 1.7-1 - repo id option for runroot [mikeb] * Wed Jan 06 2010 Mike McLean 1.6-1 - channel override for runroot - avoid sys.modules.itervalues - Resolves: rhbz#547690 * Tue Dec 15 2009 Mike McLean 1.5-1 - avoid sys.modules.itervalues - Resolves: rhbz#547690 * Thu Dec 10 2009 Mike McLean 1.4-1 - fix changelog for picky update tools * Tue Oct 20 2009 Mike McLean 1.3-1 - runroot --weight option * Tue Dec 02 2008 Mike McLean 1.2-1 - honor --skip-setarch in runroot command * Mon Nov 10 2008 Mike McLean 1.1-1 - added runroot handler * Thu Jul 17 2008 Mike McLean 1.0-1 - initial build