]> git.pld-linux.org Git - packages/python-pygit2.git/blob - python-pygit2.spec
1d5959339c89314299892c1fbdff822aa4a12c55
[packages/python-pygit2.git] / python-pygit2.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5 %bcond_without  doc     # documentation
6 %bcond_with     tests   # unit tests
7
8 %define         module          pygit2
9 %define         egg_name        pygit2
10 %define         pypi_name       pygit2
11 Summary:        Python 2.x bindings for libgit2 library
12 Summary(pl.UTF-8):      Wiązania Pythona 2.x do biblioteki libgit2
13 Name:           python-%{module}
14 Version:        0.28.2
15 Release:        2
16 License:        GPL v2 with linking exception
17 Group:          Libraries/Python
18 #Source0Download: https://pypi.org/simple/pygit2/
19 Source0:        https://files.pythonhosted.org/packages/source/p/pygit2/%{pypi_name}-%{version}.tar.gz
20 # Source0-md5:  e5fad67c46e2ebf3391cb9650684923d
21 Patch0:         %{name}-docbuild.patch
22 URL:            https://pypi.org/project/pygit2/
23 BuildRequires:  libgit2-devel >= 0.27.0
24 BuildRequires:  rpm-pythonprov
25 BuildRequires:  rpmbuild(macros) >= 1.714
26 %if %{with python2}
27 BuildRequires:  python-cffi >= 1.8.1
28 BuildRequires:  python-devel >= 1:2.7
29 BuildRequires:  python-setuptools
30 %if %{with tests}
31 BuildRequires:  python-pytest
32 %endif
33 %endif
34 %if %{with python3}
35 BuildRequires:  python3-cffi >= 1.8.1
36 BuildRequires:  python3-devel >= 1:3.2
37 BuildRequires:  python3-modules >= 1:3.2
38 BuildRequires:  python3-setuptools
39 %if %{with tests}
40 BuildRequires:  python3-pytest
41 %endif
42 %endif
43 %{?with_doc:BuildRequires:     sphinx-pdg-3}
44 Requires:       libgit2 >= 0.24.0
45 Requires:       python-cffi
46 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48 %description
49 pygit2 is a set of Python bindings to the libgit2 shared library.
50
51 %description -l pl.UTF-8
52 pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2.
53
54 %package -n python3-%{module}
55 Summary:        Python 3.x bindings for libgit2 library
56 Summary(pl.UTF-8):      Wiązania Pythona 3.x do biblioteki libgit2
57 Group:          Libraries/Python
58 Requires:       libgit2 >= 0.24.0
59 Requires:       python3-cffi
60
61 %description -n python3-%{module}
62 pygit2 is a set of Python bindings to the libgit2 shared library.
63
64 %description -n python3-%{module} -l pl.UTF-8
65 pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2.
66
67 %package apidocs
68 Summary:        pygit2 module API documentation
69 Summary(pl.UTF-8):      Dokumentacja API modułu pygit2
70 Group:          Documentation
71 Obsoletes:      python-pygit2-apidoc < 0.24.0-2
72 %if "%{_rpmversion}" >= "5"
73 BuildArch:      noarch
74 %endif
75
76 %description apidocs
77 API documentation for pygit2 module.
78
79 %description apidocs -l pl.UTF-8
80 Dokumentacja API modułu pygit2.
81
82 %prep
83 %setup -q -n %{module}-%{version}
84 %patch0 -p1
85
86 %build
87 %if %{with python2}
88 %py_build
89
90 %{?with_tests:PYTHONPATH=$(echo $(pwd)/build-2/lib.*) %{__python} -m pytest test}
91 %endif
92
93 %if %{with python3}
94 %py3_build
95
96 %{?with_tests:PYTHONPATH=$(echo $(pwd)/build-3/lib.*) %{__python3} -m pytest test}
97 %endif
98
99 %if %{with doc}
100 PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \
101 %{__make} -C docs -j1 html \
102         SPHINXBUILD=sphinx-build-3
103 %endif
104
105 %install
106 rm -rf $RPM_BUILD_ROOT
107
108 %if%{with python2}
109 %py_install
110
111 %py_postclean
112 %endif
113
114 %if %{with python3}
115 %py3_install
116 %endif
117
118 %clean
119 rm -rf $RPM_BUILD_ROOT
120
121 %if %{with python2}
122 %files
123 %defattr(644,root,root,755)
124 %doc COPYING README.rst TODO.txt
125 %dir %{py_sitedir}/pygit2
126 %{py_sitedir}/pygit2/*.py[co]
127 %{py_sitedir}/pygit2/decl
128 %attr(755,root,root) %{py_sitedir}/pygit2/_libgit2.so
129 %attr(755,root,root) %{py_sitedir}/_pygit2.so
130 %{py_sitedir}/pygit2-%{version}-py*.egg-info
131 %endif
132
133 %if %{with python3}
134 %files -n python3-%{module}
135 %defattr(644,root,root,755)
136 %doc COPYING README.rst TODO.txt
137 %dir %{py3_sitedir}/pygit2
138 %{py3_sitedir}/pygit2/decl
139 %{py3_sitedir}/pygit2/*.py
140 %{py3_sitedir}/pygit2/__pycache__
141 %attr(755,root,root) %{py3_sitedir}/pygit2/_libgit2.abi3.so
142 %attr(755,root,root) %{py3_sitedir}/_pygit2.cpython-*.so
143 %{py3_sitedir}/pygit2-%{version}-py*.egg-info
144 %endif
145
146 %if %{with doc}
147 %files apidocs
148 %defattr(644,root,root,755)
149 %doc docs/_build/html/{_static,recipes,*.html,*.js}
150 %endif
This page took 0.039401 seconds and 2 git commands to generate.