From 4035dbc9eeef5208131569ccbe5f8da43dece443 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Tue, 20 Feb 2018 17:50:31 +0100 Subject: [PATCH] initial commit Version: 1.0.0-1 --- .gitignore | 1 + README.md | 3 - argparse-manpage.spec | 142 ++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 4 files changed, 144 insertions(+), 3 deletions(-) create mode 100644 .gitignore delete mode 100644 README.md create mode 100644 argparse-manpage.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0fe56ac --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/argparse-manpage-1.0.0.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index d6f0e5d..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# argparse-manpage - -The argparse-manpage package \ No newline at end of file diff --git a/argparse-manpage.spec b/argparse-manpage.spec new file mode 100644 index 0000000..811a7f6 --- /dev/null +++ b/argparse-manpage.spec @@ -0,0 +1,142 @@ +%if 0%{?fedora} + %bcond_without python2 + %bcond_without python3 +%else + %if 0%{?rhel} > 7 + %bcond_with python2 + %bcond_without python3 + %else + %bcond_without python2 + %bcond_with python3 + %endif +%endif + +%bcond_without check + + +%global sum() Build manual page from %* ArgumentParser object +%global desc \ +Generate manual page an automatic way from ArgumentParser object, so the \ +manpage 1:1 corresponds to the automatically generated --help output. The \ +manpage generator needs to known the location of the object, user can \ +specify that by (a) the module name or corresponding python filename and \ +(b) the object name or the function name which returns the object. \ +There is a limited support for (deprecated) optparse objects, too. + + +Name: argparse-manpage +Version: 1.0.0 +Release: 1%{?dist} +Summary: %{sum Python} +BuildArch: noarch + +License: ASL 2.0 +URL: https://github.com/praiskup/%{name} +Source0: https://github.com/praiskup/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz + +%if %{with python2} +BuildRequires: python2-setuptools python2-devel +%if %{with check} +%if 0%{?rhel} && 0%{?rhel} == 7 +BuildRequires: pytest python-six +%else +BuildRequires: python2-pytest python2-six +%endif +%endif +%endif +%if %{with python3} +BuildRequires: python3-setuptools python3-devel +%if %{with check} +BuildRequires: python3-pytest python3-six +%endif +%endif +%if %{with python3} +Requires: python3-%name = %version-%release +%else +Requires: python2-%name = %version-%release +%endif + +%description +%desc + + +%package -n python2-%name +Summary: %{sum Python 2} + +%description -n python2-%name +%{desc} + + +%package -n python3-%name +Summary: %{sum Python 3} + +%description -n python3-%name +%{desc} + + +%prep +%setup -q + + +%build +%if %{with python2} +%py2_build +%endif +%if %{with python3} +%py3_build +%endif + + +%install +%if %{with python2} +%py2_install +%endif +%if %{with python3} +%py3_install +%endif + + + +%if %{with check} +%check +%if %{with python2} +PYTHONPATH=%buildroot%python2_sitearch %__python2 -m pytest +%endif +%if %{with python3} +PYTHONPATH=%buildroot%python3_sitearch %__python3 -m pytest +%endif +%endif + + +%files +%license LICENSE +%{_bindir}/argparse-manpage +%_mandir/man1/argparse-manpage.1.* +%if %{with python3} +%python3_sitelib/build_manpages/cli +%else +%python2_sitelib/build_manpages/cli +%endif + + +%if %{with python2} +%files -n python2-%name +%license LICENSE +%python2_sitelib/build_manpages +%python2_sitelib/argparse_manpage-%{version}*.egg-info +%exclude %python2_sitelib/build_manpages/cli +%endif + + +%if %{with python3} +%files -n python3-%name +%license LICENSE +%python3_sitelib/build_manpages +%python3_sitelib/argparse_manpage-%{version}*.egg-info +%exclude %python3_sitelib/build_manpages/cli +%endif + + +%changelog +* Mon Feb 19 2018 Pavel Raiskup - 1.0.0-1 +- initial RPM packaging diff --git a/sources b/sources new file mode 100644 index 0000000..f058367 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (argparse-manpage-1.0.0.tar.gz) = a097e78d766617f3b5224964b5d543a289187360cf96e5ded6787e43bf520e1a7b15278c8e5d7566567748c5478da7b203f07c93f0a93739fcd6360c1ac6c7eb