4035dbc
%if 0%{?fedora}
4035dbc
  %bcond_without python3
86a86c4
  %if 0%{?fedora} > 29
86a86c4
    %bcond_with python2
86a86c4
  %else
86a86c4
    %bcond_without python2
86a86c4
  %endif
4035dbc
%else
4035dbc
  %if 0%{?rhel} > 7
4035dbc
    %bcond_with    python2
4035dbc
    %bcond_without python3
4035dbc
  %else
4035dbc
    %bcond_without python2
4035dbc
    %bcond_with    python3
4035dbc
  %endif
4035dbc
%endif
4035dbc
4035dbc
%bcond_without check
4035dbc
4035dbc
4035dbc
%global sum()   Build manual page from %* ArgumentParser object
4035dbc
%global desc \
4035dbc
Generate manual page an automatic way from ArgumentParser object, so the \
4035dbc
manpage 1:1 corresponds to the automatically generated --help output.  The \
4035dbc
manpage generator needs to known the location of the object, user can \
4035dbc
specify that by (a) the module name or corresponding python filename and \
4035dbc
(b) the object name or the function name which returns the object. \
4035dbc
There is a limited support for (deprecated) optparse objects, too.
4035dbc
4035dbc
4035dbc
Name:           argparse-manpage
cde928e
Version:        1.5
cde928e
Release:        1%{?dist}
4035dbc
Summary:        %{sum Python}
4035dbc
BuildArch:      noarch
4035dbc
4035dbc
License:        ASL 2.0
4035dbc
URL:            https://github.com/praiskup/%{name}
394d873
Source0:        %pypi_source
4035dbc
4035dbc
%if %{with python2}
4035dbc
BuildRequires: python2-setuptools python2-devel
4035dbc
%if %{with check}
4035dbc
%if 0%{?rhel} && 0%{?rhel} == 7
4035dbc
BuildRequires: pytest python-six
4035dbc
%else
4035dbc
BuildRequires: python2-pytest python2-six
4035dbc
%endif
4035dbc
%endif
4035dbc
%endif
4035dbc
%if %{with python3}
4035dbc
BuildRequires: python3-setuptools python3-devel
4035dbc
%if %{with check}
4035dbc
BuildRequires: python3-pytest python3-six
4035dbc
%endif
4035dbc
%endif
4035dbc
%if %{with python3}
4035dbc
Requires: python3-%name = %version-%release
4035dbc
%else
4035dbc
Requires: python2-%name = %version-%release
4035dbc
%endif
4035dbc
4035dbc
%description
4035dbc
%desc
4035dbc
4035dbc
4035dbc
%package -n     python2-%name
4035dbc
Summary:        %{sum Python 2}
4035dbc
4035dbc
%description -n python2-%name
4035dbc
%{desc}
4035dbc
4035dbc
4035dbc
%package -n     python3-%name
4035dbc
Summary:        %{sum Python 3}
4035dbc
4035dbc
%description -n python3-%name
4035dbc
%{desc}
4035dbc
4035dbc
4035dbc
%prep
4035dbc
%setup -q
4035dbc
4035dbc
4035dbc
%build
4035dbc
%if %{with python2}
4035dbc
%py2_build
4035dbc
%endif
4035dbc
%if %{with python3}
4035dbc
%py3_build
4035dbc
%endif
4035dbc
4035dbc
4035dbc
%install
4035dbc
%if %{with python2}
4035dbc
%py2_install
4035dbc
%endif
4035dbc
%if %{with python3}
4035dbc
%py3_install
4035dbc
%endif
4035dbc
4035dbc
4035dbc
4035dbc
%if %{with check}
4035dbc
%check
4035dbc
%if %{with python2}
4035dbc
PYTHONPATH=%buildroot%python2_sitearch %__python2 -m pytest
4035dbc
%endif
4035dbc
%if %{with python3}
4035dbc
PYTHONPATH=%buildroot%python3_sitearch %__python3 -m pytest
4035dbc
%endif
4035dbc
%endif
4035dbc
4035dbc
4035dbc
%files
4035dbc
%license LICENSE
4035dbc
%{_bindir}/argparse-manpage
4035dbc
%_mandir/man1/argparse-manpage.1.*
4035dbc
%if %{with python3}
4035dbc
%python3_sitelib/build_manpages/cli
4035dbc
%else
4035dbc
%python2_sitelib/build_manpages/cli
4035dbc
%endif
4035dbc
4035dbc
4035dbc
%if %{with python2}
4035dbc
%files -n python2-%name
4035dbc
%license LICENSE
4035dbc
%python2_sitelib/build_manpages
4035dbc
%python2_sitelib/argparse_manpage-%{version}*.egg-info
4035dbc
%exclude %python2_sitelib/build_manpages/cli
4035dbc
%endif
4035dbc
4035dbc
4035dbc
%if %{with python3}
4035dbc
%files -n python3-%name
4035dbc
%license LICENSE
4035dbc
%python3_sitelib/build_manpages
4035dbc
%python3_sitelib/argparse_manpage-%{version}*.egg-info
4035dbc
%exclude %python3_sitelib/build_manpages/cli
4035dbc
%endif
4035dbc
4035dbc
4035dbc
%changelog
cde928e
* Mon Dec 14 2020 Pavel Raiskup <praiskup@redhat.com> - 1.5-1
cde928e
- new release
cde928e
419615f
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.4-4
419615f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
419615f
1203f51
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.4-3
1203f51
- Rebuilt for Python 3.9
1203f51
03e751a
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.4-2
03e751a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
03e751a
c5ff1f8
* Fri Jan 24 2020 Pavel Raiskup <praiskup@redhat.com> - 1.4-1
c5ff1f8
- new release to fix testsuite against Python 3.9
c5ff1f8
54e8e5d
* Tue Jan 07 2020 Pavel Raiskup <praiskup@redhat.com> - 1.3-1
54e8e5d
- new release
54e8e5d
394d873
* Sat Sep 07 2019 Pavel Raiskup <praiskup@redhat.com> - 1.2.2-1
394d873
- new release
394d873
6b38a00
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.1-6
6b38a00
- Rebuilt for Python 3.8
6b38a00
d2af379
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1-5
d2af379
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
d2af379
95b8967
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1-4
95b8967
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
95b8967
86a86c4
* Tue Oct 02 2018 Pavel Raiskup <praiskup@redhat.com> - 1.1-3
86a86c4
- drop python3 on F30+ (rhbz#1634992)
86a86c4
e14e92b
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1-2
e14e92b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
e14e92b
ea5df85
* Mon Jun 25 2018 Pavel Raiskup <praiskup@redhat.com> - 1.1-1
ea5df85
- v1.1
ea5df85
371b7e7
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.0.0-2
371b7e7
- Rebuilt for Python 3.7
371b7e7
4035dbc
* Mon Feb 19 2018 Pavel Raiskup <praiskup@redhat.com> - 1.0.0-1
4035dbc
- initial RPM packaging