diff options
author | Matteo Bernardini <ponce@slackbuilds.org> | 2012-09-08 09:10:52 +0200 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2012-09-08 17:27:21 -0500 |
commit | a51e47323f61855e557323b94a96e9ec37208c08 (patch) | |
tree | a549a88ef3fb7a5ebc8bb57558c9f5d0f10672fc /network | |
parent | a154033cb8e1970ee9f5060b6aaaf22c33aa4a07 (diff) | |
download | slackbuilds-a51e47323f61855e557323b94a96e9ec37208c08.tar.gz |
network/cherokee: Updated for version 1.2.101.
Also forced /var/log/cherokee and run with a dedicated user,
various cleanups and additions to the README.
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'network')
-rw-r--r-- | network/cherokee/ChangeLog.txt | 6 | ||||
-rw-r--r-- | network/cherokee/README | 24 | ||||
-rw-r--r-- | network/cherokee/cherokee.SlackBuild | 59 | ||||
-rw-r--r-- | network/cherokee/cherokee.info | 6 | ||||
-rw-r--r-- | network/cherokee/doinst.sh | 23 | ||||
-rw-r--r-- | network/cherokee/patches/cherokee-1.2.98-linux3.patch | 45 | ||||
-rw-r--r-- | network/cherokee/patches/log_storing.patch | 29 |
7 files changed, 164 insertions, 28 deletions
diff --git a/network/cherokee/ChangeLog.txt b/network/cherokee/ChangeLog.txt index 94c24d33a9..21f7868fa9 100644 --- a/network/cherokee/ChangeLog.txt +++ b/network/cherokee/ChangeLog.txt @@ -1,3 +1,9 @@ +Sun 27 Dec 2011 - ponce (matteo.bernardini@gmail.com) +- SlackBuild script for Cherokee 1.2.101 +- Added the possibility to specify WWWUSER and WWWGROUP +- Default document root defaults to /var/www/htdocs-cherokee +- Use /var/log/cherokee + Mon 07 Sep 2009 - Pablo Hernan Saro (pablosaro@gmail.com) - SlackBuild script for Cherokee 0.99.24 - Cherokee rc script updated diff --git a/network/cherokee/README b/network/cherokee/README index c0424311d2..5891e7ac20 100644 --- a/network/cherokee/README +++ b/network/cherokee/README @@ -18,13 +18,15 @@ If need to get popular web applications working or fine tune your server, follow the cherokee's cookbooks page: * http://www.cherokee-project.com/doc/cookbook.html +ffmpeg is an optional dependency (for video streaming - BROKEN ATM). + Notes about using this SlackBuild --------------------------------- 1) To specify the WWW root directory pass WWWROOT=/path/to/www/root to the script, like this: - WWWROOT=/var/www ./cherokee.SlackBuild + WWWROOT=/var/www/htdocs-cherokee ./cherokee.SlackBuild 2) If you want to enable IPv6 support, pass IPV6=yes to the script. 3) If you want to disable the Cherokee-admin installation, pass @@ -35,9 +37,27 @@ Notes about using this SlackBuild to the script. 5) If you want to build Cherokee with debugging options, enable trace facility by passing TRACE=yes to the script. +6) The $WWWGROUP group and the $WWWUSER user account are set to cherokee. + To run cherokee as a different user/group specify them passing the + options WWWUSER/WWWGROUP to the slackbuild, like + + WWWUSER=cherokee WWWGROUP=cherokee ./cherokee.SlackBuild + + You want to create first a dedicated user/group. + + groupadd -g 299 cherokee + useradd -u 299 -g cherokee -d /var/www/htdocs-cherokee cherokee + + See http://slackbuilds.org/uid_gid.txt for current reccomendations (if any) +7) If you want to use it with php, remember to add your user to the + apache group, so that it can use /var/lib/php, like + + gpasswd -a cherokee apache Comments, suggestions or bug reports ------------------------------------ -If you have anything to say about this SlackBuild, event reporting a +If you have anything to say about this SlackBuild, even reporting a bug, don't hesitate to contact me at pablosaro@gmail.com +(be aware that pablo might not know that I wrecked his build +script for 1.2.101, ndponce <matteo.bernardini@gmail.com>) diff --git a/network/cherokee/cherokee.SlackBuild b/network/cherokee/cherokee.SlackBuild index caff2d9f11..f204ea8b16 100644 --- a/network/cherokee/cherokee.SlackBuild +++ b/network/cherokee/cherokee.SlackBuild @@ -5,11 +5,18 @@ # Written by Pablo Hernan Saro (pablosaro@gmail.com) PRGNAM=cherokee -VERSION=${VERSION:-0.99.24} -ARCH=${ARCH:-i686} +VERSION=${VERSION:-1.2.101} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + CWD=$(pwd) TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM @@ -24,10 +31,17 @@ elif [ "$ARCH" = "i686" ]; then elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" fi # Set the WWW root directory -WWWROOT=${WWWROOT:-/var/www} +WWWROOT=${WWWROOT:-/var/www/htdocs-cherokee} + +# Set the WWW user/group - defaulted to root, but dedicated ones are better +WWWUSER=${WWWUSER:-cherokee} +WWWGROUP=${WWWGROUP:-cherokee} # Enable/Disable IPv6 support IPV6=${IPV6:-no} @@ -41,13 +55,29 @@ MYSQL=${MYSQL:-yes} # Enable/Disable trace facility (debugging options) TRACE=${TRACE:-no} +if [ ! "$(grep "$WWWGROUP" /etc/group)" ]; then + printf "\n The \"$WWWGROUP\" group you choose is not available. Create one with + + groupadd -g 299 $WWWGROUP + + (see http://slackbuilds.org/uid_gid.txt for current reccomendations - if any)\n\n" + exit 1 +elif [ ! "$(grep "$WWWUSER" /etc/passwd)" ] ; then + printf "\n The \"$WWWUSER\" user you choose is not available. Create one with + + useradd -u 299 -g $WWWGROUP -d ${WWWROOT} $WWWUSER + + (see http://slackbuilds.org/uid_gid.txt for current reccomendations - if any)\n\n" + exit 1 +fi + set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +tar xvf $CWD/$PRGNAM-$VERSION.tar.?z* cd $PRGNAM-$VERSION chown -R root:root . find . \ @@ -56,6 +86,11 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; +# Apply all the patches in $CWD/patches (thanks Gentoo) +for patch in $CWD/patches/* ; do + patch -p1 < $patch +done + CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ @@ -67,9 +102,12 @@ CXXFLAGS="$SLKCFLAGS" \ --docdir=/usr/doc/$PRGNAM-$VERSION \ --build=$ARCH-slackware-linux \ --with-wwwroot=$WWWROOT \ + --with-wwwuser=$WWWUSER \ + --with-wwwgroup=$WWWGROUP \ --with-mysql=$MYSQL \ --enable-ipv6=$IPV6 \ --enable-admin=$ADMIN \ + --disable-pam \ --enable-trace=$TRACE make @@ -78,14 +116,15 @@ make install DESTDIR=$PKG find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true -( cd $PKG/usr/man - find . -type f -exec gzip -9 {} \; - for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done -) +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +mkdir -p $PKG/var/log/cherokee +chown -R $WWWUSER:$WWWGROUP $PKG/var/log/cherokee mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a \ - AUTHORS COPYING ChangeLog INSTALL NEWS README \ + AUTHORS COPYING ChangeLog NEWS README \ $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild @@ -98,5 +137,3 @@ cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} - - diff --git a/network/cherokee/cherokee.info b/network/cherokee/cherokee.info index d60d04fe3b..e351e34827 100644 --- a/network/cherokee/cherokee.info +++ b/network/cherokee/cherokee.info @@ -1,8 +1,8 @@ PRGNAM="cherokee" -VERSION="0.99.24" +VERSION="1.2.101" HOMEPAGE="http://www.cherokee-project.com" -DOWNLOAD="http://www.cherokee-project.com/download/0.99/0.99.24/cherokee-0.99.24.tar.gz" -MD5SUM="5afed8bdd6020dc5bf0ba9ec83b947f1" +DOWNLOAD="http://www.cherokee-project.com/download/1.2/1.2.101/cherokee-1.2.101.tar.gz" +MD5SUM="ef47003355a2e368e4d9596cd070ef23" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" diff --git a/network/cherokee/doinst.sh b/network/cherokee/doinst.sh index 095b7f2381..c5bd90e9d9 100644 --- a/network/cherokee/doinst.sh +++ b/network/cherokee/doinst.sh @@ -8,17 +8,16 @@ config() { fi } -if [ -e etc/rc.d/rc.cherokee ]; then - cp -a etc/rc.d/rc.cherokee etc/rc.d/rc.cherokee.new.incoming - cat etc/rc.d/rc.cherokee.new > etc/rc.d/rc.cherokee.new.incoming - mv etc/rc.d/rc.cherokee.new.incoming etc/rc.d/rc.cherokee.new -fi - -if [ -e etc/cherokee/cherokee.conf ]; then - cp -a etc/cherokee/cherokee.conf etc/cherokee/cherokee.conf.new.incoming - cat etc/cherokee/cherokee.conf.new > etc/cherokee/cherokee.conf.new.incoming - mv etc/cherokee/cherokee.conf.new.incoming etc/cherokee/cherokee.conf.new -fi +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} -config etc/rc.d/rc.cherokee.new +preserve_perms etc/rc.d/rc.cherokee.new config etc/cherokee/cherokee.conf.new diff --git a/network/cherokee/patches/cherokee-1.2.98-linux3.patch b/network/cherokee/patches/cherokee-1.2.98-linux3.patch new file mode 100644 index 0000000000..e1e335264b --- /dev/null +++ b/network/cherokee/patches/cherokee-1.2.98-linux3.patch @@ -0,0 +1,45 @@ +diff -Naur cherokee-1.2.98.orig/admin/SystemStats.py cherokee-1.2.98/admin/SystemStats.py +--- cherokee-1.2.98.orig/admin/SystemStats.py 2011-05-03 18:01:41.000000000 +0900 ++++ cherokee-1.2.98/admin/SystemStats.py 2011-08-26 13:05:08.128851462 +0900 +@@ -39,7 +39,7 @@ + global _stats + + if not _stats: +- if sys.platform == 'linux2': ++ if sys.platform == 'linux2' or sys.platform == 'linux3': + _stats = System_stats__Linux() + elif sys.platform == 'darwin': + _stats = System_stats__Darwin() +diff -Naur cherokee-1.2.98.orig/admin/market/InstallUtil.py cherokee-1.2.98/admin/market/InstallUtil.py +--- cherokee-1.2.98.orig/admin/market/InstallUtil.py 2011-05-03 18:01:41.000000000 +0900 ++++ cherokee-1.2.98/admin/market/InstallUtil.py 2011-08-26 13:05:06.596844132 +0900 +@@ -56,7 +56,7 @@ + first_group = str(root_group) + + # Systems +- if sys.platform == 'linux2': ++ if sys.platform == 'linux2' or sys.platform == 'linux3': + if os.getuid() == 0: + return root_group + return first_group +@@ -72,7 +72,7 @@ + + + def current_UID_is_admin(): +- if sys.platform == 'linux2': ++ if sys.platform == 'linux2' or sys.platform == 'linux3': + return os.getuid() == 0 + elif sys.platform == 'darwin': + return os.getuid() == 0 +diff -Naur cherokee-1.2.98.orig/admin/util.py cherokee-1.2.98/admin/util.py +--- cherokee-1.2.98.orig/admin/util.py 2011-03-31 17:30:04.000000000 +0900 ++++ cherokee-1.2.98/admin/util.py 2011-08-26 13:05:04.622834682 +0900 +@@ -341,7 +341,7 @@ + def os_get_document_root(): + if sys.platform == 'darwin': + return "/Library/WebServer/Documents" +- elif sys.platform == 'linux2': ++ elif sys.platform == 'linux2' or sys.platform == 'linux3': + if os.path.exists ("/etc/redhat-release"): + return '/var/www' + elif os.path.exists ("/etc/fedora-release"): diff --git a/network/cherokee/patches/log_storing.patch b/network/cherokee/patches/log_storing.patch new file mode 100644 index 0000000000..878492a756 --- /dev/null +++ b/network/cherokee/patches/log_storing.patch @@ -0,0 +1,29 @@ +diff -Naur cherokee-1.2.101.orig/admin/configured.py.pre cherokee-1.2.101/admin/configured.py.pre +--- cherokee-1.2.101.orig/admin/configured.py.pre 2011-10-12 20:07:44.000000000 +0200 ++++ cherokee-1.2.101/admin/configured.py.pre 2012-09-08 08:25:28.694838641 +0200 +@@ -22,7 +22,7 @@ + CHEROKEE_DATADIR = join (DATADIR, "cherokee") + CHEROKEE_DEPSDIR = join (DATADIR, "cherokee/deps") + CHEROKEE_CONFDIR = join (SYSCONFDIR, "cherokee") +-CHEROKEE_VAR_LOG = join (LOCALSTATE, "log") ++CHEROKEE_VAR_LOG = join (LOCALSTATE, "log/cherokee") + CHEROKEE_VAR_RUN = join (LOCALSTATE, "run") + CHEROKEE_VAR_LIB = join (LOCALSTATE, "lib/cherokee") + CHEROKEE_RRD_DIR = join (LOCALSTATE, "lib/cherokee/graphs") +diff -Naur cherokee-1.2.101.orig/cherokee.conf.sample.pre cherokee-1.2.101/cherokee.conf.sample.pre +--- cherokee-1.2.101.orig/cherokee.conf.sample.pre 2011-10-12 20:07:44.000000000 +0200 ++++ cherokee-1.2.101/cherokee.conf.sample.pre 2012-09-08 08:25:17.512923553 +0200 +@@ -27,11 +27,11 @@ + + vserver!1!logger = combined + vserver!1!logger!access!type = file +-vserver!1!logger!access!filename = %localstatedir%/log/cherokee.access ++vserver!1!logger!access!filename = %localstatedir%/log/cherokee/cherokee.access + vserver!1!logger!access!buffsize = 16384 + + vserver!1!error_writer!type = file +-vserver!1!error_writer!filename = %localstatedir%/log/cherokee.error ++vserver!1!error_writer!filename = %localstatedir%/log/cherokee/cherokee.error + + vserver!1!rule!1!match = default + vserver!1!rule!1!handler = common |