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