summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/darkhttpd/APKBUILD12
-rw-r--r--main/darkhttpd/darkhttpd.initd14
-rw-r--r--main/darkhttpd/darkhttpd.logrotate14
3 files changed, 35 insertions, 5 deletions
diff --git a/main/darkhttpd/APKBUILD b/main/darkhttpd/APKBUILD
index 25c70b141..4d59b1d3a 100644
--- a/main/darkhttpd/APKBUILD
+++ b/main/darkhttpd/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Alan Messias Cordeiro <alancordeiro@gmail.com>
pkgname=darkhttpd
pkgver=1.10
-pkgrel=0
+pkgrel=1
pkgdesc="A simple, single-threaded, static content webserver"
url="http://unix4lyfe.org/darkhttpd/"
arch="all"
@@ -13,6 +13,7 @@ makedepends="$depends_dev"
install="$pkgname.pre-install"
subpackages=""
source="http://unix4lyfe.org/darkhttpd/darkhttpd-$pkgver.tar.bz2
+ darkhttpd.logrotate
$pkgname.initd"
_builddir="$srcdir/$pkgname-$pkgver"
@@ -43,8 +44,11 @@ package() {
}
md5sums="652968ca104e57235519cadd2d6fdda2 darkhttpd-1.10.tar.bz2
-ca1ef549dd1a18d3e3614e6c466ba898 darkhttpd.initd"
+63aa435ce78851d57c39426e34ec728b darkhttpd.logrotate
+64612af1778061843cda79fde8e75c68 darkhttpd.initd"
sha256sums="b5a9bcfe6e65a3fc20f96e6badb5da7ba776a792f13fe90015fe9f63b3c2eb63 darkhttpd-1.10.tar.bz2
-cb6e4ccda90337f660c19f011c0c474aa9fcd6f93b93e675cafd5cabbc7f99a5 darkhttpd.initd"
+b4441bef90ca7fce5861edab165a3a7ea21b2e63faf27ec85aa85702fc8ac96b darkhttpd.logrotate
+2a997dc0757d88d129658ca3792cf2799f8c2779fad9028f8717f9583aecd2f6 darkhttpd.initd"
sha512sums="87cde803a562dabaecddda99748ced8fbc7b62cfa1d0b6e628d480ebdcf987454d48d32d1fdaeed2f4e9071e95e130e7bbdbe2394da30a41d64916428f8f608e darkhttpd-1.10.tar.bz2
-771d31ff90f78266f616b875366171f7b29bb91d7a2774bf4eb4c4d808ccd5348bae595433d27307a725072f96dd8a4827db5d2bc23669448a605c731dfde177 darkhttpd.initd"
+bb95277a9f8f227aeec8bfe6ef54f52a2f034ed0dd25258b996c17f9ce9dd4ad220366b10490246b25bb6b18ccde7bda0d52eeb88667941cf2fdab15c940dbbc darkhttpd.logrotate
+7a84488e84ed43b10a85b588524b118c483d5f19ea7e910447a5738d12f44dcf3a4d2ba47c17e8a9fe74f11ae90429cc54eebb749de8c8301bfb2f4b728b2aa7 darkhttpd.initd"
diff --git a/main/darkhttpd/darkhttpd.initd b/main/darkhttpd/darkhttpd.initd
index a7efb1660..713a6629b 100644
--- a/main/darkhttpd/darkhttpd.initd
+++ b/main/darkhttpd/darkhttpd.initd
@@ -2,7 +2,19 @@
description="darkhttpd web server"
command="/usr/bin/darkhttpd"
-command_args="${document_root:-/var/www/localhost/htdocs} --chroot --daemon --uid darkhttpd --gid www-data --log /var/log/darkhttpd/access.log"
+command_args="${document_root:-/var/www/localhost/htdocs} --chroot --daemon --uid darkhttpd --gid www-data --log /var/log/darkhttpd/access.log $darkhttpd_args"
procname="darkhttpd"
pidfile=""
stopsig="SIGTERM"
+
+optional_arg() {
+ if [ -n "$2" ]; then
+ command_args="$command_args $1 $2"
+ fi
+}
+
+start_pre() {
+ optional_arg --addr "$addr"
+ optional_arg --port "$port"
+ optional_arg --mimetypes "$mimetypes"
+}
diff --git a/main/darkhttpd/darkhttpd.logrotate b/main/darkhttpd/darkhttpd.logrotate
new file mode 100644
index 000000000..c61a60fd8
--- /dev/null
+++ b/main/darkhttpd/darkhttpd.logrotate
@@ -0,0 +1,14 @@
+/var/log/darkhttpd/access.log {
+ monthly
+ missingok
+ copytruncate
+ rotate 7
+ compress
+ notifempty
+ sharedscripts
+ postrotate
+ if /sbin/rc-service --quiet darkhttpd status; then \
+ /sbin/rc-service --quiet darkhttpd restart;\
+ fi
+ endscript
+}