]> git.pld-linux.org Git - packages/AppStream.git/blob - AppStream.spec
- allow building without systemd
[packages/AppStream.git] / AppStream.spec
1 #
2 # Conditional build:
3 %bcond_without  apidocs         # API documentation
4 %bcond_with     apt             # Debian/APT support
5 %bcond_without  compose         # appstream-compose library
6 %bcond_without  qt              # Qt libraries (any)
7 %bcond_without  qt5             # Qt5 library (libAppStreamQt5)
8 %bcond_without  qt6             # Qt6 library (libAppStreamQt)
9 %bcond_without  static_libs     # static libraries
10 %bcond_without  systemd         # systemd
11 %bcond_without  vala            # Vala API (VAPI)
12
13 %if %{without qt}
14 %undefine       with_qt5
15 %undefine       with_qt6
16 %endif
17 Summary:        AppStream-Core library and tools
18 Summary(pl.UTF-8):      Biblioteka i narzędzia AppStream-Core
19 Name:           AppStream
20 Version:        1.0.2
21 Release:        3
22 License:        LGPL v2.1+
23 Group:          Libraries
24 Source0:        https://www.freedesktop.org/software/appstream/releases/%{name}-%{version}.tar.xz
25 # Source0-md5:  00e749276887f816b6d68a7a150e6c97
26 URL:            https://www.freedesktop.org/wiki/Distributions/AppStream/
27 BuildRequires:  curl-devel >= 7.62
28 %{?with_apidocs:BuildRequires:  daps}
29 BuildRequires:  docbook-style-xsl-nons
30 BuildRequires:  gettext-tools
31 %{?with_apidocs:BuildRequires:  gi-docgen}
32 BuildRequires:  glib2-devel >= 1:2.62
33 BuildRequires:  gobject-introspection-devel >= 1.56
34 BuildRequires:  gperf
35 %{?with_apidocs:BuildRequires:  gtk-doc}
36 BuildRequires:  itstool
37 BuildRequires:  libstdc++-devel >= 6:5
38 BuildRequires:  libstemmer-devel
39 BuildRequires:  libxml2-devel >= 2.0
40 BuildRequires:  libxmlb-devel >= 0.3.14
41 BuildRequires:  libxslt-progs
42 # with .pc file
43 BuildRequires:  lmdb-devel >= 0.9.24-1
44 BuildRequires:  meson >= 0.62
45 BuildRequires:  ninja >= 1.5
46 BuildRequires:  pkgconfig
47 BuildRequires:  python3 >= 1:3
48 BuildRequires:  rpm-build >= 4.6
49 BuildRequires:  rpmbuild(macros) >= 1.750
50 BuildRequires:  sed >= 4
51 %{?with_systemd:BuildRequires:  systemd-devel >= 1:209}
52 BuildRequires:  tar >= 1:1.22
53 %{?with_vala:BuildRequires:     vala}
54 BuildRequires:  xmlto
55 BuildRequires:  xz
56 BuildRequires:  yaml-devel >= 0.1
57 BuildRequires:  zstd-devel
58 %if %{with qt5}
59 BuildRequires:  Qt5Core-devel >= 5.15
60 BuildRequires:  Qt5Test-devel >= 5.15
61 BuildRequires:  qt5-build >= 5.15
62 BuildRequires:  qt5-qmake >= 5.15
63 %endif
64 %if %{with qt6}
65 BuildRequires:  Qt6Core-devel >= 6.2.4
66 BuildRequires:  Qt6Test-devel >= 6.2.4
67 BuildRequires:  qt6-build >= 6.2.4
68 BuildRequires:  qt6-qmake >= 6.2.4
69 %endif
70 %if %{with compose}
71 BuildRequires:  cairo-devel >= 1.12
72 BuildRequires:  fontconfig-devel
73 BuildRequires:  freetype-devel >= 2
74 BuildRequires:  gdk-pixbuf2-devel >= 2.0
75 BuildRequires:  librsvg-devel >= 2.48
76 BuildRequires:  pango-devel
77 %endif
78 Requires:       curl-libs >= 7.62
79 Requires:       glib2 >= 1:2.62
80 Requires:       libxmlb >= 0.3.14
81 Obsoletes:      PackageKit-plugin-appstream < 0.7.4
82 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
83
84 %description
85 AppStream-Core library and tools to access the AppStream component
86 database.
87
88 %description -l pl.UTF-8
89 Biblioteka i narzędzia AppStream-Core służące do dostępu do bazy
90 danych komponentu AppStream.
91
92 %package devel
93 Summary:        Header files for AppStream library
94 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki AppStream
95 Group:          Development/Libraries
96 Requires:       %{name} = %{version}-%{release}
97 Requires:       glib2-devel >= 1:2.62
98
99 %description devel
100 Header files for AppStream library.
101
102 %description devel -l pl.UTF-8
103 Pliki nagłówkowe biblioteki AppStream.
104
105 %package static
106 Summary:        Static AppStream library
107 Summary(pl.UTF-8):      Statyczna biblioteka AppStream
108 Group:          Development/Libraries
109 Requires:       %{name}-devel = %{version}-%{release}
110
111 %description static
112 Static AppStream library.
113
114 %description static -l pl.UTF-8
115 Statyczna biblioteka AppStream.
116
117 %package -n vala-appstream
118 Summary:        Vala API for AppStream library
119 Summary(pl.UTF-8):      API języka Vala do biblioteki AppStream
120 Group:          Development/Libraries
121 Requires:       %{name}-devel = %{version}-%{release}
122 Requires:       vala
123 BuildArch:      noarch
124
125 %description -n vala-appstream
126 Vala API for AppStream library.
127
128 %description -n vala-appstream -l pl.UTF-8
129 API języka Vala do biblioteki AppStream.
130
131 %package apidocs
132 Summary:        AppStream API documentation
133 Summary(pl.UTF-8):      Dokumentacja API biblioteki AppStream
134 Group:          Documentation
135 BuildArch:      noarch
136
137 %description apidocs
138 API documentation for AppStream library.
139
140 %description apidocs -l pl.UTF-8
141 Dokumentacja API biblioteki AppStream.
142
143 %package compose
144 Summary:        AppStreamCompose library
145 Summary(pl.UTF-8):      Biblioteka AppStreamCompose
146 Group:          Libraries
147 Requires:       %{name} = %{version}-%{release}
148 Requires:       cairo >= 1.12
149 Requires:       librsvg >= 2.48
150
151 %description compose
152 AppStreamCompose library contains helper functions to generate
153 AppStream metadata and auxiliary data.
154
155 %description compose -l pl.UTF-8
156 Biblioteka AppStreamCompose zawiera funkcje pomocnicze do generowania
157 metadanych AppStream oraz danych pomocniczych.
158
159 %package compose-devel
160 Summary:        Header files for AppStreamCompose library
161 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki AppStreamCompose
162 Group:          Development/Libraries
163 Requires:       %{name}-compose = %{version}-%{release}
164 Requires:       %{name}-devel = %{version}-%{release}
165
166 %description compose-devel
167 Header files for AppStreamCompose library.
168
169 %description compose-devel -l pl.UTF-8
170 Pliki nagłówkowe biblioteki AppStreamCompose.
171
172 %package compose-static
173 Summary:        Static AppStreamCompose library
174 Summary(pl.UTF-8):      Statyczna biblioteka AppStreamCompose
175 Group:          Development/Libraries
176 Requires:       %{name}-compose-devel = %{version}-%{release}
177
178 %description compose-static
179 Static AppStreamCompose library.
180
181 %description compose-static -l pl.UTF-8
182 Statyczna biblioteka AppStreamCompose.
183
184 %package qt5
185 Summary:        AppStreamQt5 library
186 Summary(pl.UTF-8):      Biblioteka AppStreamQt5
187 Group:          Libraries
188 Requires:       %{name} = %{version}-%{release}
189 Requires:       Qt5Core >= 5.15
190 Obsoletes:      AppStream-qt < 1
191
192 %description qt5
193 AppStreamQt5 library.
194
195 %description qt5 -l pl.UTF-8
196 Biblioteka AppStreamQt5.
197
198 %package qt5-devel
199 Summary:        Header files for AppStreamQt5 library
200 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki AppStreamQt5
201 Group:          Libraries
202 Requires:       %{name}-devel = %{version}-%{release}
203 Requires:       %{name}-qt5 = %{version}-%{release}
204 Requires:       Qt5Core-devel >= 5.15
205 Obsoletes:      AppStream-qt-devel < 1
206
207 %description qt5-devel
208 Header files for AppStreamQt5 library.
209
210 %description qt5-devel -l pl.UTF-8
211 Pliki nagłówkowe biblioteki AppStreamQt5.
212
213 %package qt5-static
214 Summary:        Static AppStreamQt5 library
215 Summary(pl.UTF-8):      Statyczna biblioteka AppStreamQt5
216 Group:          Development/Libraries
217 Requires:       %{name}-qt5-devel = %{version}-%{release}
218 Obsoletes:      AppStream-qt-static < 1
219
220 %description qt5-static
221 Static AppStreamQt5 library.
222
223 %description qt5-static -l pl.UTF-8
224 Statyczna biblioteka AppStreamQt5.
225
226 %package qt6
227 Summary:        AppStreamQt library
228 Summary(pl.UTF-8):      Biblioteka AppStreamQt
229 Group:          Libraries
230 Requires:       %{name} = %{version}-%{release}
231 Requires:       Qt6Core >= 6.2.4
232
233 %description qt6
234 AppStreamQt library.
235
236 %description qt6 -l pl.UTF-8
237 Biblioteka AppStreamQt.
238
239 %package qt6-devel
240 Summary:        Header files for AppStreamQt library
241 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki AppStreamQt
242 Group:          Libraries
243 Requires:       %{name}-devel = %{version}-%{release}
244 Requires:       %{name}-qt6 = %{version}-%{release}
245 Requires:       Qt6Core-devel >= 6.2.4
246
247 %description qt6-devel
248 Header files for AppStreamQt library.
249
250 %description qt6-devel -l pl.UTF-8
251 Pliki nagłówkowe biblioteki AppStreamQt.
252
253 %package qt6-static
254 Summary:        Static AppStreamQt library
255 Summary(pl.UTF-8):      Statyczna biblioteka AppStreamQt
256 Group:          Development/Libraries
257 Requires:       %{name}-qt6-devel = %{version}-%{release}
258
259 %description qt6-static
260 Static AppStreamQt library.
261
262 %description qt6-static -l pl.UTF-8
263 Statyczna biblioteka AppStreamQt.
264
265 %package -n gettext-its-metainfo
266 Summary:        AppStream metainfo ITS data for gettext tools
267 Summary(pl.UTF-8):      Dane ITS AppStream metainfo dla narzędzi gettext
268 Group:          Development/Tools
269 Requires:       gettext-tools >= 0.19
270
271 %description -n gettext-its-metainfo
272 AppStream metainfo ITS data for gettext tools.
273
274 %description -n gettext-its-metainfo -l pl.UTF-8
275 Dane ITS AppStream metainfo dla narzędzi gettext.
276
277 %prep
278 %setup -q
279
280 %build
281 %meson build \
282         %{!?with_static_libs:--default-library=shared} \
283         -Dapidocs=%{__true_false apidocs} \
284         %{?with_apt:-Dapt-support=true} \
285         %{?with_compose:-Dcompose=true} \
286         -Ddocs=%{__true_false apidocs} \
287         -Dgir=true \
288         -Dinstall-docs=%{__true_false apidocs} \
289         %{?with_qt:-Dqt=true} \
290         %{?with_qt:-Dqt-versions="[%{?with_qt5:'5'%{?with_qt6:,}}%{?with_qt6:'6'}]"} \
291         -Dstemming=true \
292         %{!?with_systemd:-Dsystemd=false} \
293         %{?with_vala:-Dvapi=true}
294
295 %ninja_build -C build
296
297 %install
298 rm -rf $RPM_BUILD_ROOT
299
300 %ninja_install -C build
301
302 install -d $RPM_BUILD_ROOT%{_docdir}
303 %{?with_apidocs:%{__mv} $RPM_BUILD_ROOT%{_datadir}/gtk-doc $RPM_BUILD_ROOT%{_docdir}}
304
305 # unify; bn_BD is more complete than bn
306 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/bn
307 %{__mv} $RPM_BUILD_ROOT%{_localedir}/{bn_BD,bn}
308 # not supported by glibc
309 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/{ain,rom}
310
311 # Unneeded test file
312 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/installed-tests
313
314 %find_lang appstream
315
316 %clean
317 rm -rf $RPM_BUILD_ROOT
318
319 %post   -p /sbin/ldconfig
320 %postun -p /sbin/ldconfig
321
322 %post   compose -p /sbin/ldconfig
323 %postun compose -p /sbin/ldconfig
324
325 %post   qt5 -p /sbin/ldconfig
326 %postun qt5 -p /sbin/ldconfig
327
328 %post   qt6 -p /sbin/ldconfig
329 %postun qt6 -p /sbin/ldconfig
330
331 %files -f appstream.lang
332 %defattr(644,root,root,755)
333 %doc AUTHORS MAINTAINERS NEWS README.md RELEASE
334 %attr(755,root,root) %{_bindir}/appstreamcli
335 %attr(755,root,root) %{_libdir}/libappstream.so.*.*
336 %ghost %{_libdir}/libappstream.so.5
337 %{_libdir}/girepository-1.0/AppStream-1.0.typelib
338 #%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/appstream.conf
339 %{_datadir}/metainfo/org.freedesktop.appstream.cli.metainfo.xml
340 %if %{with apt}
341 %{_sysconfdir}/apt/apt.conf.d/50appstream
342 %endif
343 %{_mandir}/man1/appstreamcli.1*
344 %dir %{_datadir}/appstream
345 %{_datadir}/appstream/appstream.conf
346
347 %files devel
348 %defattr(644,root,root,755)
349 %attr(755,root,root) %{_libdir}/libappstream.so
350 %{_datadir}/gir-1.0/AppStream-1.0.gir
351 %{_includedir}/appstream
352 %{_pkgconfigdir}/appstream.pc
353
354 %if %{with static_libs}
355 %files static
356 %defattr(644,root,root,755)
357 %{_libdir}/libappstream.a
358 %endif
359
360 %if %{with vala}
361 %files -n vala-appstream
362 %defattr(644,root,root,755)
363 %{_datadir}/vala/vapi/appstream.deps
364 %{_datadir}/vala/vapi/appstream.vapi
365 %endif
366
367 %if %{with apidocs}
368 %files apidocs
369 %defattr(644,root,root,755)
370 %{_docdir}/appstream
371 %{_gtkdocdir}/appstream
372 %{_gtkdocdir}/appstream-compose
373 %endif
374
375 %if %{with compose}
376 %files compose
377 %defattr(644,root,root,755)
378 %attr(755,root,root) %{_libexecdir}/appstreamcli-compose
379 %attr(755,root,root) %{_libdir}/libappstream-compose.so.*.*.*
380 %attr(755,root,root) %ghost %{_libdir}/libappstream-compose.so.0
381 %{_libdir}/girepository-1.0/AppStreamCompose-1.0.typelib
382 %{_datadir}/metainfo/org.freedesktop.appstream.compose.metainfo.xml
383 %{_mandir}/man1/appstreamcli-compose.1*
384
385 %files compose-devel
386 %defattr(644,root,root,755)
387 %attr(755,root,root) %{_libdir}/libappstream-compose.so
388 %{_includedir}/appstream-compose
389 %{_datadir}/gir-1.0/AppStreamCompose-1.0.gir
390 %{_pkgconfigdir}/appstream-compose.pc
391
392 %if %{with static_libs}
393 %files compose-static
394 %defattr(644,root,root,755)
395 %{_libdir}/libappstream-compose.a
396 %endif
397 %endif
398
399 %if %{with qt5}
400 %files qt5
401 %defattr(644,root,root,755)
402 %attr(755,root,root) %{_libdir}/libAppStreamQt5.so.*.*.*
403 %attr(755,root,root) %ghost %{_libdir}/libAppStreamQt5.so.3
404
405 %files qt5-devel
406 %defattr(644,root,root,755)
407 %attr(755,root,root) %{_libdir}/libAppStreamQt5.so
408 %{_includedir}/AppStreamQt5
409 %{_libdir}/cmake/AppStreamQt5
410
411 %if %{with static_libs}
412 %files qt5-static
413 %defattr(644,root,root,755)
414 %{_libdir}/libAppStreamQt5.a
415 %endif
416 %endif
417
418 %if %{with qt6}
419 %files qt6
420 %defattr(644,root,root,755)
421 %attr(755,root,root) %{_libdir}/libAppStreamQt.so.*.*
422 %attr(755,root,root) %ghost %{_libdir}/libAppStreamQt.so.3
423
424 %files qt6-devel
425 %defattr(644,root,root,755)
426 %attr(755,root,root) %{_libdir}/libAppStreamQt.so
427 %{_includedir}/AppStreamQt
428 %{_libdir}/cmake/AppStreamQt
429
430 %if %{with static_libs}
431 %files qt6-static
432 %defattr(644,root,root,755)
433 %{_libdir}/libAppStreamQt.a
434 %endif
435 %endif
436
437 %files -n gettext-its-metainfo
438 %defattr(644,root,root,755)
439 %{_datadir}/gettext/its/metainfo.its
440 %{_datadir}/gettext/its/metainfo.loc
This page took 0.085181 seconds and 4 git commands to generate.