#!/bin/sh CONFIGFILE=/etc/libcifpp.conf set -e if [ -e /usr/share/debconf/confmodule ] ; then . /usr/share/debconf/confmodule export debconfavailable="yes" fi SHARE_DIR=/usr/share/libcifpp CACHE_DIR=/var/cache/libcifpp case "$1" in configure) # Generate config file, if it doesn't exist. if [ ! -e $CONFIGFILE ]; then echo "# Config file for my libcifpp" > $CONFIGFILE echo "# To automatically update the mmcif_pdbx.dic file, use true or false" >> $CONFIGFILE echo "update=false" >> $CONFIGFILE fi # Substitute in the values from the debconf db. db_get libcifpp/update update="$RET" cp -a -f $CONFIGFILE $CONFIGFILE.tmp test -z "$update" || grep -Eq '^ *update=' $CONFIGFILE || \ echo "update=false" >> $CONFIGFILE sed -e "s/^ *update=.*/update=\"$update\"/" \ < $CONFIGFILE > $CONFIGFILE.tmp mv -f $CONFIGFILE.tmp $CONFIGFILE if ! [ -f ${CACHE_DIR}/mmcif_pdbx.dic ]; then install -d -m755 ${CACHE_DIR}; install -m644 ${SHARE_DIR}/mmcif_pdbx.dic ${CACHE_DIR}/mmcif_pdbx.dic; fi # run the update /etc/cron.weekly/update-libcifpp-data ;; esac #DEBHELPER#