]>
Commit | Line | Data |
---|---|---|
269ac505 MK |
1 | # |
2 | # This is template for pure python modules (noarch) | |
3 | # use template-specs/python-ext.spec for binary python packages | |
4 | # | |
5 | # | |
6 | # Conditional build: | |
7 | # %%bcond_with doc # don't build doc | |
8 | %bcond_without tests # do not perform "make test" | |
9 | %bcond_without python2 # CPython 2.x module | |
10 | %bcond_without python3 # CPython 3.x module | |
11 | ||
12 | # NOTE: 'module' should match the python import path, not the egg name | |
13 | %define module shortuuid | |
14 | Summary: Generator library for concise, unambiguous and URL-safe UUIDs | |
15 | Summary(pl.UTF-8): Biblioteka generacji jednoznacznych UUIDów dla URLi | |
16 | # Name must match the python module/package name (as on pypi or in 'import' statement) | |
17 | Name: python-%{module} | |
18 | Version: 0.4.3 | |
19 | Release: 1 | |
20 | License: BSD | |
21 | Group: Libraries/Python | |
22 | Source0: https://pypi.python.org/packages/e9/41/d867be1470af87dd8af1b3462e5eae44f78ffd33cec54630d40ca6b2d0bd/shortuuid-%{version}.tar.gz | |
23 | # Source0-md5: 4f70db8174c0b7b8cad36de48b529947 | |
24 | URL: https://github.com/stochastic-technologies/shortuuid/ | |
25 | BuildRequires: rpm-pythonprov | |
26 | BuildRequires: rpmbuild(macros) >= 1.714 | |
27 | %if %{with python2} | |
28 | BuildRequires: python-modules | |
29 | BuildRequires: python-pep8 | |
30 | %endif | |
31 | %if %{with python3} | |
32 | BuildRequires: python3-modules | |
33 | BuildRequires: python3-pep8 | |
34 | %endif | |
35 | Requires: python-modules | |
36 | BuildArch: noarch | |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
38 | ||
39 | %description | |
40 | Library that generates short, pretty, unambiguous unique IDs by using | |
41 | an extensive, case-sensitive alphabet and omitting similar-looking | |
42 | letters and numbers. | |
43 | ||
44 | %description -l pl.UTF-8 | |
45 | Biblioteka która generuje krótkie, ładne, jednoznaczne i unikalne IDy | |
46 | używając obszernego, uwzlgedniającego wielkość liter alfabetu i | |
47 | omijając podbone znaki i liczby. | |
48 | ||
49 | %package -n python3-%{module} | |
50 | Summary: Generator library for concise, unambiguous and URL-safe UUIDs | |
51 | Summary(pl.UTF-8): Biblioteka generacji jednoznacznych UUIDów dla URLi | |
52 | Group: Libraries/Python | |
53 | Requires: python3-modules | |
54 | ||
55 | %description -n python3-%{module} | |
56 | Library that generates short, pretty, unambiguous unique IDs by using | |
57 | an extensive, case-sensitive alphabet and omitting similar-looking | |
58 | letters and numbers. | |
59 | ||
60 | %description -n python3-%{module} -l pl.UTF-8 | |
61 | Biblioteka która generuje krótkie, ładne, jednoznaczne i unikalne IDy | |
62 | używając obszernego, uwzlgedniającego wielkość liter alfabetu i | |
63 | omijając podbone znaki i liczby. | |
64 | ||
65 | %package apidocs | |
66 | Summary: %{module} API documentation | |
67 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
68 | Group: Documentation | |
69 | ||
70 | %description apidocs | |
71 | API documentation for %{module}. | |
72 | ||
73 | %description apidocs -l pl.UTF-8 | |
74 | Dokumentacja API %{module}. | |
75 | ||
76 | %prep | |
77 | %setup -q -n %{module}-%{version} | |
78 | ||
79 | %build | |
80 | %if %{with python2} | |
81 | %py_build %{?with_tests:test} | |
82 | %endif | |
83 | ||
84 | %if %{with python3} | |
85 | %py3_build %{?with_tests:test} | |
86 | %endif | |
87 | ||
88 | %if %{with doc} | |
89 | cd docs | |
90 | %{__make} -j1 html | |
91 | rm -rf _build/html/_sources | |
92 | %endif | |
93 | ||
94 | %install | |
95 | rm -rf $RPM_BUILD_ROOT | |
96 | ||
97 | %if %{with python2} | |
98 | %py_install | |
99 | ||
100 | %py_postclean | |
101 | %endif | |
102 | ||
103 | %if %{with python3} | |
104 | %py3_install | |
105 | %endif | |
106 | ||
107 | %clean | |
108 | rm -rf $RPM_BUILD_ROOT | |
109 | ||
110 | %if %{with python2} | |
111 | %files | |
112 | %defattr(644,root,root,755) | |
113 | %doc README.rst | |
114 | %{py_sitescriptdir}/%{module} | |
115 | %if "%{py_ver}" > "2.4" | |
116 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
117 | %endif | |
118 | %endif | |
119 | ||
120 | %if %{with python3} | |
121 | %files -n python3-%{module} | |
122 | %defattr(644,root,root,755) | |
123 | %doc README.rst | |
124 | %{py3_sitescriptdir}/%{module} | |
125 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
126 | %endif | |
127 | ||
128 | %if %{with doc} | |
129 | %files apidocs | |
130 | %defattr(644,root,root,755) | |
131 | %doc docs/_build/html/* | |
132 | %endif |