diff options
-rw-r--r-- | packaging/glib2.spec | 68 |
1 files changed, 42 insertions, 26 deletions
diff --git a/packaging/glib2.spec b/packaging/glib2.spec index 986c8addb..37ec3dd9b 100644 --- a/packaging/glib2.spec +++ b/packaging/glib2.spec @@ -4,15 +4,41 @@ %define WITH_KDBUS 1 %endif +%if %{?WITH_KDBUS} +%define provide_exclude_format ^(.*\.\extension-kdbus|.*\.\extension-symbolic)$ +%define build_dir_kdbus _build_kdbus + +%global build_glib_kdbus() \ + %define _vpath_builddir %{build_dir_kdbus} \ + %meson --default-library=both -Dkdbus=true -Dlibdbuspolicy=true -Dintrospection=disabled -Dman-pages=false -Dselinux=disabled -Db_pie=true \ + %meson_build + +# kdbus extension install and gather required files +%global install_glib_kdbus() \ + %define _vpath_builddir %{build_dir_kdbus} \ + %meson_install \ + for FILE in %{buildroot}%{_libdir}/libgio*[0-9a] %{buildroot}%{_libdir}/libglib*[0-9a]; do mv "$FILE" "$FILE.extension-kdbus"; done + +%global exclude_libglib_kdbus() \ + %exclude %{_libdir}/libglib*.so.*.extension-kdbus + +%global exclude_libgio_kdbus() \ + %exclude %{_libdir}/libgio*.so.*.extension-kdbus + +%global include_glib_kdbus_files() \ + %{_libdir}/lib*.a.extension-kdbus +%else +%define provide_exclude_format ^(.*\.\extension-symbolic)$ +%endif + # Do not create provides from extension .so files because the main package # should anchor any reverse-dependencies -%global __provides_exclude_from ^(.*\\.extension-kdbus|.*\\.extension-symbolic)$ +%global __provides_exclude_from %{provide_exclude_format} %define baseline 2.80.5 %define with_systemtap 0 %define keepstatic 1 %define build_dir _build -%define build_dir_kdbus _build_kdbus %define build_dir_symbolic _build_symbolic %define relative_dbus_tests_base_dir %{_libdir}/dbus-tests @@ -170,6 +196,12 @@ Provides: gio = %{version} %description -n libgio GIO provides a modern, easy-to-use VFS API. +%package -n libglib-extension-symbolic +Summary: Extension for libglib to allow the override of internal defined global function. +Requires: libglib = %{version}-%{release} +%if %{?WITH_KDBUS} +Conflicts: libglib-extension-kdbus + %package -n libgio-extension-kdbus Summary: Extension for libgio to support KDBUS in Tizen Requires: libgio = %{version}-%{release} @@ -184,11 +216,7 @@ Conflicts: libglib-extension-symbolic %description -n libglib-extension-kdbus This modifies libgio to support KDBUS in Tizen. - -%package -n libglib-extension-symbolic -Summary: Extension for libglib to allow the override of internal defined global function. -Requires: libglib = %{version}-%{release} -Conflicts: libglib-extension-kdbus +%endif %description -n libglib-extension-symbolic This modifies libglib to allow the override of internal defined global function. @@ -261,18 +289,7 @@ fi -Db_pie=true %meson_build -%define _vpath_builddir %{build_dir_kdbus} -%meson \ - --default-library=both \ -%if %{?WITH_KDBUS} - -Dkdbus=true \ - -Dlibdbuspolicy=true \ -%endif - -Dintrospection=disabled \ - -Dman-pages=false \ - -Dselinux=disabled \ - -Db_pie=true -%meson_build +%{?build_glib_kdbus} # compile test-runner for 'dbus-integration-test' framework %__cc %{_builddir}/%{name}-%{version}/test-runner.c -DTESTS_DIR='"'%{relative_dbus_tests_base_dir}/test-suites/glib-tests'"' -fPIC -pie -o %{_builddir}/%{name}-%{version}/glib-tests @@ -283,10 +300,7 @@ fi %meson_install for FILE in %{buildroot}%{_libdir}/libglib*; do mv "$FILE" "$FILE.extension-symbolic"; done -# kdbus extension install and gather required files -%define _vpath_builddir %{build_dir_kdbus} -%meson_install -for FILE in %{buildroot}%{_libdir}/libgio*[0-9a] %{buildroot}%{_libdir}/libglib*[0-9a]; do mv "$FILE" "$FILE.extension-kdbus"; done +%{?install_glib_kdbus} # normal install overwriting kdbus extension install %define _vpath_builddir %{build_dir} @@ -371,7 +385,7 @@ chmod 755 %{buildroot}%{_bindir}/* %manifest %{name}.manifest %defattr(-, root, root) %license COPYING -%exclude %{_libdir}/libglib*.so.*.extension-kdbus +%{?exclude_libglib_kdbus} %exclude %{_libdir}/libglib*.so.*.extension-symbolic %{_libdir}/libglib*.so.* @@ -403,7 +417,7 @@ chmod 755 %{buildroot}%{_bindir}/* %manifest %{name}.manifest %defattr(-, root, root) %license COPYING -%exclude %{_libdir}/libgio*.so.*.extension-kdbus +%{?exclude_libgio_kdbus} %{_libdir}/libgio*.so.* %dir %{_libdir}/gio %dir %{_libdir}/gio/modules @@ -414,6 +428,7 @@ chmod 755 %{buildroot}%{_bindir}/* %lang_package -f glib20 +%if %{?WITH_KDBUS} %post -n libgio-extension-kdbus pushd %{_libdir} for FILE in libgio*.so.*.extension-kdbus; do mv "$FILE" "${FILE%.extension-kdbus}"; done @@ -433,6 +448,7 @@ popd %manifest %{name}.manifest %license COPYING %{_libdir}/libglib*.so.*.extension-kdbus +%endif %post -n libglib-extension-symbolic pushd %{_libdir} @@ -493,7 +509,7 @@ popd %defattr(-,root,root) %license COPYING %{_libdir}/lib*.a -%{_libdir}/lib*.a.extension-kdbus +%{?include_glib_kdbus_files} %{_libdir}/lib*.a.extension-symbolic %files tests |