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_version 24.2
%global upstream_name beaker

Name:           %{upstream_name}
Version:        %{upstream_version}
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}-%{upstream_version}.tar.xz

BuildArch:      noarch
BuildRequires:  python-setuptools
BuildRequires:  python-nose >= 0.10
BuildRequires:  python-unittest2
BuildRequires:  python-mock
BuildRequires:  python-setuptools
BuildRequires:  python2-devel
BuildRequires:  python-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:  python-sphinx >= 1.0
%endif
BuildRequires:  python-sphinxcontrib-httpdomain
BuildRequires:  python-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:  python-requests
%endif

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


%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:       python-setuptools
Requires:       %{upstream_name}-common = %{version}-%{release}
Requires:       python-krbV
Requires:       python-lxml
%if 0%{?rhel} >= 6 || 0%{?fedora}
# some client commands use requests, they are unsupported on RHEL5
Requires:       python-requests
%endif
Requires:       libxslt-python
%if !(0%{?rhel} >= 6 || 0%{?fedora} >= 14)
Requires:       python-simplejson
%endif
Requires:       libxml2-python
Requires:       python-prettytable
Requires:       python-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}-%{upstream_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
* 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