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