]> git.pld-linux.org Git - packages/python-positional.git/blob - python-positional.spec
df5586b5f755cb1f7da1727e5c4b1f817bb2ac71
[packages/python-positional.git] / python-positional.spec
1 #
2 # Conditional build:
3 %bcond_with     doc     # build doc
4 %bcond_without  tests   # do not perform "make test"
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_without  python3 # CPython 3.x module
7
8 Summary:        Library to enforce positional or key-word arguments
9 Name:           python-positional
10 Version:        1.2.1
11 Release:        2
12 License:        Apache
13 Group:          Libraries/Python
14 Source0:        https://files.pythonhosted.org/packages/source/p/positional/positional-%{version}.tar.gz
15 # Source0-md5:  4afcffd8e2ba733fd7a50f137a2ee893
16 URL:            https://pypi.python.org/pypi/positional
17 BuildRequires:  rpm-pythonprov
18 BuildRequires:  rpmbuild(macros) >= 1.714
19 %if %{with python2}
20 BuildRequires:  python-pbr
21 BuildRequires:  python-setuptools
22 %endif
23 %if %{with python3}
24 BuildRequires:  python3-pbr
25 BuildRequires:  python3-setuptools
26 %endif
27 Requires:       python-modules
28 BuildArch:      noarch
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %description
32 positional provides a decorator which enforces only some args may be
33 passed positionally. The idea and some of the code was taken from the
34 oauth2 client of the google-api client.
35
36 %package -n python3-positional
37 Summary:        Library to enforce positional or key-word arguments
38 Group:          Libraries/Python
39 Requires:       python3-modules
40
41 %description -n python3-positional
42 positional provides a decorator which enforces only some args may be
43 passed positionally. The idea and some of the code was taken from the
44 oauth2 client of the google-api client.
45
46 %prep
47 %setup -q -n positional-%{version}
48
49 %build
50 %if %{with python2}
51 %py_build %{?with_tests:test}
52 rm -rf .testrepository
53 %endif
54
55 %if %{with python3}
56 %py3_build %{?with_tests:test}
57 %endif
58
59 %if %{with doc}
60 cd doc
61 %{__make} -j1 html
62 rm -rf _build/html/_sources
63 %endif
64
65 %install
66 rm -rf $RPM_BUILD_ROOT
67
68 %if %{with python2}
69 %py_install
70
71 # when files are installed in other way that standard 'setup.py
72 # they need to be (re-)compiled
73 # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
74 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
75 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
76
77 %py_postclean
78 %endif
79
80 %if %{with python3}
81 %py3_install
82 %endif
83
84 %clean
85 rm -rf $RPM_BUILD_ROOT
86
87 %if %{with python2}
88 %files
89 %defattr(644,root,root,755)
90 %doc AUTHORS ChangeLog README.rst
91 %{py_sitescriptdir}/positional
92 %{py_sitescriptdir}/positional-%{version}-py*.egg-info
93 %endif
94
95 %if %{with python3}
96 %files -n python3-positional
97 %defattr(644,root,root,755)
98 %doc AUTHORS ChangeLog README.rst
99 %{py3_sitescriptdir}/positional
100 %{py3_sitescriptdir}/positional-%{version}-py*.egg-info
101 %endif
102
103 %if %{with doc}
104 %files apidocs
105 %defattr(644,root,root,755)
106 %doc docs/_build/html/*
107 %endif
This page took 0.070341 seconds and 2 git commands to generate.