Back up scriptlets to sync Fedoras

This commit is contained in:
Takao Fujiwara 2018-01-17 18:05:35 +09:00
parent a84a8374f0
commit 03f1724cae

View File

@ -9,6 +9,12 @@
%global with_kde5 0 %global with_kde5 0
%endif %endif
%if (0%{?fedora} > 27 || 0%{?rhel} > 7)
%global with_gtk_script 0
%else
%global with_gtk_script 1
%endif
%global with_emoji_harfbuzz 1 %global with_emoji_harfbuzz 1
%global ibus_api_version 1.0 %global ibus_api_version 1.0
@ -312,14 +318,28 @@ desktop-file-install --delete-original \
%find_lang %{name}10 %find_lang %{name}10
%post %post
%if %with_gtk_script
# recreate icon cache
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%endif
%{_sbindir}/alternatives --install %{_sysconfdir}/X11/xinit/xinputrc xinputrc %{_xinputconf} 83 || : %{_sbindir}/alternatives --install %{_sysconfdir}/X11/xinit/xinputrc xinputrc %{_xinputconf} 83 || :
%postun %postun
if [ "$1" -eq 0 ]; then if [ "$1" -eq 0 ]; then
%if %with_gtk_script
# recreate icon cache
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%endif
%{_sbindir}/alternatives --remove xinputrc %{_xinputconf} || : %{_sbindir}/alternatives --remove xinputrc %{_xinputconf} || :
# if alternative was set to manual, reset to auto # if alternative was set to manual, reset to auto
[ -L %{_sysconfdir}/alternatives/xinputrc -a "`readlink %{_sysconfdir}/alternatives/xinputrc`" = "%{_xinputconf}" ] && %{_sbindir}/alternatives --auto xinputrc || : [ -L %{_sysconfdir}/alternatives/xinputrc -a "`readlink %{_sysconfdir}/alternatives/xinputrc`" = "%{_xinputconf}" ] && %{_sbindir}/alternatives --auto xinputrc || :
%if %with_gtk_script
glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || :
%endif
# 'dconf update' sometimes does not update the db... # 'dconf update' sometimes does not update the db...
dconf update || : dconf update || :
[ -f %{_sysconfdir}/dconf/db/ibus ] && \ [ -f %{_sysconfdir}/dconf/db/ibus ] && \
@ -330,6 +350,10 @@ if [ "$1" -eq 0 ]; then
fi fi
%posttrans %posttrans
%if %with_gtk_script
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || :
%endif
dconf update || : dconf update || :
[ -x %{_bindir}/ibus ] && \ [ -x %{_bindir}/ibus ] && \
%{_bindir}/ibus write-cache --system &>/dev/null || : %{_bindir}/ibus write-cache --system &>/dev/null || :
@ -338,6 +362,37 @@ dconf update || :
%postun libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig
%if %with_gtk_script
%post gtk2
if [ $1 -eq 1 ] ; then
# For upgrades, the cache will be regenerated by the new package's %%postun
gtk-query-immodules-2.0-%{__isa_bits} --update-cache &> /dev/null || :
fi
%endif
%if %with_gtk_script
%postun gtk2
gtk-query-immodules-2.0-%{__isa_bits} --update-cache &> /dev/null || :
%endif
%if %with_gtk_script
%post gtk3
if [ $1 -eq 1 ] ; then
# For upgrades, the cache will be regenerated by the new package's %%postun
gtk-query-immodules-3.0-%{__isa_bits} --update-cache &> /dev/null || :
fi
%endif
%if %with_gtk_script
%postun gtk3
gtk-query-immodules-3.0-%{__isa_bits} --update-cache &> /dev/null || :
%endif
# FIXME: no version number # FIXME: no version number
%files -f %{name}10.lang %files -f %{name}10.lang
%doc AUTHORS COPYING README %doc AUTHORS COPYING README