|
| 1 | +######################################################################################## |
| 2 | + |
| 3 | +%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} |
| 4 | + |
| 5 | +######################################################################################## |
| 6 | + |
| 7 | +%define pkg_name argparse |
| 8 | +%define pkg_version r140 |
| 9 | + |
| 10 | +######################################################################################## |
| 11 | + |
| 12 | +Summary: Python command-line parsing library |
| 13 | +Name: python-argparse |
| 14 | +Version: 1.4.0 |
| 15 | +Release: 0%{?dist} |
| 16 | +License: Python License |
| 17 | +Group: Development/Libraries |
| 18 | +URL: https://github.com/ThomasWaldmann/argparse |
| 19 | + |
| 20 | +Source: https://github.com/ThomasWaldmann/%{pkg_name}/archive/%{pkg_version}.tar.gz |
| 21 | + |
| 22 | +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
| 23 | + |
| 24 | +BuildArch: noarch |
| 25 | + |
| 26 | +BuildRequires: python >= 2.3 python-setuptools |
| 27 | + |
| 28 | +Requires: python >= 2.3 python-setuptools |
| 29 | + |
| 30 | +Provides: %{name} = %{verion}-%{release} |
| 31 | + |
| 32 | +######################################################################################## |
| 33 | + |
| 34 | +%description |
| 35 | +The argparse module makes it easy to write user friendly command line interfaces. |
| 36 | + |
| 37 | +The program defines what arguments it requires, and argparse will figure out |
| 38 | +how to parse those out of sys.argv. The argparse module also automatically |
| 39 | +generates help and usage messages and issues errors when users give the program |
| 40 | +invalid arguments. |
| 41 | + |
| 42 | +As of Python >= 2.7 and >= 3.2, the argparse module is maintained within the |
| 43 | +Python standard library. For users who still need to support Python < 2.7 or |
| 44 | +< 3.2, it is also provided as a separate package, which tries to stay |
| 45 | +compatible with the module in the standard library, but also supports older |
| 46 | +Python versions. |
| 47 | + |
| 48 | +argparse is licensed under the Python license, for details see LICENSE.txt. |
| 49 | + |
| 50 | +######################################################################################## |
| 51 | + |
| 52 | +%prep |
| 53 | +%setup -qn %{pkg_name}-%{pkg_version} |
| 54 | + |
| 55 | +%clean |
| 56 | +rm -rf %{buildroot} |
| 57 | + |
| 58 | +%build |
| 59 | +python setup.py build |
| 60 | + |
| 61 | +%install |
| 62 | +rm -rf %{buildroot} |
| 63 | +python setup.py install --prefix=%{_prefix} \ |
| 64 | + --single-version-externally-managed -O1 \ |
| 65 | + --root=%{buildroot} |
| 66 | + |
| 67 | +######################################################################################## |
| 68 | + |
| 69 | +%files |
| 70 | +%defattr(-,root,root,-) |
| 71 | +%doc LICENSE.txt NEWS.txt README.txt |
| 72 | +%{python_sitelib}/* |
| 73 | + |
| 74 | +######################################################################################## |
| 75 | + |
| 76 | +%changelog |
| 77 | +* Sat Apr 29 2017 Yandex Team <opensource@yandex-team.ru> - 1.4.0-0 |
| 78 | +- Initial build |
| 79 | + |
0 commit comments