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