]> git.pld-linux.org Git - packages/python-pygit2.git/blame - python-pygit2.spec
unify apidocs package name, build noarch
[packages/python-pygit2.git] / python-pygit2.spec
CommitLineData
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
11Summary: Python 2.x bindings for libgit2 library
12Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libgit2
01a65240 13Name: python-%{module}
e209e12c 14Version: 0.24.0
4dc13554 15Release: 2
01a65240
KK
16License: GPL v2 with linking exception
17Group: Libraries/Python
e209e12c 18#Source0Download: https://pypi.python.org/simple/pygit2/
be2c3764 19Source0: https://pypi.python.org/packages/source/p/pygit2/%{module}-%{version}.tar.gz
e209e12c 20# Source0-md5: 05f62d21f054c1a1559a726c7fdaeff1
2d087e32 21Patch0: %{name}-docbuild.patch
01a65240 22URL: https://pypi.python.org/pypi/pygit2
e209e12c
JB
23BuildRequires: libgit2-devel >= 0.24.0
24BuildRequires: rpm-pythonprov
25BuildRequires: rpmbuild(macros) >= 1.714
26%if %{with python2}
e507b989
JB
27BuildRequires: python-cffi
28BuildRequires: python-devel >= 1:2.7
067cd5ad 29BuildRequires: python-setuptools
e209e12c 30%endif
01a65240 31%if %{with python3}
e507b989
JB
32BuildRequires: python3-cffi
33BuildRequires: python3-devel >= 1:3.2
e507b989 34BuildRequires: python3-modules >= 1:3.2
067cd5ad 35BuildRequires: python3-setuptools
01a65240 36%endif
eff4580e 37%{?with_doc:BuildRequires: sphinx-pdg}
e209e12c 38Requires: libgit2 >= 0.24.0
e507b989 39Requires: python-cffi
01a65240
KK
40BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42%description
43pygit2 is a set of Python bindings to the libgit2 shared library.
44
a7da3c5d
JB
45%description -l pl.UTF-8
46pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2.
47
c6e2e8fd 48%package -n python3-%{module}
a7da3c5d
JB
49Summary: Python 3.x bindings for libgit2 library
50Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki libgit2
51Group: Libraries/Python
e209e12c 52Requires: libgit2 >= 0.24.0
e507b989 53Requires: python3-cffi
01a65240
KK
54
55%description -n python3-%{module}
56pygit2 is a set of Python bindings to the libgit2 shared library.
57
a7da3c5d
JB
58%description -n python3-%{module} -l pl.UTF-8
59pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2.
60
4dc13554 61%package apidocs
e209e12c
JB
62Summary: pygit2 module API documentation
63Summary(pl.UTF-8): Dokumentacja API modułu pygit2
01a65240 64Group: Documentation
4dc13554
ER
65Obsoletes: python-pygit2-apidoc < 0.24.0-2
66%if "%{_rpmversion}" >= "5"
67BuildArch: noarch
68%endif
01a65240 69
4dc13554 70%description apidocs
e209e12c 71API documentation for pygit2 module.
01a65240 72
4dc13554 73%description apidocs -l pl.UTF-8
e209e12c 74Dokumentacja 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 95cd docs
a7da3c5d
JB
96PACKAGE_BUILD=../build-2 \
97%{__make} -j1 html
e209e12c 98%{__rm} -r _build/html/_sources
01a65240
KK
99%endif
100
101%install
102rm -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
114rm -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
This page took 0.097726 seconds and 4 git commands to generate.