monkey: switch webroot to /srv/www/monkey; user to _monkey; create dirs in service.

This commit is contained in:
Juan RP 2016-05-01 10:41:52 +02:00
parent d5fcf6071a
commit 78548dba2a
2 changed files with 21 additions and 13 deletions

View File

@ -1,3 +1,16 @@
#!/bin/sh
[ -s conf ] && . ./conf
exec chpst -uhttpd monkey
: ${ROOTDIR:=/srv/www/monkey}
: ${LOGDIR:=/var/log/monkey}
if [ ! -d $ROOTDIR ]; then
mkdir -p $ROOTDIR
chown _monkey:_monkey $ROOTDIR
fi
if [ ! -d $LOGDIR ]; then
mkdir -p $LOGDIR/htdocs
chown _monkey:_monkey -R $LOGDIR
fi
exec chpst -u monkey:monkey monkey

View File

@ -1,15 +1,15 @@
# Template file for 'monkey'
pkgname=monkey
version=1.6.8
revision=1
revision=2
build_style=configure
hostmakedepends="cmake"
makedepends="mbedtls-devel"
configure_args+="--prefix=/usr --sbindir=/usr/bin --libdir=/usr/lib "
configure_args+="--sysconfdir=/etc/monkey/ --enable-plugins=mbedtls "
configure_args+="--webroot=/srv/httpd --mandir=/usr/share/man "
configure_args+="--webroot=/srv/www/$pkgname --mandir=/usr/share/man "
configure_args+="--pidfile=/var/run/monkey.pid --logdir=/var/log/monkey "
configure_args+="--malloc-libc --default-user=httpd "
configure_args+="--malloc-libc --default-user=_$pkgname "
short_desc="Cross-arch embeddable lightweight HTTP server"
maintainer="necrophcodr <necrophcodr@necrophcodr.me>"
license="Apache-2.0"
@ -17,10 +17,6 @@ homepage="http://monkey-project.com"
distfiles="${homepage}/releases/${version%.*}/${pkgname}-${version}.tar.gz"
checksum=936aa276d11dea77cda2703eb5d1b89ede1cf8d44440e1ec029cafb10effb3cf
make_dirs="
/var/log/monkey 0755 root httpd
/srv/httpd/htdocs 0755 root httpd"
conf_files="
/etc/monkey/plugins/*/*.conf
/etc/monkey/plugins/dirlisting/themes/*/*.theme
@ -29,17 +25,16 @@ conf_files="
/etc/monkey/plugins.load
/etc/monkey/monkey.mime"
system_accounts="httpd"
httpd_descr="Monkey HTTP server"
httpd_homedir="/srv/httpd"
system_accounts="_$pkgname"
_monkey_homedir="/srv/www/$pkgname"
case $XBPS_TARGET_MACHINE in
*-musl) configure_args+="--musl-mode --no-backtrace ";;
esac
post_install() {
vmkdir usr/share/monkey/htdocs
mv ${DESTDIR}/srv/httpd/* ${DESTDIR}/usr/share/monkey/htdocs
vmkdir usr/share/monkey/webroot
mv ${DESTDIR}/srv/www/$pkgname/* ${DESTDIR}/usr/share/monkey/webroot
vsv monkey
}