Blob Blame History Raw
%if 0%{?rhel} && 0%{?rhel} <= 6
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%endif

# The server, lab controller, and integration test subpackages can be conditionally built.
# Use rpmbuild --without to override.
%global _lc_services beaker-proxy beaker-provision beaker-watchdog beaker-transfer
# systemd?
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
%global with_systemd 1
%else
%global with_systemd 0
%endif

# This will not necessarily match the RPM Version if the real version number is
# not representable in RPM. For example, a release candidate might be 0.15.0rc1
# but that is not usable for the RPM Version because it sorts higher than
# 0.15.0, so the RPM will have Version 0.15.0 and Release 0.rc1 in that case.
%global upstream_name beaker

Name:           %{upstream_name}
Version:        25.4
Release:        1%{?dist}
Summary:        Full-stack software and hardware integration testing system
Group:          Applications/Internet
License:        GPLv2+ and BSD
URL:            https://beaker-project.org/

Source0:        https://beaker-project.org/releases/%{upstream_name}-%{version}.tar.xz

BuildArch:      noarch
BuildRequires:  python2-setuptools
BuildRequires:  python2-nose >= 0.10
BuildRequires:  python2-unittest2
BuildRequires:  python2-mock
BuildRequires:  python2-devel
BuildRequires:  python2-docutils >= 0.6
# These are needed just to build the server manpages
#BuildRequires:  python-sqlalchemy
#BuildRequires:  TurboGears
#BuildRequires:  python-flask
#BuildRequires:  python2-decorator
#BuildRequires:  python-webassets
#BuildRequires:  python-netaddr
#BuildRequires:  python-ldap
#BuildRequires:  cracklib-python
#BuildRequires:  python2-passlib
#BuildRequires:  rpm-python
%if 0%{?rhel} == 5 || 0%{?rhel} == 6
BuildRequires:  python-sphinx10
%else
BuildRequires:  python2-sphinx >= 1.0
%endif
BuildRequires:  python2-sphinxcontrib-httpdomain
BuildRequires:  python2-prettytable
# setup.py uses pkg-config to find the right installation paths
%if 0%{?fedora} || 0%{?rhel} >= 7
BuildRequires:  pkgconfig(bash-completion)
%endif
%if %{with_systemd}
BuildRequires:  pkgconfig(systemd)
%endif
%if 0%{?rhel} >= 6 || 0%{?fedora}
# some client commands use requests, they are unsupported on RHEL5
BuildRequires:  python2-requests
%endif

# As above, these client dependencies are needed in build because of sphinx
BuildRequires:  python2-krbv
BuildRequires:  python2-lxml
BuildRequires:  python2-libxslt


%package common
Summary:        Common components for Beaker packages
Group:          Applications/Internet
Provides:       %{upstream_name} = %{version}-%{release}


%package client
Summary:        Command-line client for interacting with Beaker
Group:          Applications/Internet
Requires:       python2-setuptools
Requires:       %{upstream_name}-common = %{version}-%{release}
Requires:       python2-krbv
Requires:       python2-lxml
%if 0%{?rhel} >= 6 || 0%{?fedora}
# some client commands use requests, they are unsupported on RHEL5
Requires:       python2-requests
%endif
Requires:       python2-libxslt
%if !(0%{?rhel} >= 6 || 0%{?fedora} >= 14)
Requires:       python-simplejson
%endif
Requires:       libxml2-python
Requires:       python2-prettytable
Requires:       python2-jinja2
# beaker-wizard was moved from rhts-devel to here in 4.52
Conflicts:      rhts-devel < 4.52

%description
Beaker is a full stack software and hardware integration testing system, with
the ability to manage a globally distributed network of test labs.

%description common
Python modules which are used by other Beaker packages.

%description client
The bkr client is a command-line tool for interacting with Beaker servers. You
can use it to submit Beaker jobs, fetch results, and perform many other tasks.

%prep
%setup -q -n %{upstream_name}-%{version}
# The server relies on a great many packages which are intended to be bundled
# source, and its documentation greatly inflates the number of BR packages
# required. Until those are packaged separately, building those subpackages is
# unnnecessary
rm -r Server documentation/server-api

%build
make

%install
DESTDIR=%{buildroot} make install

%check
make check

%files common
%doc README.md
%license COPYING
%dir %{python2_sitelib}/bkr/
%{python2_sitelib}/bkr/__init__.py*
%{python2_sitelib}/bkr/timeout_xmlrpclib.py*
%{python2_sitelib}/bkr/common/
%{python2_sitelib}/bkr/log.py*
%{python2_sitelib}/%{upstream_name}_common-%{version}-py2.7.egg-info/
%{_mandir}/man8/%{upstream_name}-import.8.gz
%exclude %{_mandir}/man8/%{upstream_name}-create-ipxe-image.8.gz
%exclude %{_mandir}/man8/%{upstream_name}-create-kickstart.8.gz
%exclude %{_mandir}/man8/%{upstream_name}-init.8.gz
%exclude %{_mandir}/man8/%{upstream_name}-repo-update.8.gz
%exclude %{_mandir}/man8/%{upstream_name}-usage-reminder.8.gz

%files client
%dir %{_sysconfdir}/%{upstream_name}
%doc Client/client.conf.example
%{python2_sitelib}/bkr/client/
%{python2_sitelib}/%{upstream_name}_client-%{version}-py2.7-nspkg.pth
%{python2_sitelib}/%{upstream_name}_client-%{version}-py2.7.egg-info/
%{_bindir}/%{upstream_name}-wizard
%{_bindir}/bkr
%{_mandir}/man1/beaker-wizard.1.gz
%{_mandir}/man1/bkr.1.gz
%{_mandir}/man1/bkr-*.1.gz
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
%{_datadir}/bash-completion
%else
%{_sysconfdir}/bash_completion.d
%endif

%changelog
* Fri May 25 2018 Greg Hellings <greg.hellings@gmail.com> - 25.4-1
- Upstream version 25.4
- Fixes BZ 1579575

* Mon May 14 2018 Greg Hellings <greg.hellings@gmail.com> - 25.2-1
- Upstream version 25.2
- Fixes BZ1566043

* Tue Mar 13 2018 Greg Hellings <greg.hellings@gmail.com> - 25.0-1
- Upstream version 25.0

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 24.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Nov 16 2017 Greg Hellings <greg.hellings@gmail.com> - 24.5-1
- Upstream release 24.5

* Tue Oct 03 2017 Greg Hellings <greg.hellings@gmail.com> - 24.4-1
- Upstream release 24.4

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 24.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Tue May 30 2017 Greg Hellings <greg.hellings@gmail.com> - 24.3-1
- Upstream release 24.3

* Thu Apr 06 2017 Greg Hellings <greg.hellings@gmail.com> - 24.2-1
- Upstream release 24.2

* Mon Mar 06 2017 Greg Hellings <greg.hellings@gmail.com> - 24.1-2
- Fixed broken dependency

* Mon Mar 06 2017 Greg Hellings <greg.hellings@gmail.com> - 24.1-1
- New upstream release 24.1
- Imported to official builds

* Wed Mar 01 2017 Greg Hellings <greg.hellings@gmail.com> - 24.0-2
- Renamed child packages per review

* Thu Feb 23 2017 Greg Hellings <greg.hellings@gmail.com> - 24.0-1
- Upgraded to upstream 24.0

* Wed Dec 21 2016 Greg Hellings <greg.hellings@gmail.com> - 23.3-1
- Initial build