From a6f88842ed301b1555d89ea3b1da1e55e66a047f6b7b538758f520361ebba7da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Lie?= Date: Tue, 21 Mar 2023 09:35:09 +0000 Subject: [PATCH] Accepting request 1073484 from GNOME:Next - Re-add macros.gtk3: there are quite a few consumers left requiring the defined macros. OBS-URL: https://build.opensuse.org/request/show/1073484 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gtk3?expand=0&rev=430 --- gtk3.changes | 6 ++++++ gtk3.spec | 6 ++++++ macros.gtk3 | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 macros.gtk3 diff --git a/gtk3.changes b/gtk3.changes index d9143ee..f7200b2 100644 --- a/gtk3.changes +++ b/gtk3.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Mar 21 08:43:48 UTC 2023 - Dominique Leuenberger + +- Re-add macros.gtk3: there are quite a few consumers left + requiring the defined macros. + ------------------------------------------------------------------- Tue Mar 7 00:21:45 UTC 2023 - Luciano Santos diff --git a/gtk3.spec b/gtk3.spec index dddb364..c69c934 100644 --- a/gtk3.spec +++ b/gtk3.spec @@ -39,6 +39,7 @@ URL: https://www.gtk.org/ Source0: %{_name}-%{version}.tar.xz Source1: README.SUSE Source2: settings.ini +Source3: macros.gtk3 Source99: baselibs.conf # PATCH-FIX-OPENSUSE gtk3-GTK_PATH64.patch sbrabec@novell.com - 64-bit dual install. Use GTK_PATH64 environment variable instead of GTK_PATH Patch0: gtk3-GTK_PATH64.patch @@ -447,6 +448,10 @@ mv %{buildroot}%{_mandir}/man1/gtk-update-icon-cache.1 \ ln -s -f %{_sysconfdir}/alternatives/gtk-update-icon-cache.1%{ext_man} \ %{buildroot}%{_mandir}/man1/gtk-update-icon-cache.1%{ext_man} +# Install rpm macros +mkdir -p %{buildroot}%{_rpmmacrodir} +cp %{SOURCE3} %{buildroot}%{_rpmmacrodir} + %fdupes %{buildroot}%{_datadir} %fdupes %{buildroot}%{_libdir} @@ -648,6 +653,7 @@ fi %{_libdir}/libgailutil-3.so %{_libdir}/libgdk-3.so %{_libdir}/libgtk-3.so +%{_rpmmacrodir}/macros.gtk3 %files -n gettext-its-%{name} %dir %{_datadir}/gettext/ diff --git a/macros.gtk3 b/macros.gtk3 new file mode 100644 index 0000000..3d4a650 --- /dev/null +++ b/macros.gtk3 @@ -0,0 +1,35 @@ +# RPM macros for packages installing a GTK+ IM module +# +### +# +# When a package installs a GTK+ IM module, it should use all +# three macros: +# +# - %gtk3_immodule_requires in the preamble +# - %gtk3_immodule_post in %post +# - %gtk3_immodule_postun in %postun +# +### + +%gtk3_immodule_requires \ +Requires(post): gtk3-tools \ +Requires(postun): gtk3-tools + +# On install, update the cache +%gtk3_immodule_post \ +%if "%_lib" == "lib64" \ + %{_bindir}/gtk-query-immodules-3.0-64 --update-cache \ +%else \ + %{_bindir}/gtk-query-immodules-3.0 --update-cache \ +%endif + +# On uninstall, update the cache. Note: we ignore upgrades (already +# handled in %post of the new package). +%gtk3_immodule_postun \ +if [ $1 -eq 0 ]; then \ + %if "%_lib" == "lib64" \ + %{_bindir}/gtk-query-immodules-3.0-64 --update-cache \ + %else \ + %{_bindir}/gtk-query-immodules-3.0 --update-cache \ + %endif \ +fi