network/hiawatha: Added to 13.0 repository

This commit is contained in:
Antonio Hernández Blas 2010-05-13 01:00:01 +02:00 committed by David Somero
parent 9a16c49703
commit f986af338a
7 changed files with 294 additions and 0 deletions

7
network/hiawatha/README Normal file
View file

@ -0,0 +1,7 @@
Hiawatha (A secure and advanced webserver)
Hiawatha is a secure webserver for Unix. It has been written with
'being secure' as its main goal. Hiawatha has lots of features that
no other webserver has. This and the fact that Hiawatha's source
code is free of security-bugs, makes Hiawatha the most secure
webserver available.

View file

@ -0,0 +1,20 @@
config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
# If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
# toss the redundant copy
rm $NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
# Keep same perms on rc.hiawatha.new:
if [ -e etc/rc.d/rc.hiawatha ]; then
cp -a etc/rc.d/rc.hiawatha etc/rc.d/rc.hiawatha.new.incoming
cat etc/rc.d/rc.hiawatha.new > etc/rc.d/rc.hiawatha.new.incoming
mv etc/rc.d/rc.hiawatha.new.incoming etc/rc.d/rc.hiawatha.new
fi

View file

@ -0,0 +1,117 @@
#!/bin/sh
# Slackware build script for hiawatha
# Copyright (c) 2009, Antonio Hernández Blas <hba.nihilismus@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1.- Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=hiawatha
VERSION=${VERSION:-6.19}
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--build=$ARCH-slackware-linux \
--enable-command \
--enable-xslt
make
make install DESTDIR=$PKG
# Install init scipts
mkdir -p $PKG/etc/rc.d/
install -m 0644 $CWD/rc.$PRGNAM $PKG/etc/rc.d/rc.$PRGNAM
install -m 0644 $CWD/rc.php-fcgi $PKG/etc/rc.d/rc.php-fcgi
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
xargs strip --strip-unneeded 2> /dev/null || true
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
xargs strip --strip-unneeded 2> /dev/null
)
if [ -d $PKG/usr/man ]; then
( 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
)
fi
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a AUTHORS ChangeLog COPYING INSTALL $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
# Add .new extension to all configuration files.
for file in $(find $PKG/etc -type f)
do
mv $file $file.new
done
# Add *.new files into doinst.sh
for file in $(find $PKG/etc -type f -name "*.new")
do
echo config $(echo $file | sed "s:$PKG/::") >> $PKG/install/doinst.sh
done
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

View file

@ -0,0 +1,10 @@
PRGNAM="hiawatha"
VERSION="6.19"
HOMEPAGE="http://www.hiawatha-webserver.org"
DOWNLOAD="http://www.hiawatha-webserver.org/files/hiawatha-6.19.tar.gz"
MD5SUM="1e9d4790ab4566f3ad4f8b1ea4997dca"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
MAINTAINER="Antonio Hernández Blas"
EMAIL="hba.nihilismus@gmail.com"
APPROVED="dsomero"

View file

@ -0,0 +1,63 @@
#!/bin/sh
# Start/stop/restart the hiawatha web server
# Copyright (c) 2009 Antonio Hernández Blas <hba.nihilismus@gmail.com>
CONF='/etc/hiawatha'
CMMD="/usr/sbin/hiawatha -c $CONF"
hiawatha_start() {
if [ -x /usr/sbin/hiawatha ]; then
if [ -d $CONF ]; then
PIDOF=$(pgrep -f "$CMMD")
if [ ! -z "$PIDOF" ]; then
echo "Error, hiawatha is already running."
else
echo "Starting hiawatha: $CMMD"
$CMMD
fi
else
echo "Error, directory $CONF does not exist."
fi
fi
}
hiawatha_stop() {
PIDOF=$(pgrep -f "$CMMD")
if [ -z "$PIDOF" ]; then
echo "Error, hiawatha is not running."
else
echo "Stoping hiawatha: kill $PIDOF"
kill $PIDOF
fi
}
hiawatha_status() {
PIDOF=$(pgrep -f "$CMMD")
if [ ! -z "$PIDOF" ]; then
echo "hiawatha is running."
else
echo "hiawatha is not running."
fi
}
case $1 in
start)
hiawatha_start
;;
stop)
hiawatha_stop
;;
restart)
hiawatha_stop
sleep 1
hiawatha_start
;;
status)
hiawatha_status
;;
*)
echo "Usage $0 {start|stop|restart|status}"
exit 1
;;
esac

View file

@ -0,0 +1,58 @@
#!/bin/sh
# Start/stop/restart PHP as FastCGI daemon
# Copyright (c) 2009 Antonio Hernández Blas <hba.nihilismus@gmail.com>
CONF='/etc/hiawatha/php-fcgi.conf'
CMMD="/usr/sbin/php-fcgi -c $CONF"
php_fcgi_start() {
if [ -x /usr/sbin/php-fcgi ]; then
if [ -f $CONF ]; then
PIDOF=$(pgrep -f /usr/bin/php-cgi)
if [ ! -z "$PIDOF" ]; then
echo "Error, PHP as FastCGI daemon is already running."
else
echo "Starting PHP as FastCGI daemon: $CMMD"
$CMMD
fi
else
echo "Error, file $CONF does not exist."
fi
fi
}
php_fcgi_stop() {
echo "Stoping PHP as FastCGI daemon: /usr/sbin/php-fcgi -k"
/usr/sbin/php-fcgi -k
}
php_fcgi_status() {
PIDOF=$(pgrep -f /usr/bin/php-cgi)
if [ ! -z "$PIDOF" ]; then
echo "PHP as FastCGI daemon is running."
else
echo "PHP as FastCGI daemon is not running."
fi
}
case $1 in
start)
php_fcgi_start
;;
stop)
php_fcgi_stop
;;
restart)
php_fcgi_stop
sleep 1
php_fcgi_start
;;
status)
php_fcgi_status
;;
*)
echo "Usage $0 {start|stop|restart|status}"
exit 1
;;
esac

View file

@ -0,0 +1,19 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
hiawatha: Hiawatha (A secure and advanced webserver)
hiawatha:
hiawatha: Hiawatha is a secure webserver for Unix. It has been written with
hiawatha: 'being secure' as its main goal. Hiawatha has lots of features that
hiawatha: no other webserver has. This and the fact that Hiawatha's source
hiawatha: code is free of security-bugs, makes Hiawatha the most secure
hiawatha: webserver available.
hiawatha:
hiawatha: Homepage: http://www.hiawatha-webserver.org
hiawatha:
hiawatha: