post_install() {
  XDG_DATA_DIRS=/mingw32/share mingw32/bin/update-mime-database mingw32/share/mime > /dev/null 2>&1
}

post_upgrade() {
  post_install
}

post_remove() {
  if [ -d mingw32/share/mime ]; then
    rm -f mingw32/share/mime/{globs,globs2,icons,treemagic,generic-icons,types,magic,XMLnamespaces,subclasses,aliases,mime.cache}
    rm -rf mingw32/share/mime/{application,audio,image,inode,message,model,multipart,text,video,x-content,x-epoc}
    rmdir --ignore-fail-on-non-empty mingw32/share/mime
  fi
}
