]> git.pld-linux.org Git - packages/python-pygit2.git/blob - python-pygit2.spec
0067d4ca35b263ac3d5bd9bd9ff1dc9a37f4a6ef
[packages/python-pygit2.git] / python-pygit2.spec
1 # TODO:
2 # building doc requires pygit2 installed in system
3 #
4 # Conditional build:
5 %bcond_without  tests   # do not perform "make test"
6 %bcond_without  python3 # CPython 3.x module
7 %bcond_without  doc     # documentation
8
9 %define         module  pygit2
10 Summary:        Python 2.x bindings for libgit2 library
11 Summary(pl.UTF-8):      Wiązania Pythona 2.x do biblioteki libgit2
12 Name:           python-%{module}
13 Version:        0.23.3
14 Release:        1
15 License:        GPL v2 with linking exception
16 Group:          Libraries/Python
17 #Source0Download: https://pypi.python.org/pypi/pygit2
18 Source0:        https://pypi.python.org/packages/source/p/pygit2/%{module}-%{version}.tar.gz
19 # Source0-md5:  1c20926ad48ce622b0087ab2bb812ae3
20 Patch0:         %{name}-docbuild.patch
21 URL:            https://pypi.python.org/pypi/pygit2
22 BuildRequires:  libgit2-devel >= 0.23.0
23 BuildRequires:  python-cffi
24 BuildRequires:  python-devel >= 1:2.7
25 BuildRequires:  python-setuptools
26 BuildRequires:  rpm-pythonprov
27 BuildRequires:  rpmbuild(macros) >= 1.714
28 %if %{with python3}
29 BuildRequires:  python3-cffi
30 BuildRequires:  python3-devel >= 1:3.2
31 BuildRequires:  python3-modules >= 1:3.2
32 BuildRequires:  python3-setuptools
33 %endif
34 %{?with_docs:BuildRequires:     sphinx-pdg}
35 Requires:       libgit2 >= 0.23.0
36 Requires:       python-cffi
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
42 %description -l pl.UTF-8
43 pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2.
44
45 %package -n python3-%{module}
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
49 Requires:       libgit2 >= 0.23.0
50 Requires:       python3-cffi
51
52 %description -n python3-%{module}
53 pygit2 is a set of Python bindings to the libgit2 shared library.
54
55 %description -n python3-%{module} -l pl.UTF-8
56 pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2.
57
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}
71 %patch0 -p1
72
73 # these tests use network
74 %{__rm} test/test_{credentials,repository}.py
75
76 %build
77 %py_build
78 %{?with_tests:%py_build test}
79
80 %if %{with python3}
81 %py3_build
82 %{?with_tests:%py3_build test}
83 %endif
84
85 %if %{with doc}
86 cd docs
87 PACKAGE_BUILD=../build-2 \
88 %{__make} -j1 html
89 rm -rf _build/html/_sources
90 %endif
91
92 %install
93 rm -rf $RPM_BUILD_ROOT
94 %py_install
95 %py_postclean
96
97 %if %{with python3}
98 %py3_install
99 %endif
100
101 %clean
102 rm -rf $RPM_BUILD_ROOT
103
104 %files
105 %defattr(644,root,root,755)
106 %doc COPYING README.rst TODO.txt
107 %dir %{py_sitedir}/pygit2
108 %{py_sitedir}/pygit2/*.py[co]
109 %{py_sitedir}/pygit2/decl.h
110 %attr(755,root,root) %{py_sitedir}/pygit2/_libgit2.so
111 %attr(755,root,root) %{py_sitedir}/_pygit2.so
112 %{py_sitedir}/pygit2-%{version}-py*.egg-info
113
114 %if %{with python3}
115 %files -n python3-%{module}
116 %defattr(644,root,root,755)
117 %doc COPYING README.rst TODO.txt
118 %dir %{py3_sitedir}/pygit2
119 %{py3_sitedir}/pygit2/decl.h
120 %{py3_sitedir}/pygit2/*.py
121 %{py3_sitedir}/pygit2/__pycache__
122 %attr(755,root,root) %{py3_sitedir}/pygit2/_libgit2.cpython-*.so
123 %attr(755,root,root) %{py3_sitedir}/_pygit2.cpython-*.so
124 %{py3_sitedir}/pygit2-%{version}-py*.egg-info
125 %endif
126
127 %if %{with doc}
128 %files apidoc
129 %defattr(644,root,root,755)
130 %doc docs/_build/html/*
131 %endif
This page took 0.110292 seconds and 2 git commands to generate.