- Update to 1.0.8

- Handle permissions on log files
- Run under www user

PR:		ports/149575
Submitted by:	Diego Schulz <dschulz@gmail.com> (maintainer)
This commit is contained in:
Pav Lucistnik 2010-09-15 12:29:48 +00:00
parent da0857b478
commit ecbea54dfc
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=261210
5 changed files with 99 additions and 41 deletions

View File

@ -6,7 +6,7 @@
#
PORTNAME= cherokee
PORTVERSION= 1.0.7
PORTVERSION= 1.0.8
CATEGORIES= www
MASTER_SITES= http://www.cherokee-project.com/download/1.0/${PORTVERSION}/ \
http://cherokee.osuosl.org/1.0/${PORTVERSION}/ \
@ -51,13 +51,24 @@ USE_OPENSSL= yes
USE_LDCONFIG= yes
USE_GETTEXT= yes
USE_RC_SUBR= cherokee.sh
SUB_FILES= pkg-install pkg-message
USE_GMAKE= yes
GNU_CONFIGURE= yes
CPPFLAGS= -I${LOCALBASE}/include ${PTHREAD_CFLAGS}
LDFLAGS= -L${LOCALBASE}/lib ${PTHREAD_LIBS}
CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
CHEROKEE_VARDIR?= /var
CHEROKEE_LOGDIR?= ${CHEROKEE_VARDIR}/log
CHEROKEE_ACCESSLOG?= ${CHEROKEE_LOGDIR}/cherokee.access
CHEROKEE_ERRORLOG?= ${CHEROKEE_LOGDIR}/cherokee.error
# Adjust this if you need to run Cherokee as a distinct user:group
CHEROKEE_USER= www
CHEROKEE_GROUP= www
CONFIGURE_ARGS= --with-wwwroot=${PREFIX}/www/cherokee \
--localstatedir=/var \
--localstatedir=${CHEROKEE_VARDIR} \
--disable-static
DEFCONFS= cherokee.conf
CONFSUBDIRS= ssl mods-available mods-enabled sites-available sites-enabled
@ -65,17 +76,16 @@ MAN1= cget.1 cherokee-config.1 cherokee.1 cherokee-admin.1 \
cherokee-tweak.1 cherokee-worker.1
PORTDOCS= *
OPTIONS= WWWUSER "Run as www:www user" on \
IPV6 "IPv6 support" on \
MYSQL "MySQL Database" off \
LDAP "LDAP Support" off \
GEOIP "GeoIP Support (recommended)" on \
FFMPEG "FFMpeg Support" off \
NLS "NLS Support" on \
INTPCRE "Use Internal PCRE Library" off \
ADMIN "Build the Admin Interface" on \
RRDTOOL "Usage Graphs Support" off \
UWSGI "uWSGI Support" off
OPTIONS= IPV6 "IPv6 support" on \
MYSQL "MySQL Database" off \
LDAP "LDAP Support" off \
GEOIP "GeoIP Support (recommended)" on \
FFMPEG "FFMpeg Support" off \
NLS "NLS Support" on \
INTPCRE "Use Internal PCRE Library" off \
ADMIN "Build the Admin Interface" on \
RRDTOOL "Usage Graphs Support" off \
UWSGI "uWSGI Support" off
.include <bsd.port.options.mk>
@ -89,9 +99,7 @@ PLIST_SUB+= ADMIN="@comment "
.include <bsd.port.pre.mk>
.ifdef WITH_WWWUSER
CONFIGURE_ARGS+= --with-wwwuser=www --with-wwwgroup=www
.endif
CONFIGURE_ARGS+= --with-wwwuser=${CHEROKEE_USER} --with-wwwgroup=${CHEROKEE_GROUP}
.ifdef WITHOUT_IPV6
CONFIGURE_ARGS+= --disable-ipv6
@ -216,6 +224,13 @@ post-install:
${XARGS} ${PYTHON_CMD} ${PYTHON_LIBDIR}/py_compile.py
.endif
@${SETENV} \
CHEROKEE_USER=${CHEROKEE_USER} \
CHEROKEE_GROUP=${CHEROKEE_GROUP} \
CHEROKEE_ERRORLOG=${CHEROKEE_ERRORLOG} \
CHEROKEE_ACCESSLOG=${CHEROKEE_ACCESSLOG} \
${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${ECHO_MSG} "==============================================================="
@${CAT} ${PKGMESSAGE}
@${ECHO_MSG} "==============================================================="

View File

@ -1,3 +1,3 @@
MD5 (cherokee-1.0.7.tar.gz) = 38fe9f70b39a331568be08bd5abc2045
SHA256 (cherokee-1.0.7.tar.gz) = fb104c4d2b1fded81bb22bc001d761e358cdc3bb53f3159613fccacb98b1b749
SIZE (cherokee-1.0.7.tar.gz) = 5383836
MD5 (cherokee-1.0.8.tar.gz) = 12117a80c2a970173bd32660439c2db0
SHA256 (cherokee-1.0.8.tar.gz) = 45e0f777668f7e1ea13c706bdd7b6519077854a69223ad5d3b2fa30bdc83cf1f
SIZE (cherokee-1.0.8.tar.gz) = 5384416

View File

@ -0,0 +1,42 @@
#!/bin/sh
PATH=/bin:/usr/bin:/usr/sbin
FILEMODE=0640
C_ACCESSLOG=${CHEROKEE_ACCESSLOG:-/var/log/cherokee.access}
C_ERRORLOG=${CHEROKEE_ERRORLOG:-/var/log/cherokee.error}
C_USER=${CHEROKEE_USER:-www}
C_GROUP=${CHEROKEE_GROUP:-www}
case $2 in
POST-INSTALL)
echo "$2 for $1"
echo "Adjusting ownership (${C_USER}:${C_GROUP}) and permissions (${FILEMODE}) on log files:"
echo "${C_ACCESSLOG}"
echo "${C_ERRORLOG}"
if [ ! -f ${C_ACCESSLOG} ]; then
touch ${C_ACCESSLOG}
fi
if [ ! -f ${C_ERRORLOG} ]; then
touch ${C_ERRORLOG}
fi
chown ${C_USER}:${C_GROUP} ${C_ACCESSLOG} ${C_ERRORLOG}
chmod ${FILEMODE} ${C_ACCESSLOG} ${C_ERRORLOG}
;;
PRE-INSTALL)
echo "Nothing to do in $2"
;;
*)
exit 64
;;
esac

View File

@ -0,0 +1,23 @@
**** PLEASE READ THIS ****
o To run Cherokee at startup or using the rc script, you need
to add
cherokee_enable="YES"
in either /etc/rc.conf, /etc/rc.conf.local or
/etc/rc.conf.d/cherokee.
o To start the Cherokee administrative interface, run (as root)
cherokee-admin
For more information on cherokee-admin(1), please refer to
the official documentation and manpage.
o By default, the cherokee daemon runs as www:www user.
If you need it to run as another user, you'll need to manually
adjust Makefile and recompile the port.

View File

@ -1,22 +0,0 @@
Please note that if you intend to run Cherokee as www user,
you'll have to manually create the log files and set the
proper ownership and permissions on them.
You can do it with (as root):
touch /var/log/cherokee.error /var/log/cherokee.access
chown -v www:www /var/log/cherokee.*
chmod -v 0640 /var/log/cherokee.*
If you run Cherokee as root (NOT recommended) this is not
necessary.
To run Cherokee at startup or using the rc script, add
'cherokee_enable="YES"' to /etc/rc.conf
To start the Cherokee administrative interface, run (as root)
cherokee-admin
For more information on cherokee-admin(1), please refer to
the official documentation and manpage.