forked from pld-linux/python-pygit2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython-pygit2.spec
More file actions
128 lines (107 loc) · 2.86 KB
/
python-pygit2.spec
File metadata and controls
128 lines (107 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#
# Conditional build:
%bcond_without tests # do not perform "make test"
%bcond_without python3 # CPython 3.x module
%bcond_without docs # documentation
%define module pygit2
Summary: Python bindings for libgit2 library
Name: python-%{module}
Version: 0.20.0
Release: 1
License: GPL v2 with linking exception
Group: Libraries/Python
Source0: http://pypi.python.org/packages/source/p//pygit2/%{module}-%{version}.tar.gz
# Source0-md5: e4b42ad3abde5f5c9911bf1e4278d69a
Patch0: %{name}-docbuild.patch
URL: https://pypi.python.org/pypi/pygit2
BuildRequires: libgit2-devel >= 0.19.0
BuildRequires: python-devel
BuildRequires: python-distribute
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.219
%if %{with python3}
BuildRequires: python3-devel
BuildRequires: python3-distribute
BuildRequires: python3-modules
%endif
%{?with_docs:BuildRequires: sphinx-pdg}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
pygit2 is a set of Python bindings to the libgit2 shared library.
%package -n python3-%{module}
Summary: Python bindings for libgit2 library
%description -n python3-%{module}
pygit2 is a set of Python bindings to the libgit2 shared library.
%package apidoc
Summary: pygit2 API documentation
Summary(pl.UTF-8): Dokumentacja API pygit2
Group: Documentation
%description apidoc
API documentation for %{module}.
%description apidoc -l pl.UTF-8
Dokumentacja API %{module}.
%prep
%setup -q -n %{module}-%{version}
%patch0 -p0
%build
%{__python} setup.py build --build-base build-2
%if %{with python3}
%{__python3} setup.py build --build-base build-3
%endif
%{?with_tests:%{__python} setup.py build -b build-2 test}
%if %{with python3}
%{__python3} setup.py \
build -b build-3
%if %{with tests}
%{__python3} setup.py build -b build-3 test
%endif
%endif
%if %{with docs}
cd docs
PACKAGE_BUILD=../build-2 %{__make} -j1 html
rm -rf _build/html/_sources
%endif
%install
rm -rf $RPM_BUILD_ROOT
%{__python} -- setup.py \
build -b build-2 \
install \
--root=$RPM_BUILD_ROOT \
--optimize=2
%py_postclean
%if %{with python3}
%{__python3} setup.py \
build --build-base build-3 \
install \
--root=$RPM_BUILD_ROOT \
--optimize=2
%endif
%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
%py_comp $RPM_BUILD_ROOT%{py_sitedir}
%py_postclean
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc COPYING README.rst TODO.txt
%dir %{py_sitedir}/%{module}
%{py_sitedir}/pygit2/*.py[co]
%attr(755,root,root) %{py_sitedir}/*.so
%if "%{py_ver}" > "2.4"
%{py_sitedir}/pygit2-*.egg-info
%endif
%if %{with python3}
%files -n python3-%{module}
%defattr(644,root,root,755)
%doc COPYING README.rst TODO.txt
%dir %{py3_sitedir}/%{module}
%attr(755,root,root) %{py3_sitedir}/*.so
%{py3_sitedir}/%{module}/*.py
%{py3_sitedir}/%{module}/__pycache__
%{py3_sitedir}/pygit2-*.egg-info
%endif
%if %{with docs}
%files apidoc
%defattr(644,root,root,755)
%doc docs/_build/html/*
%endif