diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-05-02 08:43:52 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-05-02 08:51:59 +0000 |
commit | c08ec0cafaaf25b4c83499fac69819b919354f45 (patch) | |
tree | 35784317d7ee4d27daf6e57d4726e14ab2ab8109 | |
parent | 9d0eac076fd40cc142247a8235a4d8f1b67a35f8 (diff) | |
download | aports-c08ec0cafaaf25b4c83499fac69819b919354f45.tar.bz2 aports-c08ec0cafaaf25b4c83499fac69819b919354f45.tar.xz |
main/mini_httpd: move config to /etc/mini_httpd/
and provide upgrade path
-rw-r--r-- | main/mini_httpd/APKBUILD | 9 | ||||
-rw-r--r-- | main/mini_httpd/mini_httpd.conf.sample | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | main/mini_httpd/mini_httpd.initd | 6 | ||||
-rw-r--r-- | main/mini_httpd/mini_httpd.pre-install | 9 | ||||
l--------- | main/mini_httpd/mini_httpd.pre-upgrade | 1 |
5 files changed, 20 insertions, 7 deletions
diff --git a/main/mini_httpd/APKBUILD b/main/mini_httpd/APKBUILD index c62aec1398..eef36c5235 100644 --- a/main/mini_httpd/APKBUILD +++ b/main/mini_httpd/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=mini_httpd pkgver=1.19 -pkgrel=6 +pkgrel=7 pkgdesc="Small forking webserver with ssl and ipv6 support" url="http://www.acme.com/software/mini_httpd/" arch="all" @@ -9,6 +9,7 @@ license="BSD" depends="logrotate" makedepends="openssl-dev" subpackages="$pkgname-doc" +install="$pkgname.pre-install $pkgname.pre-upgrade" source="http://www.acme.com/software/mini_httpd/$pkgname-$pkgver.tar.gz $pkgname.conf.sample $pkgname.initd @@ -35,7 +36,7 @@ build() { mkdir -p "$pkgdir"/var/www/localhost/htdocs install -D -m644 ../mini_httpd.conf.sample \ - "$pkgdir"/etc/mini_httpd.conf + "$pkgdir"/etc/mini_httpd/mini_httpd.conf install -D -m755 ../mini_httpd.initd "$pkgdir"/etc/init.d/mini_httpd install -D -m644 ../mini_httpd.logrotate \ "$pkgdir"/etc/logrotate.d/mini_httpd @@ -43,6 +44,6 @@ build() { } md5sums="7c68293ad265ecfe2edea917912f6f1f mini_httpd-1.19.tar.gz -bca5b3b1cdc00cf31f0b54797518b893 mini_httpd.conf.sample -02a9a415c365aa40c27211afbaa545c7 mini_httpd.initd +2cd6630a7e19461b31a93504a8b6b24b mini_httpd.conf.sample +3272107de6b7e832f4d0bac7ff76ec12 mini_httpd.initd 915683e9c7e1cef7ce9b1bbaa31ab680 mini_httpd.logrotate" diff --git a/main/mini_httpd/mini_httpd.conf.sample b/main/mini_httpd/mini_httpd.conf.sample index 002f4f0c7e..0ca98e0e88 100644 --- a/main/mini_httpd/mini_httpd.conf.sample +++ b/main/mini_httpd/mini_httpd.conf.sample @@ -27,8 +27,6 @@ dir=/var/www/localhost/htdocs chroot #nochroot ## -## The init.d script will override logfile here, so you need to set the -## MINI_HTTPD_OPTS in /etc/conf.d/ in order to enable the logfile option here #logfile=/var/log/mini_httpd/mini_httpd.log ## #charset=iso-8859-1 diff --git a/main/mini_httpd/mini_httpd.initd b/main/mini_httpd/mini_httpd.initd index ad1917be3e..6e84a18b65 100644..100755 --- a/main/mini_httpd/mini_httpd.initd +++ b/main/mini_httpd/mini_httpd.initd @@ -11,10 +11,14 @@ depend() { } start() { + local logfile=$(awk -F= '$1 == "logfile" { print $2 }' /etc/mini_httpd/${SVCNAME}.conf 2>/dev/null) + : ${logfile:=/var/log/mini_httpd/${SVCNAME}.log} + checkpath -d ${pidfile%/*} + checkpath -d ${logfile%/*} ebegin "Starting $SVCNAME" start-stop-daemon --quiet --start --exec /usr/sbin/mini_httpd \ --pidfile $pidfile -- -i $pidfile \ - ${MINI_HTTPD_OPTS:--C /etc/${SVCNAME}.conf -l /var/log/mini_httpd/${SVCNAME}.log} + ${MINI_HTTPD_OPTS:--C /etc/${SVCNAME}.conf -l ${logfile}} eend $? } diff --git a/main/mini_httpd/mini_httpd.pre-install b/main/mini_httpd/mini_httpd.pre-install new file mode 100644 index 0000000000..6f8eaae18c --- /dev/null +++ b/main/mini_httpd/mini_httpd.pre-install @@ -0,0 +1,9 @@ +#!/bin/sh + +# move config if needed and create compat symlink +if [ -f /etc/mini_httpd.conf ] && ! [ -L /etc/mini_httpd.conf ]; then + mkdir -p /etc/mini_httpd + mv /etc/mini_httpd.conf /etc/mini_httpd/mini_httpd.conf \ + && ln -s mini_httpd/mini_httpd.conf /etc/mini_httpd.conf +fi +exit 0 diff --git a/main/mini_httpd/mini_httpd.pre-upgrade b/main/mini_httpd/mini_httpd.pre-upgrade new file mode 120000 index 0000000000..19e0fba2a6 --- /dev/null +++ b/main/mini_httpd/mini_httpd.pre-upgrade @@ -0,0 +1 @@ +mini_httpd.pre-install
\ No newline at end of file |