post_install() {
  sed -e '/\/opt\/grass-*/d' -i /etc/ld.so.conf
  echo '/opt/grass/lib' >> etc/ld.so.conf
  sbin/ldconfig -r .
}

post_upgrade() {
  post_install $1
}

pre_remove() {
  sed -e '/\/opt\/grass-*\/lib/d' -i /etc/ld.so.conf
  sbin/ldconfig -r .
}