9718c30
%if 0%{?fedora}
9718c30
# we have some koji hubs doesn't support Python3 with kerberos auth
9718c30
# at this moment, so we build with Python2 for all platforms now
9718c30
%global with_python3 0
9718c30
%endif
9718c30
9718c30
Name:       ursa-major
9718c30
Version:    0.1.1
84a9b91
Release:    4%{?dist}
9718c30
Summary:    A utility for working with module's koji tags in koji's tag inheritance
9718c30
9718c30
Group:      Development/Tools
9718c30
License:    MIT
9718c30
URL:        https://pagure.io/ursa-major
9718c30
Source0:    https://files.pythonhosted.org/packages/source/u/%{name}/%{name}-%{version}.tar.gz
9718c30
9718c30
BuildArch:      noarch
84a9b91
# EPEL:   libmodulemd is not available for ppc or i686
84a9b91
# Fedora: include ix86 as build can be scheduled to i386 arch, otherwise there is
84a9b91
# 	  error: Architecture is not included: i386
84a9b91
ExclusiveArch:  %{ix86} x86_64 noarch
9718c30
9718c30
9718c30
BuildRequires:  help2man
9718c30
BuildRequires:  libmodulemd
9718c30
9718c30
%if 0%{?with_python3}
9718c30
BuildRequires:  python3-devel
9718c30
BuildRequires:  python3-setuptools
9718c30
BuildRequires:  python3-gobject-base
9718c30
BuildRequires:  python3-cairo
9718c30
BuildRequires:  python3-koji
9718c30
BuildRequires:  python3-six
9718c30
BuildRequires:  python3-requests
9718c30
BuildRequires:  python3-jinja2
9718c30
BuildRequires:  python3-psutil
9718c30
BuildRequires:  python3-pytest
9718c30
BuildRequires:  python3-mock
9718c30
%else
9718c30
BuildRequires:  python2-devel
9718c30
BuildRequires:  python2-koji
9718c30
%if 0%{?rhel} && 0%{?rhel} <= 7
9718c30
BuildRequires:  python-setuptools
9718c30
BuildRequires:  python-gobject-base
9718c30
BuildRequires:  pycairo
9718c30
BuildRequires:  python-six
9718c30
BuildRequires:  python-requests
9718c30
BuildRequires:  python-jinja2
9718c30
BuildRequires:  python-futures
9718c30
BuildRequires:  pytest
9718c30
BuildRequires:  python-mock
9718c30
%else
9718c30
BuildRequires:  python2-setuptools
9718c30
BuildRequires:  python2-gobject-base
9718c30
BuildRequires:  python2-cairo
9718c30
BuildRequires:  python2-six
9718c30
BuildRequires:  python2-requests
9718c30
BuildRequires:  python2-jinja2
9718c30
BuildRequires:  python2-futures
9718c30
BuildRequires:  python2-pytest
9718c30
BuildRequires:  python2-mock
9718c30
%endif
9718c30
%endif
9718c30
9718c30
Requires:       gobject-introspection
9718c30
Requires:       krb5-workstation
9718c30
Requires:       koji
9718c30
Requires:       libmodulemd
9718c30
Requires:       m2crypto
9718c30
9718c30
%if 0%{?with_python3}
9718c30
Requires:       python3-gobject-base
9718c30
Requires:       python3-cairo
9718c30
Requires:       python3-koji
9718c30
Requires:       python3-six
9718c30
Requires:       python3-requests
9718c30
Requires:       python3-jinja2
9718c30
%else
9718c30
Requires:       python2-koji
9718c30
%if 0%{?rhel} && 0%{?rhel} <= 7
9718c30
Requires:       python-gobject-base
9718c30
Requires:       pycairo
9718c30
Requires:       python-six
9718c30
Requires:       python-requests
9718c30
Requires:       python-jinja2
9718c30
Requires:       python-futures
9718c30
%else
9718c30
Requires:       python2-gobject-base
9718c30
Requires:       python2-cairo
9718c30
Requires:       python2-six
9718c30
Requires:       python2-requests
9718c30
Requires:       python2-jinja2
9718c30
Requires:       python2-futures
9718c30
%endif
9718c30
%endif
9718c30
9718c30
9718c30
%description
9718c30
Usra-Major can be used to edit a tag config file and update module's koji tags
9718c30
in koji's tag inheritance accordingly per the configuration in tag config file.
9718c30
9718c30
9718c30
%package        -n ursa-major-stage
9718c30
Summary:        A utility for working with module's koji tags in koji's tag inheritance
9718c30
Requires:       %{name} = %{version}-%{release}
9718c30
9718c30
%description    -n ursa-major-stage
9718c30
The ursa-major-stage package contains script and configurations for Ursa-Major
9718c30
to talk with Fedora's stage instances (Koji, MBS).
9718c30
9718c30
9718c30
%prep
9718c30
%setup -q
9718c30
9718c30
%if 0%{?rhel} && 0%{?rhel} <= 7
9718c30
# workaround for no egg-info
9718c30
sed -i '/pycairo/d' requirements.txt
9718c30
# old setuptools not support environment marker
9718c30
sed -i 's/futures.*/futures/' requirements.txt
9718c30
%endif
9718c30
9718c30
# workaround for no egg-info
9718c30
sed -i '/koji/d' requirements.txt
9718c30
9718c30
%build
9718c30
%if 0%{?with_python3}
9718c30
%py3_build
9718c30
%else
9718c30
%py2_build
9718c30
%endif
9718c30
9718c30
9718c30
%install
9718c30
%if 0%{?with_python3}
9718c30
%py3_install
9718c30
%else
9718c30
%py2_install
9718c30
%endif
9718c30
9718c30
%if 0%{?with_python3}
9718c30
export PYTHONPATH=%{buildroot}%{python3_sitelib}
9718c30
%else
9718c30
export PYTHONPATH=%{buildroot}%{python2_sitelib}
9718c30
%endif
9718c30
mkdir -p %{buildroot}/%{_mandir}/man1
9718c30
9718c30
help2man -N --version-string=%{version} %{buildroot}/%{_bindir}/ursa-major > %{buildroot}/%{_mandir}/man1/ursa-major.1
9718c30
for cmd in show-config check-config remove-module add-module add-tag; do
9718c30
    help2man -N --version-string=%{version} "%{buildroot}/%{_bindir}/ursa-major $cmd" > %{buildroot}/%{_mandir}/man1/ursa-major-${cmd}.1
9718c30
done
9718c30
9718c30
9718c30
%check
9718c30
%if 0%{?with_python3}
9718c30
py.test-3
9718c30
%else
9718c30
py.test
9718c30
%endif
9718c30
9718c30
9718c30
%files
9718c30
%doc README.rst
9718c30
%license LICENSE
9718c30
9718c30
%if 0%{?with_python3}
9718c30
%{python3_sitelib}/ursa_major*
9718c30
%else
9718c30
%{python2_sitelib}/ursa_major*
9718c30
%endif
9718c30
9718c30
%{_bindir}/ursa-major
9718c30
%dir %{_sysconfdir}/ursa-major
9718c30
%config(noreplace) %{_sysconfdir}/ursa-major/ursa-major.conf
9718c30
%doc %{_mandir}/man1/ursa-major*.1*
9718c30
9718c30
%files stage
9718c30
%{_bindir}/ursa-major-stage
9718c30
%config(noreplace) %{_sysconfdir}/ursa-major/ursa-major-stage.conf
9718c30
9718c30
9718c30
%changelog
84a9b91
* Mon Dec 03 2018 Qixiang Wan <qwan@redhat.com> - 0.1.1-4
341f4a7
- build can be scheduled to i386 arch, include ix86
84a9b91
57ad88d
* Mon Dec 03 2018 Qixiang Wan <qwan@redhat.com> - 0.1.1-3
84a9b91
- libmodulemd is missing from EPEL ppc64le buildroot, enable x86_64 only
57ad88d
9718c30
* Fri Nov 16 2018 Qixiang Wan <qwan@redhat.com> - 0.1.1-2
9718c30
- Limit build arches as libmodulemd is not available for ppc or i686
9718c30
9718c30
* Fri Oct 26 2018 Qixiang Wan <qwan@redhat.com> - 0.1.1-1
9718c30
- Initial version of spec file