diff --git a/macros.shared-mime-info b/macros.shared-mime-info index 3766641..eccb67c 100644 --- a/macros.shared-mime-info +++ b/macros.shared-mime-info @@ -15,27 +15,10 @@ # ### -# On install, update the mime database +# macros are place holders to not unnescessarily break packages; package converted to file triggers %mime_database_post() \ -export PKGSYSTEM_ENABLE_FSYNC=0 \ -if test -x %{_bindir}/update-mime-database; then \ -%if "x%1" != "x%%1" \ - %{_bindir}/update-mime-database "%1" || true \ -%else \ - %{_bindir}/update-mime-database "%{_datadir}/mime" || true \ -%endif \ -fi +%nil -# On uninstall, update the mime database. Note: we ignore upgrades (already -# handled in %post of the new package). +# macros are place holders to not unnescessarily break packages; package converted to file triggers %mime_database_postun() \ -export PKGSYSTEM_ENABLE_FSYNC=0 \ -if [ $1 -eq 0 ]; then \ - if test -x %{_bindir}/update-mime-database; then \ -%if "x%1" != "x%%1" \ - %{_bindir}/update-mime-database "%1" || true \ -%else \ - %{_bindir}/update-mime-database "%{_datadir}/mime" || true \ -%endif \ - fi \ -fi +%nil diff --git a/shared-mime-info.changes b/shared-mime-info.changes index 986df04..6f5ee22 100644 --- a/shared-mime-info.changes +++ b/shared-mime-info.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Tue Jun 27 11:09:32 UTC 2017 - dimstar@opensuse.org + +- Replace %mime_database_post/postun with respective file triggers + in shared-mime-info: any file put into /usr/share/mime will + trigger the execution of the script. In order to not break the + macros short-term they are being redefined to %nil. +- Drop redundant %clean section. + ------------------------------------------------------------------- Wed Dec 7 11:37:38 UTC 2016 - dimstar@opensuse.org diff --git a/shared-mime-info.spec b/shared-mime-info.spec index 276281d..c1e3a7c 100644 --- a/shared-mime-info.spec +++ b/shared-mime-info.spec @@ -1,7 +1,7 @@ # # spec file for package shared-mime-info # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -73,12 +73,13 @@ install -D -m644 %{S:2} %{buildroot}%{_sysconfdir}/rpm/macros.shared-mime-info %check make check -%clean -rm -rf $RPM_BUILD_ROOT - -%post +%filetriggerin -- %{_datadir}/mime export PKGSYSTEM_ENABLE_FSYNC=0 -%{_bindir}/update-mime-database %{_datadir}/mime || true +%{_bindir}/update-mime-database "%{_datadir}/mime" + +%filetriggerpostun -- %{_datadir}/mime +export PKGSYSTEM_ENABLE_FSYNC=0 +[ -x %{_bindir}/update-mime-database ] && %{_bindir}/update-mime-database "%{_datadir}/mime" %files %defattr (-, root, root)