Merge branch 'upstream' into tizen
[platform/upstream/glib.git] / packaging / glib2.spec
1 # Do not create provides from extension .so files because the main package
2 # should anchor any reverse-dependencies
3 %global __provides_exclude_from ^(.*\\.extension-kdbus)$
4
5 %define baseline 2.62
6 %define with_systemtap 0
7 %define keepstatic 1
8 %define build_dir _build
9 %define build_dir_kdbus _build_kdbus
10
11 # The 'meson' macro is defined in rpm macros, but it uses features from rpm 4.15 ({shrink, set_build_flags)
12 # Below is a version suitable for our purposes
13 %define meson \
14   CFLAGS="${CFLAGS:-%optflags}" \
15   export CFLAGS \
16   %{__meson} \\\
17         --buildtype=plain \\\
18         --prefix=%{_prefix} \\\
19         --libdir=%{_libdir} \\\
20         --libexecdir=%{_libexecdir} \\\
21         --bindir=%{_bindir} \\\
22         --sbindir=%{_sbindir} \\\
23         --includedir=%{_includedir} \\\
24         --datadir=%{_datadir} \\\
25         --mandir=%{_mandir} \\\
26         --infodir=%{_infodir} \\\
27         --localedir=%{_datadir}/locale \\\
28         --sysconfdir=%{_sysconfdir} \\\
29         --localstatedir=%{_localstatedir} \\\
30         --sharedstatedir=%{_sharedstatedir} \\\
31         --wrap-mode=%{__meson_wrap_mode} \\\
32                 %{_vpath_builddir}
33 # Ninja macros below are defined for ninja in e.g. fedora distro, but
34 # so far they are not provided by Tizen's ninja package.
35 %define __ninja %{_bindir}/ninja
36 %define __ninja_common_opts -v %{?_smp_flags}
37 %define ninja_build \
38                 %{__ninja} %{__ninja_common_opts}
39 %define ninja_install \
40                 DESTDIR=%{buildroot} %{__ninja} install %{__ninja_common_opts}
41
42 Name:           glib2
43 Version:        2.62.3
44 Release:        0
45 # FIXME: find out if tapsets should really be in devel package or in main package
46 Summary:        General-Purpose Utility Library
47 License:        LGPL-2.1+
48 Group:          Base/Libraries
49 Url:            http://www.gtk.org/
50 Source:         http://download.gnome.org/sources/glib/%{baseline}/%{name}-%{version}.tar.xz
51 Source1:        glib2.sh
52 Source2:        glib2.csh
53 Source3:        test-runner.c
54 # Not upstream file. Only proposes upstream packages:
55 Source4:        glib2-upstream-gnome_defaults.conf
56 Source6:        macros.glib2
57 # Not depending on gtk-doc shortens bootstrap compilation path.
58 # Please update this file from the latest gtk-doc package:
59 Source7:        gtk-doc.m4
60 Source98:       q_quark_block_size.patch
61 Source99:       baselibs.conf
62 Source1001:     glib2.manifest
63 BuildRequires:  automake
64 BuildRequires:  fdupes
65 BuildRequires:  gcc-c++
66 BuildRequires:  m4
67 BuildRequires:  meson >= 0.49.2
68 BuildRequires:  pkg-config
69 BuildRequires:  python3
70 BuildRequires:  gettext-tools
71 # gdbus-codegen is run during the build, so we need python-xml
72 BuildRequires:  python3-xml
73 %if 0%{?with_systemtap}
74 BuildRequires:  systemtap-sdt-devel
75 %endif
76 # Needed for gresource
77 BuildRequires:  pkgconfig(libelf) >= 0.8.12
78 BuildRequires:  pkgconfig(libffi)
79 BuildRequires:  pkgconfig(libpcre) >= 8.31
80 BuildRequires:  pkgconfig(mount) >= 2.28
81 BuildRequires:  pkgconfig(zlib)
82 # Enable support for libdbuspolicy (only for kdbus transport)
83 BuildRequires:  pkgconfig(libdbuspolicy1)
84
85 %description
86 GLib is a general-purpose utility library, which provides many useful
87 data types, macros, type conversions, string utilities, file utilities,
88 a main loop abstraction, and so on.
89
90 %package tools
91 Summary:        General-Purpose Utility Library -- Tools
92
93 %description tools
94 GLib is a general-purpose utility library, which provides many useful
95 data types, macros, type conversions, string utilities, file utilities,
96 a main loop abstraction, and so on.
97
98 %package -n gio-branding-upstream
99 Summary:        Upstream definitions of default settings and applications
100 Requires:       libgio = %{version}
101 Provides:       %{name}-branding-upstream = %{version}
102 Obsoletes:      %{name}-branding-upstream < %{version}
103 Provides:       gio-branding = %{version}
104 Conflicts:      otherproviders(gio-branding)
105 Supplements:    packageand(libgio:branding-upstream)
106 BuildArch:      noarch
107 #BRAND: The /etc/gnome_defaults.conf allows to define arbitrary
108 #BRAND: applications as preferred defaults.
109 #BRAND: A /usr/share/glib-2.0/schemas/$NAME.gschema.override file can
110 #BRAND: be used to override the default value for GSettings keys. See
111 #BRAND: README.Gsettings-overrides for more details. The branding
112 #BRAND: package should then have proper Requires for features changed
113 #BRAND: with such an override file.
114 # NOTE: gnome_defaults is not an upstream feature, but a SuSE
115 # enhancement, but to conform branding conventions, the package is named
116 # as gio-branding-upstream.
117
118 %description -n gio-branding-upstream
119 This package provides upstream defaults for settings stored with
120 GSettings and applications used by the MIME system.
121
122 %package devel
123 #'
124 Requires:       %{name} = %{version}
125 Requires:       glibc-devel
126 Requires:       pkg-config
127 # Now require the subpackages too
128 Requires:       glib2-tools = %{version}
129 Requires:       libgio = %{version}
130 Requires:       libglib = %{version}
131 Requires:       libgmodule = %{version}
132 Requires:       libgobject = %{version}
133 Requires:       libgthread = %{version}
134 # Required by gdbus-codegen
135 Requires:       python3-xml
136 Requires:       python3
137 Provides:       glib2-doc = 2.19.6
138 Obsoletes:      glib2-doc < 2.19.6
139 Summary:        General-Purpose Utility Library -- Development Files
140
141 %description devel
142 GLib is a general-purpose utility library, which provides many useful
143 data types, macros, type conversions, string utilities, file utilities,
144 a main loop abstraction, and so on.
145
146 This package contains the development files for GLib.
147
148 %package devel-static
149 Summary:        Static libraries for glib, a general-purpose utility library
150 Group:          Development/Libraries/C and C++
151 Requires:       %{name}-devel = %{version}
152
153 %description devel-static
154 GLib is a general-purpose utility library, which provides many useful
155 data types, macros, type conversions, string utilities, file utilities,
156 a main loop abstraction, and so on.
157
158 This package contains static versions of the GLib libraries.
159
160 %package -n libglib
161 Summary:        General-Purpose Utility Library
162 Provides:       %{name} = %{version}
163 Obsoletes:      %{name} < %{version}
164
165 %description -n libglib
166 GLib is a general-purpose utility library, which provides many useful
167 data types, macros, type conversions, string utilities, file utilities,
168 a main loop abstraction, and so on.
169
170 %package -n libgmodule
171 Summary:        General-Purpose Utility Library -- Library for Modules
172
173 %description -n libgmodule
174 GLib is a general-purpose utility library, which provides many useful
175 data types, macros, type conversions, string utilities, file utilities,
176 a main loop abstraction, and so on.
177
178 The libgmodule library provides a portable way to dynamically load
179 object files (commonly known as 'plug-ins').
180
181 %package -n libgio
182 Summary:        General-Purpose Utility Library -- Library for VFS
183 Requires:       gio-branding = %{version}
184 # bnc#555605: shared-mime-info is required by libgio to properly detect mime types.
185 Requires:       shared-mime-info
186 # bnc#678518: libgio interacts with others by means of dbus-launch
187 #Requires:       dbus-1-x11
188 Provides:       gio = %{version}
189
190 %description -n libgio
191 GLib is a general-purpose utility library, which provides many useful
192 data types, macros, type conversions, string utilities, file utilities,
193 a main loop abstraction, and so on.
194
195 GIO provides a modern, easy-to-use VFS API.
196
197 %package -n libgio-extension-kdbus
198 Summary:        Extension for libgio to support KDBUS in Tizen
199 Requires:       libgio = %{version}-%{release}
200
201 %description -n libgio-extension-kdbus
202 This modifies libgio to support KDBUS in Tizen.
203
204
205 %package -n libgthread
206 Summary:        General-Purpose Utility Library -- Library for Threads
207
208 %description -n libgthread
209 GLib is a general-purpose utility library, which provides many useful
210 data types, macros, type conversions, string utilities, file utilities,
211 a main loop abstraction, and so on.
212
213 The libgthread library provides a portable way to write multi-threaded
214 software.
215
216 %package -n libgobject
217 Summary:        General-Purpose Utility Library -- Object-Oriented Framework for C
218
219 %description -n libgobject
220 GLib is a general-purpose utility library, which provides many useful
221 data types, macros, type conversions, string utilities, file utilities,
222 a main loop abstraction, and so on.
223
224 The GObject library provides an object-oriented framework for C.
225
226 %package tests
227 License:        LGPL-2.0+ and MIT
228 Summary:        Set of tests for gdbus component
229 Requires:       %{name} = %{version}
230
231 %description tests
232 This package is part of 'dbus-integration-tests' framework and contains set of tests
233 for gdbus component.
234
235 %prep
236 %setup -q -n %{name}-%{version}
237 %{__patch} -p1 < %{SOURCE98}
238
239 %build
240 cp %{SOURCE3} .
241 cp %{SOURCE1001} .
242 cp -a %{S:1} %{S:2} .
243 cp -a %{S:4} gnome_defaults.conf
244 if ! test -f %{_datadir}/aclocal/gtk-doc.m4 ; then
245     cp -a %{S:7} m4macros/
246 fi
247
248 %define _vpath_srcdir .
249
250 # Normal build
251 %define _vpath_builddir %{build_dir}
252 %meson \
253         --default-library=both \
254         -Dinstalled_tests=true \
255         -Db_pie=true
256 %meson_build
257
258 # Configure kdbus extension build
259 %define _vpath_builddir %{build_dir_kdbus}
260 %meson \
261         --default-library=both \
262         -Dkdbus=true \
263         -Dlibdbuspolicy=true \
264         -Db_pie=true
265 %meson_build
266
267 # compile test-runner for 'dbus-integration-test' framework
268 %__cc %{_builddir}/%{name}-%{version}/test-runner.c -fPIC -pie -o %{_builddir}/%{name}-%{version}/glib-tests
269
270 %install
271 # kdbus extension install and gather required files
272 %define _vpath_builddir %{build_dir_kdbus}
273 %meson_install
274 for FILE in %{buildroot}%{_libdir}/libgio*; do mv "$FILE" "$FILE.extension-kdbus"; done
275
276 # normal install overwriting kdbus extension install
277 %define _vpath_builddir %{build_dir}
278 %meson_install
279 %find_lang glib20 %{?no_lang_C}
280
281 mkdir -p %{buildroot}%{_sysconfdir}/profile.d
282 install -D -m0644 glib2.sh %{buildroot}%{_sysconfdir}/profile.d/zzz-glib2.sh
283 install -D -m0644 glib2.csh %{buildroot}%{_sysconfdir}/profile.d/zzz-glib2.csh
284 install -D -m0644 gnome_defaults.conf %{buildroot}%{_sysconfdir}/gnome_defaults.conf
285
286 # gio-querymodules magic
287 %if "%{_lib}" == "lib64"
288 mv %{buildroot}%{_bindir}/gio-querymodules %{buildroot}%{_bindir}/gio-querymodules-64
289 %endif
290
291 # prepare tests for 'dbus-integration-test' framework
292 %define relative_dbus_tests_base_dir %{_prefix}/lib/dbus-tests
293 %define dbus_tests_base_dir %{buildroot}%{relative_dbus_tests_base_dir}
294
295 install -D -m 755 %{_builddir}/%{name}-%{version}/glib-tests %{dbus_tests_base_dir}/runner/glib-tests
296 mkdir -p %{dbus_tests_base_dir}/test-suites/glib-tests/
297 mv %{buildroot}%{_prefix}/libexec/installed-tests/glib/*gdbus-* %{dbus_tests_base_dir}/test-suites/glib-tests/
298 # workaround for UNIX fd passing test (gdbus-peer)
299 echo "Testfile - check for UNIX fd passing" > %{dbus_tests_base_dir}/test-suites/glib-tests/file.c
300 rm %{dbus_tests_base_dir}/test-suites/glib-tests/gdbus-testserver
301 rm -Rf %{buildroot}%{_prefix}/libexec/installed-tests/glib/
302 rm -Rf %{buildroot}%{_prefix}/share/installed-tests/glib/
303
304 # Install rpm macros
305 mkdir -p %{buildroot}%{_sysconfdir}/rpm
306 cp %{SOURCE6} %{buildroot}%{_sysconfdir}/rpm
307
308 mkdir -p %{buildroot}%{_libdir}/gio/modules
309 mkdir -p %{buildroot}%{_datadir}/glib-2.0/schemas/
310
311 chmod 755 %{buildroot}%{_bindir}/*
312
313 %post -n libglib -p /sbin/ldconfig
314 %post -n libgobject -p /sbin/ldconfig
315 %post -n libgthread -p /sbin/ldconfig
316 %post -n libgio -p /sbin/ldconfig
317 %post -n libgmodule -p /sbin/ldconfig
318
319 %postun -n libglib -p /sbin/ldconfig
320 %postun -n libgobject -p /sbin/ldconfig
321 %postun -n libgthread -p /sbin/ldconfig
322 %postun -n libgio -p /sbin/ldconfig
323 %postun -n libgmodule -p /sbin/ldconfig
324
325 %files tools
326 %manifest %{name}.manifest
327 %defattr(-,root,root)
328 %license COPYING
329 %dir %{_datadir}/bash-completion
330 %dir %{_datadir}/bash-completion/completions
331 %{_datadir}/bash-completion/completions/gresource
332 %{_datadir}/bash-completion/completions/gsettings
333 %{_bindir}/gdbus
334 %{_bindir}/gio
335 %{_bindir}/gio-querymodules*
336 %{_bindir}/glib-compile-schemas
337 %{_bindir}/gresource
338 %{_bindir}/gsettings
339 %{_bindir}/gapplication
340
341 # We put those files here, but they don't really belong here. They just don't
342 # have a better home... The zzz-glib2 scripts could arguably be in
343 # libglib but that would break the shared library policy.
344 %{_sysconfdir}/profile.d/zzz-glib2.*
345
346 %files -n gio-branding-upstream
347 %manifest %{name}.manifest
348 %defattr(-,root,root)
349 %license COPYING
350 %config (noreplace) %{_sysconfdir}/gnome_defaults.conf
351
352 %files -n libglib
353 %manifest %{name}.manifest
354 %defattr(-, root, root)
355 %license COPYING
356 %{_libdir}/libglib*.so.*
357
358 %files -n libgmodule
359 %manifest %{name}.manifest
360 %defattr(-, root, root)
361 %license COPYING
362 %{_libdir}/libgmodule*.so.*
363
364 %files -n libgobject
365 %manifest %{name}.manifest
366 %defattr(-, root, root)
367 %license COPYING
368 %{_libdir}/libgobject*.so.*
369
370 %files -n libgthread
371 %manifest %{name}.manifest
372 %defattr(-, root, root)
373 %license COPYING
374 %{_libdir}/libgthread*.so.*
375
376 %files -n libgio
377 %manifest %{name}.manifest
378 %defattr(-, root, root)
379 %license COPYING
380 %exclude %{_libdir}/libgio*.so.*.extension-kdbus
381 %{_libdir}/libgio*.so.*
382 %dir %{_libdir}/gio
383 %dir %{_libdir}/gio/modules
384 %ghost %{_libdir}/gio/modules/giomodule.cache
385 %dir %{_datadir}/glib-2.0/
386 %dir %{_datadir}/glib-2.0/schemas/
387
388 %lang_package -f glib20
389
390 %post -n libgio-extension-kdbus
391 pushd %{_libdir}
392 for FILE in libgio*.so.*.extension-kdbus; do mv "$FILE" "${FILE%.extension-kdbus}"; done
393 popd
394
395 %files -n libgio-extension-kdbus
396 %manifest %{name}.manifest
397 %license COPYING
398 %{_libdir}/libgio*.so.*.extension-kdbus
399
400 %files devel
401 %manifest %{name}.manifest
402 %defattr(-,root,root)
403 %license COPYING
404
405 %{_bindir}/gdbus-codegen
406 %{_datadir}/bash-completion/completions/*
407 %_datadir/glib-2.0/codegen
408
409 %{_bindir}/glib-compile-resources
410 %{_bindir}/glib-genmarshal
411 %{_bindir}/glib-gettextize
412 %{_bindir}/glib-mkenums
413 %{_bindir}/gobject-query
414 %{_bindir}/gtester
415 %{_bindir}/gtester-report
416 %dir %{_datadir}/aclocal
417 %{_datadir}/aclocal/glib-2.0.m4
418 %{_datadir}/aclocal/glib-gettext.m4
419 %{_datadir}/aclocal/gsettings.m4
420 %dir %{_datadir}/glib-2.0/
421 %{_datadir}/glib-2.0/gdb/
422 %{_datadir}/glib-2.0/gettext/
423 %{_datadir}/glib-2.0/schemas/gschema.dtd
424 %{_datadir}/glib-2.0/valgrind/glib.supp
425 %{_includedir}/glib-2.0
426 %{_includedir}/gio-unix-2.0
427 %{_libdir}/lib*.so
428 %dir %{_libdir}/glib-2.0/
429 %{_libdir}/glib-2.0/include/
430 %{_libdir}/pkgconfig/*.pc
431 %{_datadir}/gdb/auto-load/%{_libdir}/*-gdb.py
432 %{_datadir}/gettext/its/gschema.*
433 %if 0%{?with_systemtap}
434 %{_datadir}/systemtap/tapset/*.stp
435 %endif
436 %{_sysconfdir}/rpm/macros.glib2
437 # Own these directories to not depend on gdb
438 %dir %{_datadir}/gdb
439 %dir %{_datadir}/gdb/auto-load
440 %dir %{_datadir}/gdb/auto-load%{_prefix}
441 %dir %{_datadir}/gdb/auto-load%{_libdir}
442
443 %files devel-static
444 %manifest %{name}.manifest
445 %defattr(-,root,root)
446 %license COPYING
447 %{_libdir}/lib*.a
448 %{_libdir}/lib*.a.extension-kdbus
449
450 %files tests
451 %manifest %{name}.manifest
452 %license COPYING LICENSE.MIT
453 %{relative_dbus_tests_base_dir}/test-suites/glib-tests/
454 %{relative_dbus_tests_base_dir}/runner/glib-tests
455
456 %changelog