This file is indexed.

postinst is in popfile 1.1.3+dfsg-0ubuntu1.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#! /bin/sh

set -e

CONFIGFILE=/etc/popfile/defaults
BACKUPFILE=/var/lib/popfile/backup-$2.tar.gz

. /usr/share/debconf/confmodule

case "$1" in
    configure)

		(

		echo "Creating user (ignore 'already exist' errors)"
		mkdir -p /var/lib/popfile
		adduser --system --home /usr/lib/popfile --no-create-home \
			--group --shell /bin/sh --home /var/lib/popfile popfile \
			|| true >/dev/null

		mkdir -p /var/run/popfile
		chown -R popfile:popfile /var/run/popfile

		mkdir -p /var/log/popfile
		chown -R popfile:popfile /var/log/popfile

		if [ ! -e /var/lib/popfile/stopwords ]
		then
			cp /usr/share/popfile/stopwords /var/lib/popfile/
		fi
		if [ -e /etc/popfile/popfile.cfg ]
		then
			cp -f /etc/popfile/popfile.cfg /var/lib/popfile/
			rm -f /etc/popfile/popfile.cfg
		fi
		chown -R popfile:popfile /var/lib/popfile

		mkdir -p /etc/popfile

		if [ -f /var/lib/popfile/popfile.cfg ]
		then
			chmod o-r /var/lib/popfile/popfile.cfg
		fi

		) 1>&2

		db_get popfile/backupcorpus
		if [ $RET = true ]; then BACKUPCORPUS="yes"
		else BACKUPCORPUS="no"; fi

		db_get popfile/uiport
		UIPORT="$RET"

		db_get popfile/uilocal
		if [ $RET = true ]; then UILOCAL="yes"
		else UILOCAL="no"; fi

		db_get popfile/popport
		POPPORT="$RET"

		db_get popfile/poplocal
		if [ $RET = true ] ; then POPLOCAL="yes"
		else POPLOCAL="no"; fi
		db_stop

		(

		if dpkg --compare-versions "$2" lt-nl "0.22.0" >&2
		then
			if [ "$BACKUPCORPUS" = "yes" -a ! -f $BACKUPFILE ]
			then
				( cd /var/lib/popfile ; \
					tar --ignore-failed-read -zcf $BACKUPFILE \
						corpus messages popfile.cfg popfile.db stopwords )
			fi
		fi

		touch $CONFIGFILE
		for a in UIPORT UILOCAL POPPORT POPLOCAL
		do
			grep -q "^[[:space:]]*$a=.*" $CONFIGFILE \
				|| ( echo ; echo "$a=" ) >> $CONFIGFILE 
		done

		sed -e "s/^[[:space:]]*UIPORT=.*/UIPORT=$UIPORT/" \
			-e "s/^[[:space:]]*UILOCAL=.*/UILOCAL=$UILOCAL/" \
			-e "s/^[[:space:]]*POPPORT=.*/POPPORT=$POPPORT/" \
			-e "s/^[[:space:]]*POPLOCAL=.*/POPLOCAL=$POPLOCAL/" \
				< $CONFIGFILE > $CONFIGFILE.tmp
		mv -f $CONFIGFILE.tmp $CONFIGFILE
		
		) 1>&2

    ;;

    abort-upgrade|abort-remove|abort-deconfigure)

    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# Automatically added by dh_installinit
if [ -x "/etc/init.d/popfile" ]; then
	if [ ! -e "/etc/init/popfile.conf" ]; then
		update-rc.d popfile defaults >/dev/null
	fi
	invoke-rc.d popfile start || exit $?
fi
# End automatically added section


exit 0