]>
Commit | Line | Data |
---|---|---|
1d1c7ca8 JB |
1 | # |
2 | # Conditional build: | |
1828b137 | 3 | %bcond_with tests # unit tests (not included in pypi release) |
1d1c7ca8 | 4 | %bcond_without python2 # CPython 2.x module |
63643dc5 | 5 | %bcond_with python3 # CPython 3.x module (built from python3-pkgconfig.spec) |
1d1c7ca8 JB |
6 | |
7 | Summary: Python 2 interface to pkg-config | |
8 | Summary(pl.UTF-8): Interfejs Pythona 2 do narzędzia pkg-config | |
9 | Name: python-pkgconfig | |
d54e3691 JB |
10 | # keep 1.5.2 here for python2 support |
11 | # (oficial support dropped in 1.5.4, but 1.5.3 has syntax errors under python2) | |
12 | Version: 1.5.2 | |
c1321778 | 13 | Release: 4 |
1d1c7ca8 JB |
14 | License: MIT |
15 | Group: Libraries/Python | |
1828b137 | 16 | #Source0Download: https://pypi.org/simple/pkgconfig/ |
1d1c7ca8 | 17 | Source0: https://files.pythonhosted.org/packages/source/p/pkgconfig/pkgconfig-%{version}.tar.gz |
d54e3691 | 18 | # Source0-md5: 0d889edf670b644bfeaa3bb9444169cb |
1828b137 | 19 | URL: https://github.com/matze/pkgconfig |
1d1c7ca8 | 20 | %if %{with python2} |
1828b137 | 21 | BuildRequires: python-modules >= 1:2.7 |
1d1c7ca8 | 22 | BuildRequires: python-setuptools |
1828b137 JB |
23 | %if %{with tests} |
24 | BuildRequires: python-pytest >= 3.8.2 | |
25 | %endif | |
1d1c7ca8 JB |
26 | %endif |
27 | %if %{with python3} | |
1828b137 | 28 | BuildRequires: python3-modules >= 1:3.3 |
1d1c7ca8 | 29 | BuildRequires: python3-setuptools |
1828b137 JB |
30 | %if %{with tests} |
31 | BuildRequires: python3-pytest >= 3.8.2 | |
32 | %endif | |
1d1c7ca8 JB |
33 | %endif |
34 | BuildRequires: rpm-pythonprov | |
35 | BuildRequires: rpmbuild(macros) >= 1.714 | |
1828b137 | 36 | Requires: python-modules >= 1:2.7 |
1d1c7ca8 JB |
37 | BuildArch: noarch |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
39 | ||
40 | %description | |
41 | pkgconfig is a Python module to interface with the pkg-config command | |
42 | line tool. | |
43 | ||
44 | %description -l pl.UTF-8 | |
45 | pkgconfig to moduł Pythona do współpracy z narzędziem linii poleceń | |
46 | pkg-config. | |
47 | ||
48 | %package -n python3-pkgconfig | |
49 | Summary: Python 3 interface to pkg-config | |
50 | Summary(pl.UTF-8): Interfejs Pythona 3 do narzędzia pkg-config | |
51 | Group: Libraries/Python | |
1828b137 | 52 | Requires: python3-modules >= 1:3.3 |
1d1c7ca8 JB |
53 | |
54 | %description -n python3-pkgconfig | |
55 | pkgconfig is a Python module to interface with the pkg-config command | |
56 | line tool. | |
57 | ||
58 | %description -n python3-pkgconfig -l pl.UTF-8 | |
59 | pkgconfig to moduł Pythona do współpracy z narzędziem linii poleceń | |
60 | pkg-config. | |
61 | ||
62 | %prep | |
63 | %setup -q -n pkgconfig-%{version} | |
64 | ||
65 | %build | |
66 | %if %{with python2} | |
67 | %py_build | |
68 | ||
1828b137 | 69 | %{?with_tests:%{__python} -m pytest test_pkgconfig.py} |
1d1c7ca8 JB |
70 | %endif |
71 | ||
72 | %if %{with python3} | |
73 | %py3_build | |
74 | ||
1828b137 | 75 | %{?with_tests:%{__python3} -m pytest test_pkgconfig.py} |
1d1c7ca8 JB |
76 | %endif |
77 | ||
78 | %install | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | ||
81 | %if %{with python2} | |
82 | %py_install | |
83 | ||
84 | %py_postclean | |
85 | %endif | |
86 | ||
87 | %if %{with python3} | |
88 | %py3_install | |
89 | %endif | |
90 | ||
91 | %clean | |
92 | rm -rf $RPM_BUILD_ROOT | |
93 | ||
94 | %if %{with python2} | |
95 | %files | |
96 | %defattr(644,root,root,755) | |
97 | %doc LICENSE README.rst | |
98 | %{py_sitescriptdir}/pkgconfig | |
99 | %{py_sitescriptdir}/pkgconfig-%{version}-py*.egg-info | |
100 | %endif | |
101 | ||
102 | %if %{with python3} | |
103 | %files -n python3-pkgconfig | |
104 | %defattr(644,root,root,755) | |
105 | %doc LICENSE README.rst | |
106 | %{py3_sitescriptdir}/pkgconfig | |
107 | %{py3_sitescriptdir}/pkgconfig-%{version}-py*.egg-info | |
108 | %endif |