diff options
author | James Meyer <james.meyer@operamail.com> | 2008-11-09 02:33:06 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2008-11-09 02:33:06 (GMT) |
commit | 1ba69cc033dfbd0a6c4c29c6d877c7e753f96e8e (patch) | |
tree | f336ee91ce16c6591fff50340562e07e15aa1a55 /abs/mv-core/lighttpd/lighttpd.install | |
parent | 75b1bceb21faab32d8f519d6f7f7062a226f9047 (diff) | |
download | linhes_pkgbuild-1ba69cc033dfbd0a6c4c29c6d877c7e753f96e8e.zip linhes_pkgbuild-1ba69cc033dfbd0a6c4c29c6d877c7e753f96e8e.tar.gz linhes_pkgbuild-1ba69cc033dfbd0a6c4c29c6d877c7e753f96e8e.tar.bz2 |
MythVantage specific pkgs
Diffstat (limited to 'abs/mv-core/lighttpd/lighttpd.install')
-rw-r--r-- | abs/mv-core/lighttpd/lighttpd.install | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/abs/mv-core/lighttpd/lighttpd.install b/abs/mv-core/lighttpd/lighttpd.install new file mode 100644 index 0000000..1055e4b --- /dev/null +++ b/abs/mv-core/lighttpd/lighttpd.install @@ -0,0 +1,80 @@ +post_install() { + # set post_install message + /bin/cat << EOM + + --> This release marks a minor (NOT micro!) version change and is not 100% + --> compatible with former versions. Have a look at the new lighttpd.conf, + --> there are some changes in the index files syntax and nested conditions + --> are possible by now. Also please read the documentation in + --> /usr/share/lighttpd or on lighttpds's hompage: http://lighttpd.org + + --> for the following OPTIONAL modules (when choosen from lighttpd.conf) + --> you will need the following dependencies: + mod_webdav : libxml2, sqlite3 + mod_cml: libmemcache, lua + mod_trigger_b4_dl: libmemcache, gdbm + mod_auth.so: libldap + mod_mysql_vhost: libmysqlclient + +EOM + + # import daemon configuration file to detect lighttpd.conf location + [ -f /etc/conf.d/lighttpd ] && . /etc/conf.d/lighttpd + # some automagic dealing with the users preferences as marked in + # /etc/lighttpd/lighttpd.conf + # a simple conf-file parser to isolate the user, logfiles etc. + FILES=`sed -n -e '/accesslog\.filename/p;/server\.errorlog/p' \ + ${DAEMON_CONF} \ + | sed -e 's/^.*"\(.*\)".*$/\1/'` + DAEMON_USER=`sed -n -e '/server\.username/p' ${DAEMON_CONF} \ + | sed -e 's/^.*"\(.*\)".*$/\1/'` + DAEMON_GROUP=`sed -n -e '/server\.groupname/p' ${DAEMON_CONF} \ + | sed -e 's/^.*"\(.*\)".*$/\1/'` + DIRECTORIES=`sed -n -e '/\.cache-dir/p;/\.server-root/p' ${DAEMON_CONF} \ + | sed -e 's/^.*"\(.*\)".*$/\1/'` + DOCROOTDIRS=`sed -n -e '/server.\document-root/p' ${DAEMON_CONF} \ + | sed -e 's/^.*"\(.*\)".*$/\1/'` + CHROOT=`sed -n -e '/server\.chroot/p' ${DAEMON_CONF} \ + | sed -e '/^ *#.*$/d' \ + | sed -e 's/^.*"\(.*\)".*$/\1/'` + + touch /tmp/empty + # make sure logfiles exist + for FILE in $FILES; do + [ ! -f ${CHROOT}${FILE} ] && \ + install -Dm644 -o $DAEMON_USER -g $DAEMON_GROUP /tmp/empty ${CHROOT}${FILE} && \ + echo 'Creating file ' ${CHROOT}${FILE} + done + # make sure the lighttpd.user owns the cache dirs and vhost-root ... + for DIR in $DIRECTORIES; do + [ ! -d ${CHROOT}${DIR} ] && \ + install -dm755 -o $DAEMON_USER -g $DAEMON_GROUP ${CHROOT}${DIR} && \ + echo "Creating directory ${CHROOT}${DIR}" && \ + chown $DAEMON_USER:$DAEMON_GROUP ${CHROOT}${DIR} + done + # ... and the document roots + for DIR in $DOCROOTDIRS; do + [ ! -d ${CHROOT}${DIR} ] && \ + install -dm755 -o $DAEMON_USER -g $DAEMON_GROUP ${CHROOT}${DIR} && \ + echo "Creating directory ${CHROOT}${DIR}" + chown -R $DAEMON_USER:$DAEMON_GROUP ${CHROOT}${DIR} + done + rm -f /tmp/empty +} + +post_upgrade() { + cp /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.old + cp /etc/lighttpd/lighttpd.conf.pacnew /etc/lighttpd/lighttpd.conf + if [ -f /usr/bin/php ] +then + cp /etc/lighttpd/lighttpd.conf /tmp + sed -e "s/# .* \"mod_fastcgi\",/\"mod_fastcgi\"\,/g" /tmp/lighttpd.conf > /etc/lighttpd/lighttpd.conf + +fi + post_install $1 +} + +op=$1 +shift +$op $* +# vim: ft=sh ts=2 |