magic-symlink 638 B

123456789101112131415161718192021222324252627
  1. #!/bin/sh
  2. set -e
  3. HOST_ARCH="$1"
  4. HOST_MULTIARCH="$2"
  5. # Create /usr/share/file/magic.mgc as a symlink if the installed
  6. # libmagic1 is in the primary architecture.
  7. [ "$HOST_MULTIARCH" ]
  8. cat <<__EOS__ >>debian/libmagic1.postinst.debhelper
  9. if [ "\$1" = 'configure' ] && [ "\$(dpkg --print-architecture)" = '$HOST_ARCH' ] ; then
  10. ln -sf /usr/lib/$HOST_MULTIARCH/file/magic.mgc /usr/share/file/magic.mgc
  11. fi
  12. __EOS__
  13. cat <<__EOS__ >>debian/libmagic1.prerm.debhelper
  14. if [ "\$1" = 'configure' ] && [ "\$(dpkg --print-architecture)" = '$HOST_ARCH' ] && [ -L /usr/share/file/magic.mgc ] ; then
  15. rm /usr/share/file/magic.mgc
  16. fi
  17. __EOS__