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