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