File argparse.spec of Package argparse

%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}

%define src_name argparse
%define name python-argparse
%define version 1.2.1
%define release 1

Summary: Python command-line parsing library
Name: %{name}
Version: %{version}
Release: %{release}
Source0: http://argparse.googlecode.com/files/argparse-1.2.1.tar.gz
License: Python
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
BuildArch: noarch

Url: http://code.google.com/p/argparse/

Requires: python >= 2.3, python-setuptools

BuildRequires: python >= 2.3, python-setuptools

%description
The argparse module makes it easy to write user friendly command line interfaces.

The program defines what arguments it requires, and argparse will figure out
how to parse those out of sys.argv. The argparse module also automatically
generates help and usage messages and issues errors when users give the program
invalid arguments.

As of Python >= 2.7 and >= 3.2, the argparse module is maintained within the
Python standard library. For users who still need to support Python < 2.7 or
< 3.2, it is also provided as a separate package, which tries to stay
compatible with the module in the standard library, but also supports older
Python versions.

argparse is licensed under the Python license, for details see LICENSE.txt.

%prep
%setup -n %{src_name}-%{version}

%build
python setup.py build

%install
python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc LICENSE.txt NEWS.txt README.txt
%{python_sitelib}/*
openSUSE Build Service is sponsored by