aboutsummaryrefslogtreecommitdiffstats
path: root/news/cleanfeed/pkg-install
blob: b86daaaa90b97a46e077e59f9313ebdadc6b557c (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
#!/bin/sh

PKGNAME=$1
[ ! -n "${PKG_PREFIX}" ] && exit 1

CONFFILE="${PKG_PREFIX}/news/cleanfeed/etc/cleanfeed.local"

case $2 in
    POST-INSTALL)
    cd ${PKG_PREFIX}/news/bin/filter \
        && mv filter_innd.pl filter_innd.pl.orig \
        && ln -s cleanfeed filter_innd.pl
    mkdir -p /var/log/cleanfeed
    chown news:news /var/log/cleanfeed
    test -f ${CONFFILE} || cp -p ${CONFFILE}.sample ${CONFFILE}
    ;;
    DEINSTALL)
    cmp -s ${CONFFILE}.sample ${CONFFILE} && rm -f ${CONFFILE}
    ;;
    POST-DEINSTALL)
    cd ${PKG_PREFIX}/news/bin/filter \
        && mv filter_innd.pl.orig filter_innd.pl
    rmdir /var/log/cleanfeed
    ;;
esac
exit 0