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