]>
Commit | Line | Data |
---|---|---|
b3591a76 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without apidocs # do not build and package API docs | |
3a50a18e JK |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
f8d47da0 | 6 | |
b3591a76 JB |
7 | Summary: Library for downloading Linux repository metadata and packages |
8 | Summary(pl.UTF-8): Biblioteka do pobierania metadanych repozytoriów roaz pakietów dla Linuksa | |
9 | Name: librepo | |
5ebce502 | 10 | Version: 1.7.17 |
5b7272ed | 11 | Release: 2 |
b3591a76 JB |
12 | License: GPL v2+ |
13 | Group: Libraries | |
5ebce502 JB |
14 | #Source0Download: https://github.com/rpm-software-management/librepo/releases |
15 | Source0: https://github.com/rpm-software-management/librepo/archive/%{name}-%{version}.tar.gz | |
16 | # Source0-md5: 8e3b23e44aab8cd516d2b05d62f6f559 | |
73a14cac | 17 | #Source0: http://pkgs.fedoraproject.org/repo/pkgs/librepo/%{name}-%{gitrev}.tar.xz/904628ef27b512e7aed07a6d41613c87/librepo-%{gitrev}.tar.xz |
b3591a76 | 18 | Patch0: %{name}-link.patch |
3a50a18e JK |
19 | Patch1: python-install-dir.patch |
20 | Patch2: sphinx_executable.patch | |
5ebce502 | 21 | URL: http://rpm-software-management.github.io/librepo/ |
b3591a76 JB |
22 | BuildRequires: attr-devel |
23 | BuildRequires: check-devel | |
24 | BuildRequires: cmake >= 2.6 | |
25 | BuildRequires: curl-devel | |
26 | %{?with_apidocs:BuildRequires: doxygen} | |
f8d47da0 | 27 | BuildRequires: expat-devel >= 1.95 |
b3591a76 JB |
28 | BuildRequires: glib2-devel >= 2.0 |
29 | BuildRequires: gpgme-devel | |
b3591a76 | 30 | BuildRequires: openssl-devel |
b3591a76 | 31 | BuildRequires: rpmbuild(macros) >= 1.605 |
3a50a18e JK |
32 | %if %{with python2} |
33 | BuildRequires: python-devel >= 1:2 | |
34 | %{?with_apidocs:BuildRequires: sphinx-pdg-2} | |
35 | %endif | |
36 | %if %{with python3} | |
37 | BuildRequires: python3-devel >= 1:3 | |
38 | %{?with_apidocs:BuildRequires: sphinx-pdg-3} | |
39 | %endif | |
b3591a76 JB |
40 | BuildRequires: tar >= 1:1.22 |
41 | BuildRequires: xz | |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
43 | ||
44 | %description | |
45 | A library providing C and Python (libcURL like) API for downloading | |
46 | Linux repository metadata and packages. | |
47 | ||
48 | %description -l pl.UTF-8 | |
49 | Biblioteka udostępniająca API C i Pythona (podobne do libcURL) służące | |
50 | do pobierania metadanych repozytoriów oraz pakietów dla Linuksa. | |
51 | ||
52 | %package devel | |
53 | Summary: Header files for librepo library | |
54 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki librepo | |
55 | Group: Development/Libraries | |
56 | Requires: %{name} = %{version}-%{release} | |
57 | Requires: curl-devel | |
58 | Requires: expat-devel >= 1.95 | |
59 | Requires: glib2-devel >= 2.0 | |
60 | Requires: gpgme-devel | |
61 | Requires: openssl-devel | |
62 | ||
63 | %description devel | |
64 | Header files for librepo library. | |
65 | ||
66 | %description devel -l pl.UTF-8 | |
67 | Pliki nagłówkowe biblioteki librepo. | |
68 | ||
69 | %package apidocs | |
70 | Summary: API documentation for librepo library | |
71 | Summary(pl.UTF-8): Dokumentacja API biblioteki librepo | |
72 | Group: Documentation | |
5b7272ed ER |
73 | %if "%{_rpmversion}" >= "5" |
74 | BuildArch: noarch | |
75 | %endif | |
b3591a76 JB |
76 | |
77 | %description apidocs | |
78 | API documentation for librepo library. | |
79 | ||
80 | %description apidocs -l pl.UTF-8 | |
81 | Dokumentacja API biblioteki librepo. | |
82 | ||
83 | %package -n python-librepo | |
4aef9171 JB |
84 | Summary: Python 2 binding for librepo library |
85 | Summary(pl.UTF-8): Wiązanie Pythona 2 do biblioteki librepo | |
b3591a76 JB |
86 | Group: Libraries/Python |
87 | Requires: %{name} = %{version}-%{release} | |
88 | ||
89 | %description -n python-librepo | |
4aef9171 | 90 | Python 2 binding for librepo library. |
b3591a76 JB |
91 | |
92 | %description -n python-librepo -l pl.UTF-8 | |
4aef9171 | 93 | Wiązanie Pythona 2 do biblioteki librepo. |
b3591a76 | 94 | |
3a50a18e | 95 | %package -n python3-librepo |
4aef9171 JB |
96 | Summary: Python 3 binding for librepo library |
97 | Summary(pl.UTF-8): Wiązanie Pythona 3 do biblioteki librepo | |
3a50a18e JK |
98 | Group: Libraries/Python |
99 | Requires: %{name} = %{version}-%{release} | |
100 | ||
101 | %description -n python3-librepo | |
4aef9171 | 102 | Python 3 binding for librepo library. |
3a50a18e JK |
103 | |
104 | %description -n python3-librepo -l pl.UTF-8 | |
4aef9171 | 105 | Wiązanie Pythona 3 do biblioteki librepo. |
3a50a18e | 106 | |
b3591a76 | 107 | %prep |
73a14cac | 108 | %setup -q -n %{name}-%{name}-%{version} |
b3591a76 | 109 | %patch0 -p1 |
3a50a18e JK |
110 | %patch1 -p1 |
111 | %patch2 -p1 | |
b3591a76 JB |
112 | |
113 | %build | |
114 | install -d build | |
115 | cd build | |
3a50a18e JK |
116 | %cmake .. \ |
117 | %if %{with python2} | |
118 | -DPYTHON_DESIRED=2 \ | |
119 | -DPYTHON_INSTALL_DIR="%{py_sitedir}" \ | |
120 | -DSPHINX_EXECUTABLE=/usr/bin/sphinx-build-2 | |
121 | %endif | |
b3591a76 JB |
122 | |
123 | %{__make} | |
124 | ||
125 | %if %{with apidocs} | |
126 | %{__make} doc | |
127 | %endif | |
3a50a18e JK |
128 | cd .. |
129 | ||
130 | %if %{with python3} | |
131 | install -d build-py3 | |
132 | cd build-py3 | |
133 | %cmake .. \ | |
134 | -DPYTHON_DESIRED=3 \ | |
135 | -DPYTHON_INSTALL_DIR="%{py3_sitedir}" \ | |
136 | -DSPHINX_EXECUTABLE=/usr/bin/sphinx-build-3 | |
137 | ||
138 | %{__make} | |
139 | ||
140 | %if %{with apidocs} | |
141 | %{__make} doc | |
142 | %endif | |
143 | cd .. | |
144 | %endif | |
b3591a76 JB |
145 | |
146 | %install | |
147 | rm -rf $RPM_BUILD_ROOT | |
148 | ||
149 | %{__make} -C build install \ | |
150 | DESTDIR=$RPM_BUILD_ROOT | |
151 | ||
3a50a18e JK |
152 | %if %{with python3} |
153 | %{__make} -C build-py3 install \ | |
154 | DESTDIR=$RPM_BUILD_ROOT | |
155 | %endif | |
156 | ||
b3591a76 JB |
157 | %py_comp $RPM_BUILD_ROOT%{py_sitedir}/librepo |
158 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/librepo | |
159 | %py_postclean | |
160 | ||
161 | %clean | |
162 | rm -rf $RPM_BUILD_ROOT | |
163 | ||
164 | %post -p /sbin/ldconfig | |
165 | %postun -p /sbin/ldconfig | |
166 | ||
167 | %files | |
168 | %defattr(644,root,root,755) | |
169 | %doc README.md | |
170 | %attr(755,root,root) %{_libdir}/librepo.so.0 | |
171 | ||
172 | %files devel | |
173 | %defattr(644,root,root,755) | |
174 | %attr(755,root,root) %{_libdir}/librepo.so | |
175 | %{_includedir}/librepo | |
176 | %{_pkgconfigdir}/librepo.pc | |
177 | ||
178 | %if %{with apidocs} | |
179 | %files apidocs | |
180 | %defattr(644,root,root,755) | |
181 | %doc build/doc/c/html/* | |
182 | %endif | |
183 | ||
3a50a18e | 184 | %if %{with python2} |
b3591a76 JB |
185 | %files -n python-librepo |
186 | %defattr(644,root,root,755) | |
187 | %if %{with apidocs} | |
188 | %doc build/doc/python/{*.html,_sources,_static} | |
189 | %endif | |
190 | %dir %{py_sitedir}/librepo | |
191 | %attr(755,root,root) %{py_sitedir}/librepo/_librepomodule.so | |
192 | %{py_sitedir}/librepo/__init__.py[co] | |
3a50a18e JK |
193 | %endif |
194 | ||
195 | %if %{with python3} | |
196 | %files -n python3-librepo | |
197 | %defattr(644,root,root,755) | |
198 | %if %{with apidocs} | |
199 | %doc build-py3/doc/python/{*.html,_sources,_static} | |
200 | %endif | |
201 | %dir %{py3_sitedir}/librepo | |
202 | %attr(755,root,root) %{py3_sitedir}/librepo/_librepo.so | |
203 | %{py3_sitedir}/librepo/__init__.py | |
204 | %endif |