diff --git a/gtk3.changes b/gtk3.changes index edb3b00..168aae3 100644 --- a/gtk3.changes +++ b/gtk3.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Aug 25 12:08:36 CEST 2010 - vuntz@opensuse.org + +- Add RPM macros (macros.gtk3) to make it easier to handle + installation of a GTK+ 3 IM module. + ------------------------------------------------------------------- Wed Jul 21 21:14:46 CEST 2010 - vuntz@opensuse.org diff --git a/gtk3.spec b/gtk3.spec index 2986af3..e374b29 100644 --- a/gtk3.spec +++ b/gtk3.spec @@ -21,7 +21,7 @@ Name: gtk3 %define _name gtk+ Version: 2.90.5 -Release: 1 +Release: 2 # FIXME: 2.90.5 doesn't compile with parallel build (bgo#624304). Check if this is still true for later versions. License: LGPLv2.1+ Summary: The GTK+ toolkit library (version 3) @@ -30,6 +30,7 @@ Group: System/Libraries Source: ftp://ftp.gnome.org/pub/GNOME/sources/%{_name}/2.90/%{_name}-%{version}.tar.bz2 Source1: README.SUSE Source2: gtkrc +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 @@ -169,6 +170,9 @@ touch %{buildroot}%{_libdir}/gtk-3.0/3.0.0/immodules.cache mv %{buildroot}%{_bindir}/gtk-query-immodules-3.0 %{buildroot}%{_bindir}/gtk-query-immodules-3.0-64 mv %{buildroot}%{_mandir}/man1/gtk-query-immodules-3.0.1 %{buildroot}%{_mandir}/man1/gtk-query-immodules-3.0-64.1 %endif +# Install rpm macros +mkdir -p %{buildroot}%{_sysconfdir}/rpm +cp %{S:3} %{buildroot}%{_sysconfdir}/rpm %fdupes %{buildroot}%{_datadir} %fdupes %{buildroot}%{_libdir} @@ -272,5 +276,6 @@ fi %{_libdir}/libgailutil-3.0.so %{_libdir}/libgdk-x11-3.0.so %{_libdir}/libgtk-x11-3.0.so +%{_sysconfdir}/rpm/macros.gtk3 %changelog diff --git a/macros.gtk3 b/macros.gtk3 new file mode 100644 index 0000000..3e0938b --- /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 > {_sysconfdir}/gtk.immodules \ +%else \ + %{_bindir}/gtk-query-immodules-3.0 > {_sysconfdir}/gtk64.immodules \ +%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 > {_sysconfdir}/gtk.immodules \ + %else \ + %{_bindir}/gtk-query-immodules-3.0 > {_sysconfdir}/gtk64.immodules \ + %endif \ +fi