2024-05-03 12:54:01 +02:00
#
2024-11-12 12:09:31 +01:00
# spec file for package glib2
2024-05-03 12:54:01 +02:00
#
2024-11-12 12:09:31 +01:00
# Copyright (c) 2024 SUSE LLC
2024-05-03 12:54:01 +02:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "doc"
2024-11-12 12:09:31 +01:00
%global psuffix -doc
%bcond_with systemtap
2024-05-03 12:54:01 +02:00
%else
2024-11-12 12:09:31 +01:00
%if "%{flavor}" == "stage1"
%global psuffix -stage1-devel
%bcond_with systemtap
%else
%global psuffix %{nil}
%bcond_without systemtap
%endif
2024-05-03 12:54:01 +02:00
%endif
%define libver 2_0-0
%define libgio libgio-%{libver}
%define libglib libglib-%{libver}
%define libgmodule libgmodule-%{libver}
%define libgobject libgobject-%{libver}
%define libgthread libgthread-%{libver}
2024-11-12 12:09:31 +01:00
%define libgirepository libgirepository-%{libver}
2024-05-03 12:54:01 +02:00
Name : glib2%{psuffix}
2024-11-12 12:09:31 +01:00
Version : 2.82.2
2024-05-03 12:54:01 +02:00
Release : 0
Summary : General-Purpose Utility Library
License : LGPL-2.1-or-later
Group : Development/Libraries/C and C++
2024-07-22 17:02:14 +02:00
URL : https://gitlab.gnome.org/GNOME/glib/
2024-11-12 12:09:31 +01:00
Source0 : glib-%{version} .tar.zst
2024-05-03 12:54:01 +02:00
Source1 : glib2.sh
Source2 : glib2.csh
# Not upstream file. Only proposes upstream packages:
Source4 : glib2-upstream-gnome_defaults.conf
# Some documentation for people writing branding packages, shipped in the branding-upstream package
Source5 : README.Gsettings-overrides
Source6 : macros.glib2
# zsh completion from https://github.com/jmatsuzawa/zsh-comp-gsettings
Source8 : gsettings.zsh
Source98 : glib2-rpmlintrc
Source99 : baselibs.conf
2024-11-12 12:09:31 +01:00
Source200 : files.glib2
Source201 : files.stage1
2024-05-03 12:54:01 +02:00
# PATCH-FEATURE-UPSTREAM glib2-bgo569829-gettext-gkeyfile.patch fate300461 bgo569829 vuntz@novell.com -- Look for translation of desktop entry strings via gettext, part that we share with Ubuntu and try to push upstream
Patch0 : glib2-bgo569829-gettext-gkeyfile.patch
# PATCH-FEATURE-OPENSUSE glib2-fate300461-gettext-gkeyfile-suse.patch fate300461 vuntz@novell.com -- Look for translation of desktop entry strings via gettext, part that deals with the openSUSE specific infrastructure (with desktop_translations)
Patch1 : glib2-fate300461-gettext-gkeyfile-suse.patch
# PATCH-FIX-OPENSUSE glib2-suppress-schema-deprecated-path-warning.patch rh#814053 badshah400@gmail.com -- Suppress the deprecated path warning since it fills up screen unnecessarily during package installations/upgrade.
Patch2 : glib2-suppress-schema-deprecated-path-warning.patch
# PATCH-FIX-OPENSUSE glib2-gdbus-codegen-version.patch olaf@aepfle.de -- Remove version string from files generated by gdbus-codegen
Patch4 : glib2-gdbus-codegen-version.patch
BuildRequires : docbook-xsl-stylesheets
BuildRequires : fdupes
BuildRequires : gcc-c++
BuildRequires : libselinux-devel
BuildRequires : m4
BuildRequires : meson >= 0.60.0
BuildRequires : pkgconfig
BuildRequires : python3-base >= 3.5
2024-11-12 12:09:31 +01:00
BuildRequires : python3-docutils
2024-05-03 12:54:01 +02:00
# gdbus-codegen is run during the build, so we need python3-xml
BuildRequires : python3-xml
BuildRequires : xsltproc
# Needed for gresource
BuildRequires : pkgconfig(libelf) >= 0.8.12
BuildRequires : pkgconfig(libffi) >= 3.0.0
BuildRequires : pkgconfig(libpcre2-8) >= 10.32
BuildRequires : pkgconfig(mount) >= 2.28
BuildRequires : pkgconfig(zlib)
2024-11-12 12:09:31 +01:00
%if "%{flavor}" != "stage1"
BuildRequires : pkgconfig(gobject-introspection-1.0)
%endif
2024-05-03 12:54:01 +02:00
%if "%{flavor}" == "doc"
# Split-provides
Provides : glib2-devel:%{_datadir} /gtk-doc/html/gobject/index.html
%endif
%if "%{flavor}" == "doc"
BuildRequires : glib2-devel
2024-11-12 12:09:31 +01:00
BuildRequires : pkgconfig(gi-docgen)
2024-05-03 12:54:01 +02:00
%endif
%if %{with systemtap}
BuildRequires : systemtap-dtrace
BuildRequires : systemtap-headers
%endif
2024-11-12 12:09:31 +01:00
%if "%{flavor}" == "stage1"
Requires : this-is-only-for-build-envs
Conflicts : %{libgio}
Conflicts : %{libgirepository}
Conflicts : %{libglib}
Conflicts : %{libgmodule}
Conflicts : %{libgobject}
Conflicts : %{libgthread}
Conflicts : glib2-devel
Conflicts : glib2-tools
Conflicts : glib2-tools-32bit
%endif
2024-05-03 12:54:01 +02:00
%description
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
%if %{with doc}
This package provides the documentation for the GLib library.
%endif
%package tools
Summary : Tools from glib2, a general-purpose utility library
# ensure libgio-2_0-0 is updated before glib2-tools' ensures glib-compile-schema to
# be functional when the file trigger fires (boo#1178713)
Group : Development/Libraries/C and C++
Requires(post) : %{libgio} = %{version}
%description tools
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
%package -n gio-branding-upstream
Summary : Upstream definitions of default settings and applications
Group : System/Libraries
Requires : %{libgio} = %{version}
Supplements: (%{libgio} and branding-upstream)
Conflicts : gio-branding
Provides : %{name} -branding-upstream = %{version}
Obsoletes : %{name} -branding-upstream < %{version}
Provides : gio-branding = %{version}
BuildArch : noarch
#BRAND: The /etc/gnome_defaults.conf allows to define arbitrary
#BRAND: applications as preferred defaults.
#BRAND: A /usr/share/glib-2.0/schemas/$NAME.gschema.override file can
#BRAND: be used to override the default value for GSettings keys. See
#BRAND: README.Gsettings-overrides for more details. The branding
#BRAND: package should then have proper Requires for features changed
#BRAND: with such an override file.
# NOTE: gnome_defaults is not an upstream feature, but a SuSE
# enhancement, but to conform branding conventions, the package is named
# as gio-branding-upstream.
%description -n gio-branding-upstream
This package provides upstream defaults for settings stored with
GSettings and applications used by the MIME system.
%package devel
Summary : Development files for glib, a general-purpose utility library
Group : Development/Libraries/C and C++
2024-11-12 12:09:31 +01:00
# GDbusTest launches dbus-daemon with a special env to not interfere with
# the real session bus.
Requires : %{_bindir} /dbus-daemon
2024-05-03 12:54:01 +02:00
Requires : %{libgio} = %{version}
2024-11-12 12:09:31 +01:00
Requires : %{libgirepository} = %{version}
2024-05-03 12:54:01 +02:00
Requires : %{libglib} = %{version}
Requires : %{libgmodule} = %{version}
Requires : %{libgobject} = %{version}
Requires : %{libgthread} = %{version}
Requires : glib2-tools = %{version}
Requires : glibc-devel
Requires : pkgconfig
# Required by gdbus-codegen
Requires : python3-xml
2024-11-12 12:09:31 +01:00
Requires : typelib-1_0-GIRepository-3_0 = %{version}
Requires : typelib-1_0-GLib-2_0 = %{version}
Requires : typelib-1_0-GLibUnix-2_0 = %{version}
Requires : typelib-1_0-GModule-2_0 = %{version}
Requires : typelib-1_0-GObject-2_0 = %{version}
Requires : typelib-1_0-Gio-2_0 = %{version}
2024-05-03 12:54:01 +02:00
#
%description devel
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
This package contains the development files for GLib.
%package devel-static
Summary : Static libraries for glib, a general-purpose utility library
Group : Development/Libraries/C and C++
Requires : %{name} -devel = %{version}
%description devel-static
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
This package contains static versions of the GLib libraries.
%package -n %{libglib}
Summary : General-Purpose Utility Library
Group : System/Libraries
Provides : %{name} = %{version}
Obsoletes : %{name} < %{version}
#
%description -n %{libglib}
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
%package -n %{libgmodule}
Summary : General-Purpose Utility Library -- Library for Modules
Group : System/Libraries
%description -n %{libgmodule}
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
The libgmodule library provides a portable way to dynamically load
object files (commonly known as 'plug-ins' ).
%package -n %{libgio}
Summary : A virtual file system library API
Group : System/Libraries
# The tools are useful for people having libgio
# bnc#555605: shared-mime-info is required by libgio to properly detect mime types, but not during build
#!BuildIgnore: shared-mime-info
# bnc#678518: libgio interacts with others by means of dbus-launch
2024-07-22 17:02:14 +02:00
Requires : (%{_bindir} /dbus-launch if dbus-service)
2024-11-12 12:09:31 +01:00
Requires : %{name} -tools
2024-05-03 12:54:01 +02:00
Requires : gio-branding = %{version}
Requires : shared-mime-info
# Needed for branding packages
Provides : gio = %{version}
# Temporarily disable this, pending further discussion
# Recommends: gvfs
%description -n %{libgio}
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
GIO provides a modern, easy-to-use VFS API.
%package -n %{libgthread}
Summary : Portable API from glib wrapping system threads
Group : System/Libraries
%description -n %{libgthread}
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
The libgthread library provides a portable way to write multi-threaded
software.
%package -n %{libgobject}
Summary : Object-Oriented Framework for C
Group : System/Libraries
%description -n %{libgobject}
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
The GObject library provides an object-oriented framework for C.
2024-11-12 12:09:31 +01:00
%package -n %{libgirepository}
Summary : Object-Oriented Framework for C
Group : System/Libraries
%description -n %{libgirepository}
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
The GObject library provides an object-oriented framework for C.
2024-05-03 12:54:01 +02:00
%package tests-devel
Summary : Tests for the glib2 package
Group : Development/Libraries/C and C++
Requires : %{name} -devel = %{version}
Requires : %{name} -tests = %{version} -%{release}
Provides : %{name} -tests = %{version} -%{release}
Obsoletes : %{name} -tests < %{version} -%{release}
%description tests-devel
The glib2-tests-devel package contains tests that can be used to verify
the functionality of the installed glib2 package.
2024-11-12 12:09:31 +01:00
%package -n typelib-1_0-GIRepository-3_0
Summary : Object-Oriented Framework for C
Group : System/Libraries
%description -n typelib-1_0-GIRepository-3_0
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
The GObject library provides an object-oriented framework for C.
%package -n typelib-1_0-GLib-2_0
Summary : Object-Oriented Framework for C
Group : System/Libraries
%description -n typelib-1_0-GLib-2_0
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
The GObject library provides an object-oriented framework for C.
%package -n typelib-1_0-GLibUnix-2_0
Summary : Object-Oriented Framework for C
Group : System/Libraries
%description -n typelib-1_0-GLibUnix-2_0
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
The GObject library provides an object-oriented framework for C.
%package -n typelib-1_0-GModule-2_0
Summary : Object-Oriented Framework for C
Group : System/Libraries
%description -n typelib-1_0-GModule-2_0
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
The GObject library provides an object-oriented framework for C.
%package -n typelib-1_0-GObject-2_0
Summary : Object-Oriented Framework for C
Group : System/Libraries
%description -n typelib-1_0-GObject-2_0
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
The GObject library provides an object-oriented framework for C.
%package -n typelib-1_0-Gio-2_0
Summary : Object-Oriented Framework for C
Group : System/Libraries
# GioUnix has been folded into Gio package, as this is transparently loaded
# when including Gio (Platform specific loader in gjs - we know we are on unix)
Provides : typelib-1_0-GioUnix-2_0 = %{version}
Obsoletes : typelib-1_0-GioUnix-2_0 <= %{version}
%description -n typelib-1_0-Gio-2_0
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
The GObject library provides an object-oriented framework for C.
2024-05-03 12:54:01 +02:00
%lang_package
%prep
2024-07-22 17:02:14 +02:00
%autosetup -p1 -n glib-%{version}
2024-05-03 12:54:01 +02:00
cp -a %{SOURCE1} %{SOURCE2} %{SOURCE5} .
cp -a %{SOURCE4} gnome_defaults.conf
sed -i " s / 1 . 3 2 . 1 / 1 . 3 2 / " docs/reference/meson.build
%build
%if %{with systemtap}
%global _lto_cflags %{nil}
%else
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
%endif
%meson \
2024-11-12 12:09:31 +01:00
--default-library=%[ " %{flavor} " == " " ? " b o t h " : " s h a r e d " ]\
-Dselinux=%[ " %{flavor} " != " s t a g e 1 " ? " e n a b l e d " : " d i s a b l e d " ] \
-Dman-pages=%[ " %{flavor} " != " s t a g e 1 " ? " t r u e " : " f a l s e " ] \
2024-05-03 12:54:01 +02:00
%if "%{flavor}" == "doc"
2024-11-12 12:09:31 +01:00
-Ddocumentation=true \
%else
-Ddocumentation=false \
-Dinstalled_tests=%[ " %{flavor} " != " s t a g e 1 " ? " t r u e " : " f a l s e " ] \
-Dnls=%[ " %{flavor} " != " s t a g e 1 " ? " e n a b l e d " : " d i s a b l e d " ] \
2024-05-03 12:54:01 +02:00
%endif
%if %{with systemtap}
-Dsystemtap=true \
-Ddtrace=true \
%else
-Dsystemtap=false \
-Ddtrace=false \
%endif
2024-11-12 12:09:31 +01:00
-Dintrospection=%[ " %{flavor} " != " s t a g e 1 " ? " e n a b l e d " : " d i s a b l e d " ] \
-Dglib_debug=disabled \
-Dsysprof=disabled \
2024-05-03 12:54:01 +02:00
%{nil}
%meson_build
%install
%meson_install
%if "%{flavor}" == "doc"
2024-11-12 12:09:31 +01:00
find %{buildroot} /%{_prefix} -not -path " * %{_datadir} / d o c / * " -delete || :
2024-05-03 12:54:01 +02:00
%endif
2024-11-12 12:09:31 +01:00
%if "%{flavor}" == ""
%find_lang glib20 %{?no_lang_C}
mkdir -p %{buildroot} %{_sysconfdir} /profile.d
install -D -m0644 glib2.sh %{buildroot} %{_sysconfdir} /profile.d/zzz-glib2.sh
install -D -m0644 glib2.csh %{buildroot} %{_sysconfdir} /profile.d/zzz-glib2.csh
install -D -m0644 gnome_defaults.conf %{buildroot} %{_sysconfdir} /gnome_defaults.conf
# default apps magic
mkdir -p %{buildroot} %{_localstatedir} /cache/gio-2.0 %{buildroot} %{_datadir} /applications
>> %{buildroot} %{_localstatedir} /cache/gio-2.0/gnome-mimeapps.list
>> %{buildroot} %{_localstatedir} /cache/gio-2.0/xfce-mimeapps.list
>> %{buildroot} %{_localstatedir} /cache/gio-2.0/lxde-mimeapps.list
>> %{buildroot} %{_localstatedir} /cache/gio-2.0/pantheon-mimeapps.list
>> %{buildroot} %{_localstatedir} /cache/gio-2.0/budgie-mimeapps.list
>> %{buildroot} %{_localstatedir} /cache/gio-2.0/mate-mimeapps.list
ln -s %{_localstatedir} /cache/gio-2.0/gnome-mimeapps.list %{buildroot} %{_datadir} /applications/gnome-mimeapps.list
# gio-querymodules magic
%if "%{_lib}" == "lib64"
mv -T %{buildroot} %{_bindir} /gio-querymodules %{buildroot} %{_bindir} /gio-querymodules-64
sed -i -e " / ^ g i o _ q u e r y m o d u l e s = / s / g i o - q u e r y m o d u l e s / g i o - q u e r y m o d u l e s - 6 4 / " %{buildroot} %{_libdir} /pkgconfig/gio-2.0.pc
%endif
mkdir -p %{buildroot} %{_libdir} /gio/modules
>> %{buildroot} %{_libdir} /gio/modules/giomodule.cache
# gsettings magic
>> %{buildroot} %{_datadir} /glib-2.0/schemas/gschemas.compiled
# Install rpm macros
mkdir -p %{buildroot} %{_rpmmacrodir}
cp -t%{buildroot} %{_rpmmacrodir} %{SOURCE6}
# Install zsh completion for gsettings
mkdir -p %{buildroot} %{_datadir} /zsh/site-functions/
cp -T %{SOURCE8} %{buildroot} %{_datadir} /zsh/site-functions/_gsettings
%fdupes %{buildroot} /%{_prefix}
%python3_fix_shebang
%if %{suse_version} >= 1600
%python3_fix_shebang_path %{buildroot} %{_libexecdir} /installed-tests/glib/*
%endif
# Too many users complain about schemas compiled with wrong permissions
# when in fact the system just honours their umask setting
# subshell restores umask for paranoia mode
2024-05-03 12:54:01 +02:00
%define compile_schemas \
(umask 022 && %{_bindir} /glib-compile-schemas %{_datadir} /glib-2.0/schemas)
%filetriggerin -n glib2-tools -- %{_datadir} /glib-2.0/schemas
%{compile_schemas}
%filetriggerpostun -n glib2-tools -- %{_datadir} /glib-2.0/schemas
%{compile_schemas}
%post -n %{libgio}
%{ldconfig}
for ENV in gnome xfce lxde pantheon mate
do mimeapps=" %{_localstatedir} / c a c h e / g i o - 2 . 0 / $ E N V - m i m e a p p s . l i s t " &&
2>/dev/null <" $ { m i m e a p p s } " || cat >" $ { m i m e a p p s } " <<EOF
# Dummy file. Install desktop-file-utils to get better defaults.
[Default Applications]
EOF
done
2024-11-12 12:09:31 +01:00
%postun -n %{libgio} -p %{ldconfig}
%ldconfig_scriptlets -n %{libglib}
%ldconfig_scriptlets -n %{libgobject}
%ldconfig_scriptlets -n %{libgthread}
%ldconfig_scriptlets -n %{libgmodule}
%ldconfig_scriptlets -n %{libgirepository}
2024-05-03 12:54:01 +02:00
%endif
%check
### FIXME ### Figure out how to run the "stable tests" only ref info from upstream.
#%%meson_test
%if "%{flavor}" == "doc"
%files
2024-11-12 12:09:31 +01:00
%{_datadir} /doc/g*-2.0/
%endif
2024-05-03 12:54:01 +02:00
2024-11-12 12:09:31 +01:00
%if "%{flavor}" == ""
%include %{SOURCE200}
2024-05-03 12:54:01 +02:00
%endif
2024-11-12 12:09:31 +01:00
%if "%{flavor}" == "stage1"
%include %{SOURCE201}
2024-05-03 12:54:01 +02:00
%endif
%changelog