]>
Commit | Line | Data |
---|---|---|
2cc8a235 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
6 | %define module ConfigArgParse | |
7 | Summary: A Python module with support for argparse, config files, and env variables | |
8 | Name: python-configargparse | |
1ef86eec | 9 | Version: 0.13.0 |
deae8dbe | 10 | Release: 4 |
2cc8a235 ER |
11 | License: MIT |
12 | Source0: https://pypi.python.org/packages/source/C/%{module}/%{module}-%{version}.tar.gz | |
1ef86eec | 13 | # Source0-md5: 6d3427dce78a17fb48222538f579bdb8 |
2cc8a235 ER |
14 | Group: Libraries/Python |
15 | URL: https://github.com/bw2/ConfigArgParse | |
16 | BuildRequires: rpm-pythonprov | |
17 | BuildRequires: rpmbuild(macros) >= 1.713 | |
18 | %if %{with python2} | |
19 | BuildRequires: python-setuptools | |
20 | %endif | |
21 | %if %{with python3} | |
22 | BuildRequires: python3-setuptools | |
23 | %endif | |
24 | BuildArch: noarch | |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
26 | ||
27 | %description | |
28 | Applications with more than a handful of user-settable options are | |
29 | best configured through a combination of command line args, config | |
30 | files, hard coded defaults, and in some cases, environment variables. | |
31 | ||
32 | Python's command line parsing modules such as argparse have very | |
33 | limited support for config files and environment variables, so this | |
34 | module extends argparse to add these features. | |
35 | ||
36 | %package -n python3-configargparse | |
37 | Summary: A Python module with support for argparse, config files, and env variables | |
38 | Group: Libraries/Python | |
39 | ||
40 | %description -n python3-configargparse | |
41 | Applications with more than a handful of user-settable options are | |
42 | best configured through a combination of command line args, config | |
43 | files, hard coded defaults, and in some cases, environment variables. | |
44 | ||
45 | Python's command line parsing modules such as argparse have very | |
46 | limited support for config files and environment variables, so this | |
47 | module extends argparse to add these features. | |
48 | ||
49 | %prep | |
50 | %setup -q -n %{module}-%{version} | |
51 | ||
52 | %build | |
53 | %if %{with python2} | |
54 | %py_build | |
55 | %endif | |
56 | %if %{with python3} | |
57 | %py3_build | |
58 | %endif | |
59 | ||
60 | %install | |
61 | rm -rf $RPM_BUILD_ROOT | |
62 | %if %{with python2} | |
63 | %py_install | |
64 | %py_postclean | |
65 | %endif | |
66 | %if %{with python3} | |
67 | %py3_install | |
68 | %endif | |
69 | ||
70 | %clean | |
71 | rm -rf $RPM_BUILD_ROOT | |
72 | ||
73 | %if %{with python2} | |
74 | %files | |
75 | %defattr(644,root,root,755) | |
76 | %doc README.rst LICENSE | |
77 | %{py_sitescriptdir}/configargparse.py[co] | |
78 | %{py_sitescriptdir}/%{module}*.egg-info | |
79 | %endif | |
80 | ||
81 | %if %{with python3} | |
82 | %files -n python3-configargparse | |
83 | %defattr(644,root,root,755) | |
84 | %doc README.rst LICENSE | |
85 | %{py3_sitescriptdir}/configargparse.py | |
86 | %{py3_sitescriptdir}/%{module}*.egg-info | |
87 | %{py3_sitescriptdir}/__pycache__/configargparse* | |
88 | %endif |