From 516e58666c027d5d0329289db3af1af1a2ccb848 Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Thu, 29 May 2014 13:05:26 +0200 Subject: [PATCH] Initial import of package --- .gitignore | 2 + python-click.spec | 110 ++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 113 insertions(+) create mode 100644 python-click.spec diff --git a/.gitignore b/.gitignore index e69de29..3d35a65 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +/click-1.1.tar.gz +/click-1.1-tests.tgz diff --git a/python-click.spec b/python-click.spec new file mode 100644 index 0000000..b809c01 --- /dev/null +++ b/python-click.spec @@ -0,0 +1,110 @@ +# Created by pyp2rpm-1.0.1 +%global pypi_name click +%global with_python3 1 + +%global py2v %(%{__python2} -c "import sys; print('{}.{}'.format(sys.version_info[0], sys.version_info[1]))") +%global py3v %(%{__python3} -c "import sys; print('{}.{}'.format(sys.version_info[0], sys.version_info[1]))") + + +Name: python-%{pypi_name} +Version: 1.1 +Release: 1%{?dist} +Summary: A simple wrapper around optparse for powerful command line utilities + +License: BSD +URL: http://github.com/mitsuhiko/click +Source0: https://pypi.python.org/packages/source/c/%{pypi_name}/%{pypi_name}-%{version}.tar.gz +# Tests are not included in pypi package, checked from github +Source1: click-%{version}-tests.tgz +BuildArch: noarch + +BuildRequires: python-devel +BuildRequires: python-setuptools +BuildRequires: pytest + +%if %{?with_python3} +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pytest +%endif # if with_python3 + + +%description +click is a Python package for creating beautiful command line +interfaces in a composable way with as little amount of code as necessary. +It's the "Command Line Interface Creation Kit". It's highly configurable but +comes with good defaults out of the box. + +%if 0%{?with_python3} +%package -n python3-%{pypi_name} +Summary: A simple wrapper around optparse for powerful command line utilities + + +%description -n python3-%{pypi_name} +click is a Python 3 package for creating beautiful command line +interfaces in a composable way with as little amount of code as necessary. +It's the "Command Line Interface Creation Kit". It's highly configurable but +comes with good defaults out of the box. +%endif # with_python3 + + +%prep +%setup -q -n %{pypi_name}-%{version} + +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} + +%endif # with_python3 + + +%build +%{__python2} setup.py build + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py build +popd +%endif # with_python3 + + +%install +# Must do the subpackages' install first because the scripts in /usr/bin are +# overwritten with every setup.py install (and we want the python2 version +# to be the default for now). +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install --skip-build --root %{buildroot} +popd +%endif # with_python3 + +%{__python2} setup.py install --skip-build --root %{buildroot} + +%check +tar xzf %{SOURCE1} +PYTHONPATH=`pwd` py.test-%{py2v} tests --tb=long --verbose +%if 0%{?with_python3} +pushd %{py3dir} +tar xzf %{SOURCE1} +LANG=en_GB.utf8 LC_ALL=en_GB.utf8 PYTHONPATH=`pwd` py.test-%{py3v} tests --tb=long --verbose +popd +%endif + +%files +%doc README +%{python2_sitelib}/%{pypi_name}/* +%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info +%if 0%{?with_python3} +%files -n python3-%{pypi_name} +%doc README +%{python3_sitelib}/%{pypi_name}/* +%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info +%endif # with_python3 + + +%changelog +* Mon May 12 2014 Robert Kuska - 1.1-1 +- Update source + +* Wed May 07 2014 Robert Kuska - 0.6-1 +- Initial package. diff --git a/sources b/sources index e69de29..d2adf09 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +46d3692bcfaa11aa71cbbc71236dbe75 click-1.1-tests.tgz