Blob Blame History Raw
%if 0%{?fedora}
# we have some koji hubs doesn't support Python3 with kerberos auth
# at this moment, so we build with Python2 for all platforms now
%global with_python3 0

Name:       ursa-major
Version:    0.1.1
Release:    4%{?dist}
Summary:    A utility for working with module's koji tags in koji's tag inheritance

Group:      Development/Tools
License:    MIT

BuildArch:      noarch
# EPEL:   libmodulemd is not available for ppc or i686
# Fedora: include ix86 as build can be scheduled to i386 arch, otherwise there is
# 	  error: Architecture is not included: i386
ExclusiveArch:  %{ix86} x86_64 noarch

BuildRequires:  help2man
BuildRequires:  libmodulemd

%if 0%{?with_python3}
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-gobject-base
BuildRequires:  python3-cairo
BuildRequires:  python3-koji
BuildRequires:  python3-six
BuildRequires:  python3-requests
BuildRequires:  python3-jinja2
BuildRequires:  python3-psutil
BuildRequires:  python3-pytest
BuildRequires:  python3-mock
BuildRequires:  python2-devel
BuildRequires:  python2-koji
%if 0%{?rhel} && 0%{?rhel} <= 7
BuildRequires:  python-setuptools
BuildRequires:  python-gobject-base
BuildRequires:  pycairo
BuildRequires:  python-six
BuildRequires:  python-requests
BuildRequires:  python-jinja2
BuildRequires:  python-futures
BuildRequires:  pytest
BuildRequires:  python-mock
BuildRequires:  python2-setuptools
BuildRequires:  python2-gobject-base
BuildRequires:  python2-cairo
BuildRequires:  python2-six
BuildRequires:  python2-requests
BuildRequires:  python2-jinja2
BuildRequires:  python2-futures
BuildRequires:  python2-pytest
BuildRequires:  python2-mock

Requires:       gobject-introspection
Requires:       krb5-workstation
Requires:       koji
Requires:       libmodulemd
Requires:       m2crypto

%if 0%{?with_python3}
Requires:       python3-gobject-base
Requires:       python3-cairo
Requires:       python3-koji
Requires:       python3-six
Requires:       python3-requests
Requires:       python3-jinja2
Requires:       python2-koji
%if 0%{?rhel} && 0%{?rhel} <= 7
Requires:       python-gobject-base
Requires:       pycairo
Requires:       python-six
Requires:       python-requests
Requires:       python-jinja2
Requires:       python-futures
Requires:       python2-gobject-base
Requires:       python2-cairo
Requires:       python2-six
Requires:       python2-requests
Requires:       python2-jinja2
Requires:       python2-futures

Usra-Major can be used to edit a tag config file and update module's koji tags
in koji's tag inheritance accordingly per the configuration in tag config file.

%package        -n ursa-major-stage
Summary:        A utility for working with module's koji tags in koji's tag inheritance
Requires:       %{name} = %{version}-%{release}

%description    -n ursa-major-stage
The ursa-major-stage package contains script and configurations for Ursa-Major
to talk with Fedora's stage instances (Koji, MBS).

%setup -q

%if 0%{?rhel} && 0%{?rhel} <= 7
# workaround for no egg-info
sed -i '/pycairo/d' requirements.txt
# old setuptools not support environment marker
sed -i 's/futures.*/futures/' requirements.txt

# workaround for no egg-info
sed -i '/koji/d' requirements.txt

%if 0%{?with_python3}

%if 0%{?with_python3}

%if 0%{?with_python3}
export PYTHONPATH=%{buildroot}%{python3_sitelib}
export PYTHONPATH=%{buildroot}%{python2_sitelib}
mkdir -p %{buildroot}/%{_mandir}/man1

help2man -N --version-string=%{version} %{buildroot}/%{_bindir}/ursa-major > %{buildroot}/%{_mandir}/man1/ursa-major.1
for cmd in show-config check-config remove-module add-module add-tag; do
    help2man -N --version-string=%{version} "%{buildroot}/%{_bindir}/ursa-major $cmd" > %{buildroot}/%{_mandir}/man1/ursa-major-${cmd}.1

%if 0%{?with_python3}

%doc README.rst
%license LICENSE

%if 0%{?with_python3}

%dir %{_sysconfdir}/ursa-major
%config(noreplace) %{_sysconfdir}/ursa-major/ursa-major.conf
%doc %{_mandir}/man1/ursa-major*.1*

%files stage
%config(noreplace) %{_sysconfdir}/ursa-major/ursa-major-stage.conf

* Mon Dec 03 2018 Qixiang Wan <> - 0.1.1-4
- build can be scheduled to i386 arch, include ix86

* Mon Dec 03 2018 Qixiang Wan <> - 0.1.1-3
- libmodulemd is missing from EPEL ppc64le buildroot, enable x86_64 only

* Fri Nov 16 2018 Qixiang Wan <> - 0.1.1-2
- Limit build arches as libmodulemd is not available for ppc or i686

* Fri Oct 26 2018 Qixiang Wan <> - 0.1.1-1
- Initial version of spec file