734acd
# Enable Python 3 builds for Fedora + EPEL >5
734acd
# NOTE: do **NOT** change 'epel' to 'rhel' here, as this spec is also
117577
%if 0%{?fedora} || 0%{?rhel} > 7
734acd
%bcond_without python3
734acd
# If the definition isn't available for python3_pkgversion, define it
734acd
%{?!python3_pkgversion:%global python3_pkgversion 3}
734acd
%else
734acd
%bcond_with python3
734acd
%endif
734acd
734acd
# Compatibility with RHEL. These macros have been added to EPEL but
734acd
# not yet to RHEL proper.
734acd
# https://bugzilla.redhat.com/show_bug.cgi?id=1307190
734acd
%{!?__python2: %global __python2 /usr/bin/python2}
734acd
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
734acd
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
734acd
%{!?py2_build: %global py2_build %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} build --executable="%{__python2} -s"}}
734acd
%{!?py2_install: %global py2_install %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot}}}
85efc0
417406
%if 0%{?fedora} || 0%{?rhel} >= 7
7f8d61
%global use_systemd 1
7f8d61
%else
7f8d61
%global use_systemd 0
7f8d61
%global install_opt TYPE=sysv
7f8d61
%endif
7f8d61
85efc0
Name: koji
f8d9a7
Version: 1.16.1
184879
Release: 2%{?dist}
b7bcf8
# koji.ssl libs (from plague) are GPLv2+
2b4b9a
License: LGPLv2 and GPLv2+
85efc0
Summary: Build system tools
85efc0
Group: Applications/System
d970b3
URL: https://pagure.io/koji/
d970b3
Source0: https://releases.pagure.org/koji/koji-%{version}.tar.bz2
417406
2b4b9a
# Not upstreamable
2b4b9a
Patch100: fedora-config.patch
021dec
85efc0
BuildArch: noarch
734acd
%if 0%{with python3}
734acd
Requires: python3-%{name} = %{version}-%{release}
734acd
Requires: python3-pycurl
734acd
Requires: python3-libcomps
734acd
%else
734acd
Requires: python2-%{name} = %{version}-%{release}
50d781
%if 0%{?fedora}
734acd
Requires: python2-libcomps
50d781
Requires: python2-pycurl
50d781
%endif
50d781
%if 0%{?rhel}
50d781
Requires: python-pycurl
50d781
%endif
50d781
%if 0%{?rhel} >= 7
50d781
Requires: python-libcomps
734acd
%endif
734acd
%endif
85efc0
BuildRequires: python
c21ae3
BuildRequires: python-sphinx
7f8d61
%if %{use_systemd}
7f8d61
BuildRequires: systemd
7f8d61
BuildRequires: pkgconfig
7f8d61
%endif
85efc0
Randy Barlow 1fe786
# For backwards compatibility, we want to Require: python2-koji for Fedora <= 26 so dependent
Randy Barlow 1fe786
# packages have some time to switch their Requires lines to python2-koji instead of Koji.
Randy Barlow 1fe786
%if 0%{?fedora} && 0%{?fedora} <= 26
Randy Barlow 1fe786
Requires: python2-%{name} = %{version}-%{release}
Randy Barlow 1fe786
Requires: python2-pycurl
Randy Barlow 1fe786
Requires: python2-libcomps
Randy Barlow 1fe786
%endif
Randy Barlow 1fe786
85efc0
%description
85efc0
Koji is a system for building and tracking RPMS.  The base package
85efc0
contains shared libraries and the command-line interface.
85efc0
734acd
%package -n python2-%{name}
734acd
Summary: Build system tools python library
734acd
%{?python_provide:%python_provide python2-%{name}}
734acd
BuildRequires: python2-devel
734acd
Requires: python-krbV >= 1.0.13
734acd
Requires: rpm-python
734acd
Requires: pyOpenSSL
734acd
Requires: python-requests
734acd
Requires: python-requests-kerberos
734acd
Requires: python-dateutil
734acd
Requires: python-six
734acd
734acd
%description -n python2-%{name}
734acd
Koji is a system for building and tracking RPMS.  The base package
734acd
contains shared libraries and the command-line interface.
734acd
734acd
%if 0%{with python3}
734acd
%package -n python3-%{name}
734acd
Summary: Build system tools python library
734acd
%{?python_provide:%python_provide python3-%{name}}
734acd
BuildRequires: python3-devel
734acd
Requires: python3-rpm
734acd
Requires: python3-pyOpenSSL
734acd
Requires: python3-requests
734acd
Requires: python3-requests-kerberos
734acd
Requires: python3-dateutil
734acd
Requires: python3-six
734acd
734acd
%description -n python3-%{name}
734acd
Koji is a system for building and tracking RPMS.  The base package
734acd
contains shared libraries and the command-line interface.
734acd
%endif
734acd
734acd
%package -n python2-%{name}-cli-plugins
734acd
Summary: Koji client plugins
734acd
Group: Applications/Internet
734acd
License: LGPLv2
734acd
Requires: %{name} = %{version}-%{release}
734acd
734acd
%description -n python2-%{name}-cli-plugins
734acd
Plugins to the koji command-line interface
734acd
734acd
%if 0%{with python3}
734acd
%package -n python3-%{name}-cli-plugins
734acd
Summary: Koji client plugins
734acd
Group: Applications/Internet
734acd
License: LGPLv2
734acd
Requires: %{name} = %{version}-%{release}
734acd
734acd
%description -n python3-%{name}-cli-plugins
734acd
Plugins to the koji command-line interface
734acd
%endif
734acd
85efc0
%package hub
85efc0
Summary: Koji XMLRPC interface
85efc0
Group: Applications/Internet
12b25f
License: LGPLv2 and GPLv2
12b25f
# rpmdiff lib (from rpmlint) is GPLv2 (only)
85efc0
Requires: httpd
bd91f9
Requires: mod_wsgi
417406
Requires: python-psycopg2
Owen W. Taylor 4d9761
Requires: python2-%{name} = %{version}-%{release}
85efc0
85efc0
%description hub
85efc0
koji-hub is the XMLRPC interface to the koji database
85efc0
12b25f
%package hub-plugins
12b25f
Summary: Koji hub plugins
12b25f
Group: Applications/Internet
7f8d61
License: LGPLv2
12b25f
Requires: %{name}-hub = %{version}-%{release}
7f8d61
Requires: python-qpid >= 0.7
be89d2
Requires: python-qpid-proton
7f8d61
Requires: cpio
12b25f
12b25f
%description hub-plugins
12b25f
Plugins to the koji XMLRPC interface
12b25f
85efc0
%package builder
85efc0
Summary: Koji RPM builder daemon
85efc0
Group: Applications/System
b7bcf8
License: LGPLv2 and GPLv2+
b7bcf8
#mergerepos (from createrepo) is GPLv2+
Owen W. Taylor 4d9761
Requires: python2-%{name} = %{version}-%{release}
0573e2
Requires: mock >= 0.9.14
7f8d61
Requires(pre): /usr/sbin/useradd
be89d2
Requires: squashfs-tools
417406
Requires: python2-multilib
7f8d61
%if %{use_systemd}
7f8d61
Requires(post): systemd
7f8d61
Requires(preun): systemd
7f8d61
Requires(postun): systemd
7f8d61
%else
85efc0
Requires(post): /sbin/chkconfig
85efc0
Requires(post): /sbin/service
85efc0
Requires(preun): /sbin/chkconfig
85efc0
Requires(preun): /sbin/service
7f8d61
%endif
86272a
Requires: /usr/bin/cvs
86272a
Requires: /usr/bin/svn
86272a
Requires: /usr/bin/git
d6c730
Requires: python-cheetah
7f8d61
Requires: createrepo >= 0.9.2
85efc0
85efc0
%description builder
85efc0
koji-builder is the daemon that runs on build machines and executes
85efc0
tasks that come through the Koji system.
85efc0
964551
%package vm
964551
Summary: Koji virtual machine management daemon
964551
Group: Applications/System
964551
License: LGPLv2
Owen W. Taylor 4d9761
Requires: python2-%{name} = %{version}-%{release}
7f8d61
%if %{use_systemd}
7f8d61
Requires(post): systemd
7f8d61
Requires(preun): systemd
7f8d61
Requires(postun): systemd
7f8d61
%else
964551
Requires(post): /sbin/chkconfig
964551
Requires(post): /sbin/service
964551
Requires(preun): /sbin/chkconfig
964551
Requires(preun): /sbin/service
7f8d61
%endif
964551
Requires: libvirt-python
964551
Requires: libxml2-python
bf3a87
Requires: /usr/bin/virt-clone
964551
Requires: qemu-img
964551
964551
%description vm
964551
koji-vm contains a supplemental build daemon that executes certain tasks in a
964551
virtual machine. This package is not required for most installations.
964551
85efc0
%package utils
85efc0
Summary: Koji Utilities
85efc0
Group: Applications/Internet
7f8d61
License: LGPLv2
417406
Requires: python-psycopg2
Owen W. Taylor 4d9761
Requires: python2-%{name} = %{version}-%{release}
7f8d61
%if %{use_systemd}
7f8d61
Requires(post): systemd
7f8d61
Requires(preun): systemd
7f8d61
Requires(postun): systemd
7f8d61
%endif
85efc0
85efc0
%description utils
85efc0
Utilities for the Koji system
85efc0
85efc0
%package web
85efc0
Summary: Koji Web UI
85efc0
Group: Applications/Internet
7f8d61
License: LGPLv2
85efc0
Requires: httpd
bd91f9
Requires: mod_wsgi
ea2a52
Requires: mod_auth_gssapi
417406
Requires: python-psycopg2
85efc0
Requires: python-cheetah
Owen W. Taylor 4d9761
Requires: python2-%{name} = %{version}-%{release}
85efc0
Requires: python-krbV >= 1.0.13
85efc0
85efc0
%description web
85efc0
koji-web is a web UI to the Koji system.
85efc0
85efc0
%prep
85efc0
%setup -q
2b4b9a
%patch100 -p1 -b .fedoraconfig
85efc0
85efc0
%build
85efc0
85efc0
%install
85efc0
rm -rf $RPM_BUILD_ROOT
7f8d61
make DESTDIR=$RPM_BUILD_ROOT %{?install_opt} install
734acd
%if 0%{with python3}
734acd
cd koji
734acd
make DESTDIR=$RPM_BUILD_ROOT PYTHON=python3 %{?install_opt} install
734acd
cd ../cli
734acd
make DESTDIR=$RPM_BUILD_ROOT PYTHON=python3 %{?install_opt} install
734acd
cd ../plugins
734acd
make DESTDIR=$RPM_BUILD_ROOT PYTHON=python3 %{?install_opt} install
734acd
# alter python interpreter in koji CLI
184879
sed -i 's/\#\!\/usr\/bin\/python2/\#\!\/usr\/bin\/python3/' $RPM_BUILD_ROOT/usr/bin/koji
734acd
%endif
85efc0
85efc0
%files
85efc0
%{_bindir}/*
74be95
%config(noreplace) /etc/koji.conf
74be95
%dir /etc/koji.conf.d
85efc0
%doc docs Authors COPYING LGPL
85efc0
734acd
%files -n python2-%{name}
734acd
%{python2_sitelib}/%{name}
734acd
%{python2_sitelib}/koji_cli
734acd
734acd
%if 0%{with python3}
734acd
%files -n python%{python3_pkgversion}-koji
734acd
%{python3_sitelib}/%{name}
734acd
%{python3_sitelib}/koji_cli
734acd
%endif
734acd
734acd
%files -n python2-%{name}-cli-plugins
734acd
%{python2_sitelib}/koji_cli_plugins
734acd
# we don't have config files for default plugins yet
Patrick Uiterwijk cf88a3
#%%dir %%{_sysconfdir}/koji/plugins
Patrick Uiterwijk cf88a3
#%%config(noreplace) %%{_sysconfdir}/koji/plugins/*.conf
734acd
734acd
%if 0%{with python3}
734acd
%files -n python%{python3_pkgversion}-%{name}-cli-plugins
734acd
%{python3_sitelib}/koji_cli_plugins
734acd
# we don't have config files for default plugins yet
Patrick Uiterwijk cf88a3
#%%dir %%{_sysconfdir}/koji/plugins
Patrick Uiterwijk cf88a3
#%%config(noreplace) %%{_sysconfdir}/koji/plugins/*.conf
734acd
%endif
734acd
85efc0
%files hub
85efc0
%{_datadir}/koji-hub
7f8d61
%dir %{_libexecdir}/koji-hub
74be95
%config(noreplace) /etc/httpd/conf.d/kojihub.conf
74be95
%dir /etc/koji-hub
74be95
%config(noreplace) /etc/koji-hub/hub.conf
74be95
%dir /etc/koji-hub/hub.conf.d
85efc0
12b25f
%files hub-plugins
12b25f
%dir %{_prefix}/lib/koji-hub-plugins
12b25f
%{_prefix}/lib/koji-hub-plugins/*.py*
74be95
%dir /etc/koji-hub/plugins
74be95
/etc/koji-hub/plugins/*.conf
12b25f
85efc0
%files utils
85efc0
%{_sbindir}/kojira
7f8d61
%if %{use_systemd}
7f8d61
%{_unitdir}/kojira.service
7f8d61
%else
85efc0
%{_initrddir}/kojira
74be95
%config(noreplace) /etc/sysconfig/kojira
7f8d61
%endif
74be95
%dir /etc/kojira
74be95
%config(noreplace) /etc/kojira/kojira.conf
7f8d61
%{_sbindir}/koji-gc
74be95
%dir /etc/koji-gc
74be95
%config(noreplace) /etc/koji-gc/koji-gc.conf
7f8d61
%{_sbindir}/koji-shadow
74be95
%dir /etc/koji-shadow
74be95
%config(noreplace) /etc/koji-shadow/koji-shadow.conf
85efc0
85efc0
%files web
85efc0
%{_datadir}/koji-web
74be95
%dir /etc/kojiweb
74be95
%config(noreplace) /etc/kojiweb/web.conf
74be95
%config(noreplace) /etc/httpd/conf.d/kojiweb.conf
74be95
%dir /etc/kojiweb/web.conf.d
85efc0
85efc0
%files builder
85efc0
%{_sbindir}/kojid
7f8d61
%dir %{_libexecdir}/kojid
7f8d61
%{_libexecdir}/kojid/mergerepos
ab48e7
%defattr(-,root,root)
ab48e7
%dir %{_prefix}/lib/koji-builder-plugins
ab48e7
%{_prefix}/lib/koji-builder-plugins/*.py*
7f8d61
%if %{use_systemd}
7f8d61
%{_unitdir}/kojid.service
7f8d61
%else
85efc0
%{_initrddir}/kojid
74be95
%config(noreplace) /etc/sysconfig/kojid
7f8d61
%endif
74be95
%dir /etc/kojid
74be95
%dir /etc/kojid/plugins
74be95
%config(noreplace) /etc/kojid/kojid.conf
74be95
%config(noreplace) /etc/kojid/plugins/runroot.conf
74be95
%config(noreplace) /etc/kojid/plugins/save_failed_tree.conf
74be95
%attr(-,kojibuilder,kojibuilder) /etc/mock/koji
85efc0
85efc0
%pre builder
85efc0
/usr/sbin/useradd -r -s /bin/bash -G mock -d /builddir -M kojibuilder 2>/dev/null ||:
85efc0
7f8d61
%if %{use_systemd}
7f8d61
7f8d61
%post builder
7f8d61
%systemd_post kojid.service
7f8d61
7f8d61
%preun builder
7f8d61
%systemd_preun kojid.service
7f8d61
7f8d61
%postun builder
7f8d61
%systemd_postun kojid.service
7f8d61
7f8d61
%else
7f8d61
85efc0
%post builder
85efc0
/sbin/chkconfig --add kojid
85efc0
85efc0
%preun builder
85efc0
if [ $1 = 0 ]; then
85efc0
  /sbin/service kojid stop &> /dev/null
85efc0
  /sbin/chkconfig --del kojid
85efc0
fi
7f8d61
%endif
85efc0
964551
%files vm
964551
%{_sbindir}/kojivmd
Patrick Uiterwijk cf88a3
#dir %%{_datadir}/kojivmd
7f8d61
%{_datadir}/kojivmd/kojikamid
7f8d61
%if %{use_systemd}
7f8d61
%{_unitdir}/kojivmd.service
7f8d61
%else
964551
%{_initrddir}/kojivmd
74be95
%config(noreplace) /etc/sysconfig/kojivmd
7f8d61
%endif
74be95
%dir /etc/kojivmd
74be95
%config(noreplace) /etc/kojivmd/kojivmd.conf
964551
7f8d61
%if %{use_systemd}
7f8d61
7f8d61
%post vm
7f8d61
%systemd_post kojivmd.service
7f8d61
7f8d61
%preun vm
7f8d61
%systemd_preun kojivmd.service
7f8d61
7f8d61
%postun vm
7f8d61
%systemd_postun kojivmd.service
7f8d61
7f8d61
%else
7f8d61
964551
%post vm
964551
/sbin/chkconfig --add kojivmd
964551
964551
%preun vm
964551
if [ $1 = 0 ]; then
964551
  /sbin/service kojivmd stop &> /dev/null
964551
  /sbin/chkconfig --del kojivmd
964551
fi
7f8d61
%endif
7f8d61
7f8d61
%if %{use_systemd}
7f8d61
7f8d61
%post utils
7f8d61
%systemd_post kojira.service
7f8d61
7f8d61
%preun utils
7f8d61
%systemd_preun kojira.service
964551
7f8d61
%postun utils
7f8d61
%systemd_postun kojira.service
7f8d61
7f8d61
%else
85efc0
%post utils
85efc0
/sbin/chkconfig --add kojira
85efc0
/sbin/service kojira condrestart &> /dev/null || :
85efc0
%preun utils
85efc0
if [ $1 = 0 ]; then
85efc0
  /sbin/service kojira stop &> /dev/null || :
85efc0
  /sbin/chkconfig --del kojira
85efc0
fi
7f8d61
%endif
85efc0
85efc0
%changelog
184879
* Fri Sep 14 2018 Kevin Fenzi <kevin@scrye.com> - 1.16.1-2
184879
- Fix bad sed that caused python32 dep.
184879
f8d9a7
* Thu Sep 13 2018 Kevin Fenzi <kevin@scrye.com> - 1.16.1-1
f8d9a7
- Update to 1.16.1
f8d9a7
d3b033
* Tue Jul 31 2018 Kevin Fenzi <kevin@scrye.com> - 1.16.0-1
d3b033
- Update to 1.16.0
d3b033
6bd49b
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.15.1-3
6bd49b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
6bd49b
1c88fe
* Mon Jun 18 2018 Miro Hrončok <mhroncok@redhat.com> - 1.15.1-2
1c88fe
- Rebuilt for Python 3.7
1c88fe
6f0a88
* Tue Apr 03 2018 Patrick Uiterwijk <puiterwijk@redhat.com> - 1.15.1-1
6f0a88
- Rebase to 1.15.1
6f0a88
- Fixes CVE-2018-1002150
6f0a88
f1d1d6
* Fri Mar 16 2018 Kevin Fenzi <kevin@scrye.com> - 1.15.0-7
f1d1d6
- Backport PR #841 to allow configurable timeout for oz
f1d1d6
Patrick Uiterwijk 3b8665
* Tue Feb 20 2018 Patrick Uiterwijk <patrick@puiterwijk.org> - 1.15.0-6
Patrick Uiterwijk 3b8665
- Backport PR #796
Patrick Uiterwijk 3b8665
Patrick Uiterwijk 8beddd
* Sun Feb 18 2018 Patrick Uiterwijk <patrick@puiterwijk.org> - 1.15.0-5
Patrick Uiterwijk 8beddd
- Add  workaround patch for bug #808
Patrick Uiterwijk 8beddd
Patrick Uiterwijk cf88a3
* Fri Feb 16 2018 Patrick Uiterwijk <patrick@puiterwijk.org> - 1.15.0-4
Patrick Uiterwijk cf88a3
- Backport patch from PR#794
Patrick Uiterwijk cf88a3
- Fix macro escaping in comments
Patrick Uiterwijk cf88a3
Owen W. Taylor 4d9761
* Mon Feb 12 2018 Owen Taylor <otaylor@redhat.com> - 1.15.0-3
Owen W. Taylor 4d9761
- Make hub, builder, etc, require python2-koji not koji
Owen W. Taylor 4d9761
0c7cee
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.15.0-2
0c7cee
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
0c7cee
Patrick Uiterwijk 13c316
* Sat Jan 27 2018 Patrick Uiterwijk <patrick@puiterwijk.org> - 1.15.0-1
Patrick Uiterwijk 13c316
- Rebase to koji 1.15.0
Patrick Uiterwijk 13c316
117577
* Mon Jan 22 2018 Troy Dawson <tdawson@redhat.com> - 1.14.0-4
117577
- Update conditional
117577
Patrick Uiterwijk 13b191
* Thu Dec 07 2017 Patrick Uiterwijk <patrick@puiterwijk.org> - 1.14.0-3
Patrick Uiterwijk 13b191
- Backport py3 runroot encoding patch (PR#735)
Patrick Uiterwijk 13b191
Patrick Uiterwijk 7fdba4
* Mon Dec 04 2017 Patrick Uiterwijk <patrick@puiterwijk.org> - 1.14.0-2
Patrick Uiterwijk 7fdba4
- Backport py3 keytab patch (PR#708)
Patrick Uiterwijk 7fdba4
- Backport patches for exit code (issue#696)
Patrick Uiterwijk 7fdba4
Dennis Gilmore 11067e
* Tue Sep 26 2017 Dennis Gilmore <dennis@ausil.us> - 1.14.0-1
Dennis Gilmore 11067e
- update to upstream 1.14.0
Dennis Gilmore 11067e
4c4f2d
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.13.0-4
4c4f2d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
4c4f2d
50d781
* Wed Jul 12 2017 Patrick Uiterwijk <puiterwijk@redhat.com> - 1.13.0-3
50d781
- Remove the 2 postfix for pycurl and libcomps on RHEL
50d781
Randy Barlow 1fe786
* Tue Jul 11 2017 Randy Barlow <bowlofeggs@fedoraproject.org> - 1.13.0-2
Randy Barlow 1fe786
- Require python2-koji on Fedora <= 26.
Randy Barlow 1fe786
734acd
* Mon Jul 03 2017 Dennis Gilmore <dennis@ausil.us> - 1.13.0-1
734acd
- update to upstream 1.13.0
734acd
- remove old  changelog entries