b6b38fcf1b
- Update to version 1.6: + Add XAR archive mime-type. + Add GeoJSON mime-type. + Add GPX mime-type. + Add xdg-app mime-type. + Add *.xht glob and magic for XHTML files. + Bump priority of archive mime-types with long magics, to avoid false positives when detecting files inside the archive itself. - Drop xz BuildRequires: this is already part of default build setups for a long time. - Drop workaround for fdo#70366 (that is, no longer export ac_cv_func_fdatasync=no). - Add PKGSYSTEM_ENABLE_FSYNC=0 to mime_database_post and mime_database_postun macros, which is the upstream provided way to opt-out of the fdatasync call. That variable is checked for since version 1.4. - Add PKGSYSTEM_ENABLE_FSYNC=0 to post script (as we do can't use the macros we install with the package there). OBS-URL: https://build.opensuse.org/request/show/364094 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/shared-mime-info?expand=0&rev=52
42 lines
1.8 KiB
Plaintext
42 lines
1.8 KiB
Plaintext
# RPM macros for packages installing a MIME type according to the XDG specification
|
|
#
|
|
###
|
|
#
|
|
# When a package installs a MIME type as per the XDG specification, it should
|
|
# use both macros:
|
|
#
|
|
# - %mime_database_post in %post
|
|
# - %mime_database_postun in %postun
|
|
#
|
|
# Note that these macros can optionally take as argument the directory
|
|
# where the MIME type is installed. If no argument is passed, then
|
|
# %{_datadir}/mime will be used (which is where applications usually install
|
|
# the MIME type information).
|
|
#
|
|
###
|
|
|
|
# On install, update the mime database
|
|
%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
|
|
|
|
# On uninstall, update the mime database. Note: we ignore upgrades (already
|
|
# handled in %post of the new package).
|
|
%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
|