aboutsummaryrefslogtreecommitdiffstats
path: root/french/plgrenouille/pkg-install
blob: 6cfb4ecc971b3b58be08a0611c19ad403dee9aff (plain) (blame)
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
#!/bin/sh
#
# $FreeBSD$
#
# Configure plgrenouille.
#

[ $# != 2 ] && exit 1
[ -z "${PKG_PREFIX}" ] && exit 1

PORTNAME=plgrenouille
SPOOL_DIR=/var/spool/${PORTNAME}
SPOOL_MODES=u+rw,go-rw
SPOOL_USER=daemon

case "$2" in
POST-INSTALL)
    if [ ! -d ${SPOOL_DIR} ]; then
        mkdir -p ${SPOOL_DIR} &&
        chmod ${SPOOL_MODES} ${SPOOL_DIR} &&
        chown ${SPOOL_USER} ${SPOOL_DIR}
    fi
    [ -n "${BATCH}" ] && exit 0
    [ -f ${PKG_PREFIX}/etc/rc.d/plgrenouille.sh ] &&
    sh ${PKG_PREFIX}/etc/rc.d/plgrenouille.sh configure
    ;;
POST-DEINSTALL)
    if [ -d ${SPOOL_DIR} ]; then
        rm -rf ${SPOOL_DIR}
    fi
    ;;
esac

exit 0