]>
Commit | Line | Data |
---|---|---|
d127099e ER |
1 | # TODO: |
2 | # building doc requires pygit2 installed in system | |
01a65240 KK |
3 | # |
4 | # Conditional build: | |
5 | %bcond_without tests # do not perform "make test" | |
e209e12c | 6 | %bcond_without python2 # CPython 2.x module |
01a65240 | 7 | %bcond_without python3 # CPython 3.x module |
9630e8ce | 8 | %bcond_without doc # documentation |
01a65240 KK |
9 | |
10 | %define module pygit2 | |
a7da3c5d JB |
11 | Summary: Python 2.x bindings for libgit2 library |
12 | Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2 | |
01a65240 | 13 | Name: python-%{module} |
e209e12c | 14 | Version: 0.24.0 |
4dc13554 | 15 | Release: 2 |
01a65240 KK |
16 | License: GPL v2 with linking exception |
17 | Group: Libraries/Python | |
e209e12c | 18 | #Source0Download: https://pypi.python.org/simple/pygit2/ |
be2c3764 | 19 | Source0: https://pypi.python.org/packages/source/p/pygit2/%{module}-%{version}.tar.gz |
e209e12c | 20 | # Source0-md5: 05f62d21f054c1a1559a726c7fdaeff1 |
2d087e32 | 21 | Patch0: %{name}-docbuild.patch |
01a65240 | 22 | URL: https://pypi.python.org/pypi/pygit2 |
e209e12c JB |
23 | BuildRequires: libgit2-devel >= 0.24.0 |
24 | BuildRequires: rpm-pythonprov | |
25 | BuildRequires: rpmbuild(macros) >= 1.714 | |
26 | %if %{with python2} | |
e507b989 JB |
27 | BuildRequires: python-cffi |
28 | BuildRequires: python-devel >= 1:2.7 | |
067cd5ad | 29 | BuildRequires: python-setuptools |
e209e12c | 30 | %endif |
01a65240 | 31 | %if %{with python3} |
e507b989 JB |
32 | BuildRequires: python3-cffi |
33 | BuildRequires: python3-devel >= 1:3.2 | |
e507b989 | 34 | BuildRequires: python3-modules >= 1:3.2 |
067cd5ad | 35 | BuildRequires: python3-setuptools |
01a65240 | 36 | %endif |
eff4580e | 37 | %{?with_doc:BuildRequires: sphinx-pdg} |
e209e12c | 38 | Requires: libgit2 >= 0.24.0 |
e507b989 | 39 | Requires: python-cffi |
01a65240 KK |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
41 | ||
42 | %description | |
43 | pygit2 is a set of Python bindings to the libgit2 shared library. | |
44 | ||
a7da3c5d JB |
45 | %description -l pl.UTF-8 |
46 | pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2. | |
47 | ||
c6e2e8fd | 48 | %package -n python3-%{module} |
a7da3c5d JB |
49 | Summary: Python 3.x bindings for libgit2 library |
50 | Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki libgit2 | |
51 | Group: Libraries/Python | |
e209e12c | 52 | Requires: libgit2 >= 0.24.0 |
e507b989 | 53 | Requires: python3-cffi |
01a65240 KK |
54 | |
55 | %description -n python3-%{module} | |
56 | pygit2 is a set of Python bindings to the libgit2 shared library. | |
57 | ||
a7da3c5d JB |
58 | %description -n python3-%{module} -l pl.UTF-8 |
59 | pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2. | |
60 | ||
4dc13554 | 61 | %package apidocs |
e209e12c JB |
62 | Summary: pygit2 module API documentation |
63 | Summary(pl.UTF-8): Dokumentacja API modułu pygit2 | |
01a65240 | 64 | Group: Documentation |
4dc13554 ER |
65 | Obsoletes: python-pygit2-apidoc < 0.24.0-2 |
66 | %if "%{_rpmversion}" >= "5" | |
67 | BuildArch: noarch | |
68 | %endif | |
01a65240 | 69 | |
4dc13554 | 70 | %description apidocs |
e209e12c | 71 | API documentation for pygit2 module. |
01a65240 | 72 | |
4dc13554 | 73 | %description apidocs -l pl.UTF-8 |
e209e12c | 74 | Dokumentacja API modułu pygit2. |
01a65240 KK |
75 | |
76 | %prep | |
77 | %setup -q -n %{module}-%{version} | |
6a54849d | 78 | %patch0 -p1 |
01a65240 | 79 | |
be2c3764 JB |
80 | # these tests use network |
81 | %{__rm} test/test_{credentials,repository}.py | |
82 | ||
01a65240 | 83 | %build |
e209e12c | 84 | %if %{with python2} |
859cf233 | 85 | %py_build |
859cf233 | 86 | %{?with_tests:%py_build test} |
e209e12c | 87 | %endif |
01a65240 KK |
88 | |
89 | %if %{with python3} | |
d127099e ER |
90 | %py3_build |
91 | %{?with_tests:%py3_build test} | |
01a65240 KK |
92 | %endif |
93 | ||
9630e8ce | 94 | %if %{with doc} |
01a65240 | 95 | cd docs |
a7da3c5d JB |
96 | PACKAGE_BUILD=../build-2 \ |
97 | %{__make} -j1 html | |
e209e12c | 98 | %{__rm} -r _build/html/_sources |
01a65240 KK |
99 | %endif |
100 | ||
101 | %install | |
102 | rm -rf $RPM_BUILD_ROOT | |
e209e12c JB |
103 | |
104 | %if%{with python2} | |
d127099e | 105 | %py_install |
01a65240 | 106 | %py_postclean |
e209e12c | 107 | %endif |
01a65240 KK |
108 | |
109 | %if %{with python3} | |
859cf233 | 110 | %py3_install |
01a65240 KK |
111 | %endif |
112 | ||
01a65240 KK |
113 | %clean |
114 | rm -rf $RPM_BUILD_ROOT | |
115 | ||
e209e12c | 116 | %if %{with python2} |
01a65240 KK |
117 | %files |
118 | %defattr(644,root,root,755) | |
119 | %doc COPYING README.rst TODO.txt | |
f193cb9b | 120 | %dir %{py_sitedir}/pygit2 |
01a65240 | 121 | %{py_sitedir}/pygit2/*.py[co] |
f193cb9b | 122 | %{py_sitedir}/pygit2/decl.h |
067cd5ad | 123 | %attr(755,root,root) %{py_sitedir}/pygit2/_libgit2.so |
f193cb9b | 124 | %attr(755,root,root) %{py_sitedir}/_pygit2.so |
f193cb9b | 125 | %{py_sitedir}/pygit2-%{version}-py*.egg-info |
e209e12c | 126 | %endif |
01a65240 KK |
127 | |
128 | %if %{with python3} | |
129 | %files -n python3-%{module} | |
130 | %defattr(644,root,root,755) | |
131 | %doc COPYING README.rst TODO.txt | |
f193cb9b | 132 | %dir %{py3_sitedir}/pygit2 |
f193cb9b JB |
133 | %{py3_sitedir}/pygit2/decl.h |
134 | %{py3_sitedir}/pygit2/*.py | |
135 | %{py3_sitedir}/pygit2/__pycache__ | |
067cd5ad JB |
136 | %attr(755,root,root) %{py3_sitedir}/pygit2/_libgit2.cpython-*.so |
137 | %attr(755,root,root) %{py3_sitedir}/_pygit2.cpython-*.so | |
f193cb9b | 138 | %{py3_sitedir}/pygit2-%{version}-py*.egg-info |
01a65240 KK |
139 | %endif |
140 | ||
9630e8ce | 141 | %if %{with doc} |
4dc13554 | 142 | %files apidocs |
01a65240 KK |
143 | %defattr(644,root,root,755) |
144 | %doc docs/_build/html/* | |
145 | %endif |