]> git.pld-linux.org Git - packages/python-pygit2.git/blob - python-pygit2.spec
initial version
[packages/python-pygit2.git] / python-pygit2.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # do not perform "make test"
4 %bcond_without  python3 # CPython 3.x module
5 %bcond_without  docs    # documentation
6
7 %define         module  pygit2
8 Summary:        Python bindings for libgit2 library
9 Name:           python-%{module}
10 Version:        0.18.1
11 Release:        1
12 License:        GPL v2 with linking exception
13 Group:          Libraries/Python
14 Source0:        http://pypi.python.org/packages/source/p//pygit2/%{module}-%{version}.tar.gz
15 # Source0-md5:  8d27f84509a96d6791a6c393ae67d7c8
16 URL:            https://pypi.python.org/pypi/pygit2
17 BuildRequires:  python-devel
18 BuildRequires:  python-distribute
19 BuildRequires:  rpm-pythonprov
20 BuildRequires:  rpmbuild(macros) >= 1.219
21 %if %{with python3}
22 BuildRequires:  python3-devel
23 BuildRequires:  python3-distribute
24 BuildRequires:  python3-modules
25 %endif
26 %{?with_docs:BuildRequires:     sphinx-pdg}
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %description
30 pygit2 is a set of Python bindings to the libgit2 shared library.
31
32 %package -n     python3-%{module}
33 Summary:        Python bindings for libgit2 library
34
35 %description -n python3-%{module}
36 pygit2 is a set of Python bindings to the libgit2 shared library.
37
38
39 %package apidoc
40 Summary:        pygit2 API documentation
41 Summary(pl.UTF-8):      Dokumentacja API pygit2
42 Group:          Documentation
43
44 %description apidoc
45 API documentation for %{module}.
46
47 %description apidoc -l pl.UTF-8
48 Dokumentacja API %{module}.
49
50 %prep
51 %setup -q -n %{module}-%{version}
52
53
54 %build
55 %{__python} setup.py build --build-base build-2
56 %if %{with python3}
57 %{__python3} setup.py build --build-base build-3
58 %endif
59
60 %{?with_tests:%{__python} setup.py test}
61
62 %if %{with python3}
63 %{__python3} setup.py \
64         build -b build-3
65
66 %if %{with tests}
67 %{__python3} setup.py test
68 %endif
69 %endif
70
71 %if %{with docs}
72 cd docs
73 %{__make} -j1 html
74 rm -rf _build/html/_sources
75 %endif
76
77 %install
78 rm -rf $RPM_BUILD_ROOT
79
80 %{__python} -- setup.py \
81         build -b build-2 \
82         install \
83         --root=$RPM_BUILD_ROOT \
84         --optimize=2
85 %py_postclean
86
87 %if %{with python3}
88 %{__python3} setup.py \
89         build --build-base build-3 \
90         install \
91         --root=$RPM_BUILD_ROOT \
92         --optimize=2
93 %endif
94
95
96 # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
97 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
98 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
99 %py_postclean
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}/%{module}
108 %{py_sitedir}/pygit2/*.py[co]
109 %attr(755,root,root) %{py_sitedir}/*.so
110 %if "%{py_ver}" > "2.4"
111 %{py_sitedir}/pygit2-*.egg-info
112 %endif
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}/%{module}
119 %attr(755,root,root) %{py3_sitedir}/*.so
120 %{py3_sitedir}/%{module}/*.py
121 %{py3_sitedir}/%{module}/__pycache__
122 %{py3_sitedir}/pygit2-*.egg-info
123 %endif
124
125 %if %{with docs}
126 %files apidoc
127 %defattr(644,root,root,755)
128 %doc docs/_build/html/*
129 %endif
This page took 0.073639 seconds and 3 git commands to generate.