Blame SPECS/argparse-manpage.spec

6b3e9f
%if 0%{?fedora}
6b3e9f
  %bcond_without python2
6b3e9f
  %bcond_without python3
6b3e9f
%else
6b3e9f
  %if 0%{?rhel} > 7
6b3e9f
    %bcond_with    python2
6b3e9f
    %bcond_without python3
6b3e9f
  %else
6b3e9f
    %bcond_without python2
6b3e9f
    %bcond_with    python3
6b3e9f
  %endif
6b3e9f
%endif
6b3e9f
6b3e9f
%bcond_without check
6b3e9f
6b3e9f
6b3e9f
%global sum()   Build manual page from %* ArgumentParser object
6b3e9f
%global desc \
6b3e9f
Generate manual page an automatic way from ArgumentParser object, so the \
6b3e9f
manpage 1:1 corresponds to the automatically generated --help output.  The \
6b3e9f
manpage generator needs to known the location of the object, user can \
6b3e9f
specify that by (a) the module name or corresponding python filename and \
6b3e9f
(b) the object name or the function name which returns the object. \
6b3e9f
There is a limited support for (deprecated) optparse objects, too.
6b3e9f
6b3e9f
6b3e9f
Name:           argparse-manpage
6b3e9f
Version:        1.1
6b3e9f
Release:        2%{?dist}
6b3e9f
Summary:        %{sum Python}
6b3e9f
BuildArch:      noarch
6b3e9f
6b3e9f
License:        ASL 2.0
6b3e9f
URL:            https://github.com/praiskup/%{name}
6b3e9f
Source0:        https://github.com/praiskup/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
6b3e9f
6b3e9f
%if %{with python2}
6b3e9f
BuildRequires: python2-setuptools python2-devel
6b3e9f
%if %{with check}
6b3e9f
%if 0%{?rhel} && 0%{?rhel} == 7
6b3e9f
BuildRequires: pytest python-six
6b3e9f
%else
6b3e9f
BuildRequires: python2-pytest python2-six
6b3e9f
%endif
6b3e9f
%endif
6b3e9f
%endif
6b3e9f
%if %{with python3}
6b3e9f
BuildRequires: python3-setuptools python3-devel
6b3e9f
%if %{with check}
6b3e9f
BuildRequires: python3-pytest python3-six
6b3e9f
%endif
6b3e9f
%endif
6b3e9f
%if %{with python3}
6b3e9f
Requires: python3-%name = %version-%release
6b3e9f
%else
6b3e9f
Requires: python2-%name = %version-%release
6b3e9f
%endif
6b3e9f
6b3e9f
%description
6b3e9f
%desc
6b3e9f
6b3e9f
6b3e9f
%package -n     python2-%name
6b3e9f
Summary:        %{sum Python 2}
6b3e9f
6b3e9f
%description -n python2-%name
6b3e9f
%{desc}
6b3e9f
6b3e9f
6b3e9f
%package -n     python3-%name
6b3e9f
Summary:        %{sum Python 3}
6b3e9f
6b3e9f
%description -n python3-%name
6b3e9f
%{desc}
6b3e9f
6b3e9f
6b3e9f
%prep
6b3e9f
%setup -q
6b3e9f
6b3e9f
6b3e9f
%build
6b3e9f
%if %{with python2}
6b3e9f
%py2_build
6b3e9f
%endif
6b3e9f
%if %{with python3}
6b3e9f
%py3_build
6b3e9f
%endif
6b3e9f
6b3e9f
6b3e9f
%install
6b3e9f
%if %{with python2}
6b3e9f
%py2_install
6b3e9f
%endif
6b3e9f
%if %{with python3}
6b3e9f
%py3_install
6b3e9f
%endif
6b3e9f
6b3e9f
6b3e9f
6b3e9f
%if %{with check}
6b3e9f
%check
6b3e9f
%if %{with python2}
6b3e9f
PYTHONPATH=%buildroot%python2_sitearch %__python2 -m pytest
6b3e9f
%endif
6b3e9f
%if %{with python3}
6b3e9f
PYTHONPATH=%buildroot%python3_sitearch %__python3 -m pytest
6b3e9f
%endif
6b3e9f
%endif
6b3e9f
6b3e9f
6b3e9f
%files
6b3e9f
%license LICENSE
6b3e9f
%{_bindir}/argparse-manpage
6b3e9f
%_mandir/man1/argparse-manpage.1.*
6b3e9f
%if %{with python3}
6b3e9f
%python3_sitelib/build_manpages/cli
6b3e9f
%else
6b3e9f
%python2_sitelib/build_manpages/cli
6b3e9f
%endif
6b3e9f
6b3e9f
6b3e9f
%if %{with python2}
6b3e9f
%files -n python2-%name
6b3e9f
%license LICENSE
6b3e9f
%python2_sitelib/build_manpages
6b3e9f
%python2_sitelib/argparse_manpage-%{version}*.egg-info
6b3e9f
%exclude %python2_sitelib/build_manpages/cli
6b3e9f
%endif
6b3e9f
6b3e9f
6b3e9f
%if %{with python3}
6b3e9f
%files -n python3-%name
6b3e9f
%license LICENSE
6b3e9f
%python3_sitelib/build_manpages
6b3e9f
%python3_sitelib/argparse_manpage-%{version}*.egg-info
6b3e9f
%exclude %python3_sitelib/build_manpages/cli
6b3e9f
%endif
6b3e9f
6b3e9f
6b3e9f
%changelog
6b3e9f
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1-2
6b3e9f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
6b3e9f
6b3e9f
* Mon Jun 25 2018 Pavel Raiskup <praiskup@redhat.com> - 1.1-1
6b3e9f
- v1.1
6b3e9f
6b3e9f
* Tue Jun 19 2018 Miro HronĨok <mhroncok@redhat.com> - 1.0.0-2
6b3e9f
- Rebuilt for Python 3.7
6b3e9f
6b3e9f
* Mon Feb 19 2018 Pavel Raiskup <praiskup@redhat.com> - 1.0.0-1
6b3e9f
- initial RPM packaging