codepot/codepot/DEBIAN/postinst.in

33 lines
1.0 KiB
Plaintext
Raw Normal View History

2010-01-24 14:34:03 +00:00
#!/bin/sh
# create directories not handled by make install
[ -d "@CACHEDIR@" ] || { mkdir -p "@CACHEDIR@" && cachedir=1; }
[ -d "@LOGDIR@" ] || { mkdir -p "@LOGDIR@" && logdir=1; }
[ -d "@DEPOTDIR@/svnrepo" ] || { mkdir -p "@DEPOTDIR@/svnrepo" && svnrepodir=1; }
[ -d "@DEPOTDIR@/files" ] || { mkdir -p "@DEPOTDIR@/files" && filesdir=1; }
[ -d "@DEPOTDIR@/attachments" ] || { mkdir -p "@DEPOTDIR@/attachments" && attachmentsdir=1; }
2010-01-24 14:34:03 +00:00
[ -f "@SYSCONFDIR@/apache2/envvars" ] && {
GROUP=$(. "@SYSCONFDIR@/apache2/envvars" && echo "${APACHE_RUN_GROUP}")
[ -n "${GROUP}" ] && {
[ "${cachedir}" = "1" ] && {
chgrp -R "${GROUP}" "@CACHEDIR@"
chmod 0775 "@CACHEDIR@"
}
[ "${logdir}" = "1" ] && {
chgrp -R "${GROUP}" "@LOGDIR@"
chmod 0775 "@LOGDIR@"
}
[ "${svnrepodir}" = "1" ] && {
chgrp -R "${GROUP}" "@DEPOTDIR@/svnrepo"
chmod 0775 "@DEPOTDIR@/svnrepo"
}
[ "${attachmentsdir}" = "1" ] && {
chgrp -R "${GROUP}" "@DEPOTDIR@/attachments"
chmod 0775 "@DEPOTDIR@/attachments"
2010-01-24 14:34:03 +00:00
}
}
}
exit 0