infodir=usr/share/info
filelist=(beta.info.gz custom.info.gz 
	  emodules.info.gz external-widget.info.gz 
	  internals.info-1.gz internals.info-2.gz 
	  internals.info-3.gz internals.info-4.gz 
	  internals.info-5.gz internals.info.gz 
	  lispref.info-1.gz lispref.info-10.gz 
	  lispref.info-2.gz lispref.info-3.gz 
	  lispref.info-4.gz lispref.info-5.gz 
	  lispref.info-6.gz lispref.info-7.gz 
	  lispref.info-8.gz lispref.info-9.gz 
	  lispref.info.gz new-users-guide.info.gz 
	  term.info.gz termcap.info.gz 
	  xemacs-faq.info-1.gz xemacs-faq.info-2.gz 
	  xemacs-faq.info.gz xemacs.info-1.gz 
	  xemacs.info-2.gz xemacs.info-3.gz 
	  xemacs.info-4.gz xemacs.info.gz)

post_install() {
  for file in ${filelist[@]}; do
    install-info $infodir/$file $infodir/dir 2> /dev/null
  done
  update-desktop-database -q
}

post_upgrade() {
  post_install $1
}

pre_remove() {
  for file in ${filelist[@]}; do
    install-info --delete $infodir/$file $infodir/dir 2> /dev/null
  done
  update-desktop-database -q
}
