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