No edit summary |
|||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Anchor|mimeinfo}} | {{Anchor|mimeinfo}} | ||
NOTE: This Draft would be for fedora | NOTE: This Draft would be for fedora 19 and newer (and possibly anywhere we could patch shared-mime-info package to accept the new -n option). Anything else (like EPEL) would likely need to keep the old guideline. | ||
Line 7: | Line 7: | ||
<pre> | <pre> | ||
%post | %post | ||
touch --no-create %{_datadir}/mime/packages ||: | /bin/touch --no-create %{_datadir}/mime/packages &>/dev/null || : | ||
%postun | %postun | ||
if [ $1 -eq 0 ] ; then | if [ $1 -eq 0 ] ; then | ||
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || : | |||
/usr/bin/update-mime-database %{_datadir}/mime | |||
fi | fi | ||
%posttrans | %posttrans | ||
/usr/bin/update-mime-database %{_datadir}/mime | /usr/bin/update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || : | ||
</pre> | </pre> | ||
Latest revision as of 17:05, 9 October 2014
NOTE: This Draft would be for fedora 19 and newer (and possibly anywhere we could patch shared-mime-info package to accept the new -n option). Anything else (like EPEL) would likely need to keep the old guideline.
mimeinfo
Use this when a package drops an XML file in %{_datadir}/mime/packages.
%post /bin/touch --no-create %{_datadir}/mime/packages &>/dev/null || : %postun if [ $1 -eq 0 ] ; then /usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || : fi %posttrans /usr/bin/update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
Note that similarly to the gtk-update-icon-cache code, these scriptlets should be run only if the user has update-mime-info installed and without a specific Requires: shared-mime-info. If shared-mime-info is not installed, update-mime-database won't be run when this package is installed. This does not matter because it will be run when the shared-mime-info package is installed.