File python-zuul.spec of Package python-zuul

#
# spec file for package python-zuul
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/


%define skip_python2 1

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-zuul
Version:        3.3.1
Release:        0
License:        Apache-2.0
Url:            https://zuul-ci.org/
Summary:        A Project Gating System
Group:          Development/Languages/Python
Source0:        https://files.pythonhosted.org/packages/source/z/zuul/zuul-%{version}.tar.gz
Source5:        zuul.logrotate
# systemd files
Source10:       zuul-executor.service
Source11:       zuul-scheduler.service
Source12:       zuul-web.service
Source13:       zuul-merger.service
Source14:       zuul-fingergw.service
Patch1:         relax-requirements.patch
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module pbr}
BuildRequires:  fdupes
Requires(pre):  shadow
Requires:       python-alembic
Requires:       python-APScheduler >= 3.0
Requires:       python-Babel >= 1.0
Requires:       python-CacheControl
Requires:       python-CherryPy
Requires:       python-cryptography >= 1.6
Requires:       python-extras
Requires:       python-fb-re2 >= 1.0.6
Requires:       python-gear >= 0.9.0
Requires:       python-github3.py >= 1.1.0
Requires:       python-GitPython >= 2.1.8
Requires:       python-iso8601
Requires:       python-kazoo
Requires:       python-netaddr
Requires:       python-paho-mqtt
Requires:       python-paramiko >= 2.0.1
Requires:       python-pbr >= 1.1.0
Requires:       python-PrettyTable >= 0.6
Requires:       python-psutil
Requires:       python-PyJWT
Requires:       python-python-daemon >= 2.0.4
Requires:       python-PyYAML >= 3.1.0
Requires:       python-Routes
Requires:       python-SQLAlchemy
Requires:       python-statsd >= 3.0
Requires:       python-voluptuous >= 0.10.2
Requires:       python-ws4py
Requires:       logrotate
BuildRequires:  systemd-rpm-macros
%{?systemd_requires}
BuildArch:      noarch

%python_subpackages

%description
Zuul is a program that drives continuous integration, delivery, and
deployment systems with a focus on project gating and interrelated projects.

%package -n zuul-executor
Summary:        A Project Gating System
Group:          Development/Languages/Python
Requires:       python3-zuul = %{version}
Requires:       ansible >= 2.5.1
Requires:       python3-jmespath
Requires:       bubblewrap

%description -n zuul-executor
Zuul is a program that drives continuous integration, delivery, and
deployment systems with a focus on project gating and interrelated projects.

%package -n zuul-scheduler
Summary:        A Project Gating System
Group:          Development/Languages/Python
Requires:       python3-zuul = %{version}

%description -n zuul-scheduler
Zuul is a program that drives continuous integration, delivery, and
deployment systems with a focus on project gating and interrelated projects.

%package -n zuul-web
Summary:        A Project Gating System
Group:          Development/Languages/Python
Requires:       python3-zuul = %{version}

%description -n zuul-web
Zuul is a program that drives continuous integration, delivery, and
deployment systems with a focus on project gating and interrelated projects.

%package -n zuul-merger
Summary:        A Project Gating System
Group:          Development/Languages/Python
Requires:       python3-zuul = %{version}

%description -n zuul-merger
Zuul is a program that drives continuous integration, delivery, and
deployment systems with a focus on project gating and interrelated projects.

%package -n zuul-fingergw
Summary:        A Project Gating System
Group:          Development/Languages/Python
Requires:       python3-zuul = %{version}

%description -n zuul-fingergw
Zuul is a program that drives continuous integration, delivery, and
deployment systems with a focus on project gating and interrelated projects.

%prep
%setup -q -n zuul-%{version}
%patch1 -p1

%build
%python_build

%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}

# systemd
install -D -m 644 %{SOURCE10} %{buildroot}%{_unitdir}/zuul-executor.service
install -D -m 644 %{SOURCE11} %{buildroot}%{_unitdir}/zuul-scheduler.service
install -D -m 644 %{SOURCE12} %{buildroot}%{_unitdir}/zuul-web.service
install -D -m 644 %{SOURCE13} %{buildroot}%{_unitdir}/zuul-merger.service
install -D -m 644 %{SOURCE14} %{buildroot}%{_unitdir}/zuul-fingergw.service

# bash-completion/logrotate/etc.
install -p -D -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/logrotate.d/zuul

# config
install -p -D -m 0644 etc/logging.conf-sample %{buildroot}%{_sysconfdir}/zuul/logging.conf
install -p -D -m 0640 etc/zuul.conf-sample %{buildroot}%{_sysconfdir}/zuul/zuul.conf

# Service base directories
install -p -d -m 0700 %{buildroot}%{_sharedstatedir}/zuul
install -p -d -m 0700 %{buildroot}%{_localstatedir}/log/zuul
install -p -d -m 0700 %{buildroot}%{_sharedstatedir}/zuul/.ssh
install -p -d -m 0755 %{buildroot}%{_sharedstatedir}/zuul/ansible
install -p -d -m 0755 %{buildroot}%{_sharedstatedir}/zuul/executor
install -p -d -m 0755 %{buildroot}%{_sharedstatedir}/zuul/git
install -p -d -m 0700 %{buildroot}%{_sharedstatedir}/zuul/keys

%pre
getent group zuul >/dev/null || groupadd -r zuul
getent passwd zuul >/dev/null || useradd -r -g zuul -d /var/lib/zuul -s /sbin/nologin -c "user for python-zuul" zuul
exit 0

%pre -n zuul-executor
%service_add_pre zuul-executor.service

%post -n zuul-executor
%service_add_post zuul-executor.service

%preun -n zuul-executor
%service_del_preun zuul-executor.service

%postun -n zuul-executor
%service_del_postun zuul-executor.service

%pre -n zuul-scheduler
%service_add_pre zuul-scheduler.service

%post -n zuul-scheduler
%service_add_post zuul-scheduler.service

%preun -n zuul-scheduler
%service_del_preun zuul-scheduler.service

%postun -n zuul-scheduler
%service_del_postun zuul-scheduler.service

%pre -n zuul-web
%service_add_pre zuul-web.service

%post -n zuul-web
%service_add_post zuul-web.service

%preun -n zuul-web
%service_del_preun zuul-web.service

%postun -n zuul-web
%service_del_postun zuul-web.service

%pre -n zuul-merger
%service_add_pre zuul-merger.service

%post -n zuul-merger
%service_add_post zuul-merger.service

%preun -n zuul-merger
%service_del_preun zuul-merger.service

%postun -n zuul-merger
%service_del_postun zuul-merger.service

%pre -n zuul-fingergw
%service_add_pre zuul-fingergw.service

%post -n zuul-fingergw
%service_add_post zuul-fingergw.service

%preun -n zuul-fingergw
%service_del_preun zuul-fingergw.service

%postun -n zuul-fingergw
%service_del_postun zuul-fingergw.service


%files %{python_files}
%doc AUTHORS ChangeLog README.rst
%license COPYING LICENSE
%dir %attr(0751, zuul, zuul) %{_sysconfdir}/zuul
%dir %attr(0751, zuul, zuul) %{_sharedstatedir}/zuul
%dir %attr(0700, zuul, zuul) %{_sharedstatedir}/zuul/.ssh
%dir %attr(0755, zuul, zuul) %{_sharedstatedir}/zuul/ansible
%dir %attr(0700, zuul, zuul) %{_sharedstatedir}/zuul/keys
%dir %attr(0750, zuul, zuul) %{_localstatedir}/log/zuul
%config(noreplace) %{_sysconfdir}/logrotate.d/zuul
%config(noreplace) %{_sysconfdir}/zuul/logging.conf
%config(noreplace) %attr(0640, root, zuul) %{_sysconfdir}/zuul/zuul.conf
%python3_only %{_bindir}/zuul
%python3_only %{_bindir}/zuul-bwrap
%python3_only %{_bindir}/zuul-migrate
%{python_sitelib}/*

%files -n zuul-executor
%license LICENSE
%python3_only %{_bindir}/zuul-executor
%{_unitdir}/zuul-executor.service
%dir %attr(0755, zuul, zuul) %{_sharedstatedir}/zuul/ansible
%dir %attr(0755, zuul, zuul) %{_sharedstatedir}/zuul/executor

%files -n zuul-scheduler
%license LICENSE
%python3_only %{_bindir}/zuul-scheduler
%{_unitdir}/zuul-scheduler.service

%files -n zuul-web
%license LICENSE
%python3_only %{_bindir}/zuul-web
%{_unitdir}/zuul-web.service

%files -n zuul-merger
%license LICENSE
%python3_only %{_bindir}/zuul-merger
%{_unitdir}/zuul-merger.service

%files -n zuul-fingergw
%license LICENSE
%python3_only %{_bindir}/zuul-fingergw
%{_unitdir}/zuul-fingergw.service

%changelog
openSUSE Build Service is sponsored by