Blob Blame History Raw
%global distname fedscm_admin

Name:           fedscm-admin
Version:        1.0.5
Release:        1%{?dist}
Summary:        CLI tool to process Fedora SCM requests
License:        GPLv2+
URL:            https://pagure.io/fedscm-admin
Source0:        https://releases.pagure.org/fedscm-admin/fedscm_admin-%version.tar.gz
BuildArch:      noarch

BuildRequires:  help2man
BuildRequires:  python3-click
BuildRequires:  python3-devel
BuildRequires:  python3-bugzilla
BuildRequires:  python3-fedora
BuildRequires:  python3-PyYAML
BuildRequires:  python3-requests
BuildRequires:  python3-six
BuildRequires:  python3-setuptools
# For tests
BuildRequires:  python3-mock
BuildRequires:  python3-pytest

Requires:  git-core
Requires:  python3-bugzilla
Requires:  python3-fedora
Requires:  python3-PyYAML
Requires:  python3-six
Requires:  python3-requests
Requires:  python3-click


%description
CLI tool to process Fedora SCM requests


%prep
%autosetup -n %{distname}-%{version}


%build
%py3_build


%check
export FEDSCM_ADMIN_TEST_CONFIG=true
export PYTHONPATH=%{buildroot}/%{python3_sitelib}
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
py.test-3 tests/
unset FEDSCM_ADMIN_TEST_CONFIG


%install
# Set where the config file is so that generating the man pages will not traceback
export FEDSCM_ADMIN_CONFIG=%{buildroot}/%{_sysconfdir}/fedscm-admin/config.ini
export PYTHONPATH=%{buildroot}/%{python3_sitelib}
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
%py3_install

cat >append-to-manual <<EOF
[see also]
%{_pkgdocdir}/README.md
EOF

mkdir -p %{buildroot}/%{_mandir}/man1
help2man -N --version-string=%{version} --include=append-to-manual %{buildroot}/%{_bindir}/fedscm-admin > %{buildroot}/%{_mandir}/man1/fedscm-admin.1
unset FEDSCM_ADMIN_CONFIG


%files
%doc README.md
%license LICENSE
%{python3_sitelib}/*
%{_bindir}/fedscm-admin
%dir %{_sysconfdir}/fedscm-admin
%{_sysconfdir}/fedscm-admin/config.ini
%{_mandir}/man1/fedscm-admin.1*


%changelog
* Wed Feb 20 2019 Mohan Boddu <mboddu@bhujji.com> - 1.0.5-1
- Fedora 30 is branched
- Give a little more details when finding a ticket to be invalid (pingou)
- Fixing tests

* Tue Aug 14 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.0.2-1
- Update to 1.0.2 which can process F29 branches properly.

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro HronĨok <mhroncok@redhat.com> - 1.0.0-2
- Rebuilt for Python 3.7

* Mon Jun 11 2018 mprahl <mprahl@redhat.com> - 1.0.0-1
- Initial release