update postflight to put the man page in the right place on osx.
[tor/rransom.git] / contrib / polipo / PolipoPostflight
bloba0510bdbd64ee2fb0827af446b77dc0b71ece724
1 #!/bin/sh
3 # PolipoPostflight gets invoked after any install or upgrade.
5 ADDSYSUSER=$RECEIPT_PATH/addsysuser
6 if [ ! -x "$ADDSYSUSER" ]; then
7 echo "Could not find addsysuser script."
8 exit 1
9 fi
11 POLIPOUSER=_polipo
12 POLIPOGROUP=daemon
13 TARGET=$2/Library/Polipo
14 LOGDIR=$TARGET/log
16 # Check defaults for TARGET
17 if [ "$TARGET" == "//Library/Polipo" ]; then
18 TARGET=/Library/Polipo
21 # Create user $POLIPOUSER in group daemon. If it's already there, great.
22 $ADDSYSUSER $POLIPOUSER "Polipo System user" $POLIPODIR
24 # Create the polipo direcpolipoy, if it doesn't exist.
25 if [ ! -d $POLIPODIR ]; then
26 mkdir -p $POLIPODIR
28 if [ ! -d $LOGDIR ]; then
29 mkdir -p $LOGDIR
31 # Check its permissions.
32 chown $POLIPOUSER $POLIPODIR
33 chgrp daemon $POLIPODIR
34 chmod 700 $POLIPODIR
35 chown $POLIPOUSER $LOGDIR
36 chgrp daemon $LOGDIR
37 chmod 700 $LOGDIR
39 # Create the configuration file only if there wasn't one already.
40 if [ ! -f $TARGET/config]; then
41 cp $TARGET/config.osx $TARGET/config
44 cd /usr/share/man/man1
45 MAN1=$TARGET/share/man/man1
47 if [ -d /Library/StartupItems/Polipo ]; then
48 find /Library/StartupItems/Polipo -print0 | xargs -0 chown root:wheel
51 # Copy Uninstaller
52 if [ -f $PACKAGE_PATH/Contents/Resources/uninstall_polipo_bundle.sh ]; then
53 cp $PACKAGE_PATH/Contents/Resources/uninstall_polipo_bundle.sh $TARGET/uninstall_polipo_bundle.sh
54 chmod 755 $TARGET/uninstall_polipo_bundle.sh