freebsd-ports/www/raqdevil/pkg-install
Martin Wilke 2cd7591552 - Unbreak
- Remove EXPIRATION_DATE
- Fix plist
- Set NO_PACKAGE as workaround for pointyhat and tinderbox.

Notes: we work on a correct patchset with the authors :)

PR:		111460
Submitted by:	Cstdenis <cstdenis@ctgameinfo.com>
Thanks to:      netchild@, mike (co author), and many other guys for helping
Approved by:	Devon H. O'Dell (maintainer)
2007-04-11 19:23:37 +00:00

57 lines
1.4 KiB
Bash

#!/bin/sh
PREF=${PREFIX:-$PKG_PREFIX}
PATH=/bin:/usr/sbin:/usr/bin
case $2 in
POST-INSTALL)
GROUP=users
if pw group show "${GROUP}" 2>/dev/null; then
echo "You already have a group \"${GROUP}\", so I will use it."
else
if pw groupadd ${GROUP}; then
echo "Added group \"${GROUP}\"."
else
echo "Adding group \"${GROUP}\" failed..."
exit 1
fi
fi
${TOUCH} /etc/mail/access;
mkdir -p ${PREF}/raqdevil/ui/web/base/sitestats/img;
chown www:wheel ${PREF}/raqdevil/ui/web/base/sitestats/img;
mkdir -p ${PREF}/raqdevil/sessions;
${TOUCH} ${PREF}/etc/apache2/httpd.local.conf
${TOUCH} ${PREF}/etc/apache2/httpd.raqdevil.conf
# generate certificates if required
CERTPATH=${PREF}/admserv/certs
KEYPATH=${CERTPATH}/key
CSRPATH=${CERTPATH}/request
CRTPATH=${CERTPATH}/certificate
mkdir -p ${CERTPATH}
if [ ! -f ${KEYPATH} ]; then
openssl genrsa -out ${KEYPATH} 2048
fi
if [ ! -f ${CSRPATH} ]; then
openssl req -new -key ${KEYPATH} -out ${CSRPATH}
fi
if [ ! -f ${CRTPATH} ]; then
openssl x509 -req -days 365 -in ${CSRPATH} -signkey ${KEYPATH} -out ${CRTPATH}
fi
# fix up the apache httpd.conf file using database values
# probably should use /usr/local/raqdevil/bin/cce_construct instead
# to make a package install work correctly
${PREF}/raqdevil/constructor/base/apache/processAdvise.pl
( cd /etc/namedb; sh /etc/namedb/make-localhost )
;;
esac