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