network/bozohttpd: Updated for version 20181125.

Signed-off-by: B. Watson <yalhcru@gmail.com>
This commit is contained in:
B. Watson 2018-12-03 17:50:59 -05:00 committed by Willy Sudiarto Raharjo
parent a37ec368d1
commit 9dfdf46595
No known key found for this signature in database
GPG key ID: 887B8374D7333381
5 changed files with 121 additions and 23 deletions

View file

@ -13,16 +13,24 @@ but is capable of running as a standalone daemon (the -b option). There
is no startup script for daemon mode, but you can launch bozohttpd
from /etc/rc.d/rc.local.
Optional dependency: lua
bozohttpd has several features that can be disabled at compile time,
to reduce the binary size and/or to avoid security issues (features
that aren't included can't be exploited). See the file defines.default
for details on how to do this. By default, all features are enabled
(except maybe lua; see below).
Optional dependency: lua52 or lua53.
bozohttpd can be built with support for dynamic content using Lua. This
isn't needed for running CGI scripts that happen to be written in Lua.
It's for embedding a Lua interpreter in bozohttpd, in the style of
Apache's mod_php or mod_perl.
Apache's mod_php or mod_perl. As of bozohttpd-20181125, lua 5.1.x
(aka SBo's lua package) is no longer supported. You can set LUA in the
environment if the default isn't what you want:
If lua is installed when the script is run, bozohttpd will be built with
Lua support automatically. If you have lua installed but don't want to
build bozohttpd with it, export LUA=no in the environment before running
the script.
LUA=yes - the default (autodetect; use highest version found, or none).
LUA=5.2 - use lua52, or fail if not found.
LUA=5.3 - use lua53, or fail if not found.
LUA=no - disable lua support, even if lua52 and/or lua53 are installed.
Without Lua support, the -L option to bozohttpd will not work.

View file

@ -24,6 +24,13 @@
# Now maintained by B. Watson <yalhcru@gmail.com>.
# 20181203 bkw:
# - Update for v20181125.
# - Lua-5.1 (plain lua build) is no longer supported. Add a mess o' logic
# to autodetect lua52 or lua53, and allow the user to override it.
# - When built with lua support, add lua version number to slack-desc.
# - Allow users to selectively disable unneeded features, see defines.default.
# 20180629 bkw:
# - Take over maintenance.
# - Move binary to /usr/sbin (to match the section 8 man page). But
@ -37,8 +44,8 @@
# - Simplify script a bit.
PRGNAM=bozohttpd
VERSION=${VERSION:-20170201}
BUILD=${BUILD:-2}
VERSION=${VERSION:-20181125}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@ -77,11 +84,8 @@ rm -rf $PRGNAM-$VERSION
tar xjvf $CWD/$PRGNAM-$VERSION.tar.bz2
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
# 20180629 bkw: Note to self: Ignore Makefile. It's BSD-specific.
# In theory maybe it could be massaged into working with bmake or
@ -94,18 +98,68 @@ sed -i '/^CRYPTOLIBS/s,$, -lcrypt,' Makefile.boot
# 20180629 bkw: support lua (-L option) if lua is installed and user
# doesn't disable it. I've tested this with the printenv.lua script
# and it seems to work fine.
if [ "${LUA:-yes}" = "yes" ] && lua -v &>/dev/null; then
LUAOPT=""
WITHLUA="with"
# 20181203 bkw: bozohttpd-20170201 was the last version that worked
# with lua 5.1 (SBo's lua build). Starting with 20181125, at least
# lua 5.2 is required (5.3 also works). This is more complex than I'd
# like it to be, but it does work.
LUA="${LUA:-yes}"
case "$LUA" in
# LUA=yes: autodetect
yes) if lua5.3 -v &> /dev/null; then
LUA=5.3
elif lua5.2 -v &> /dev/null; then
LUA=5.2
else
LUA=no
fi
;;
# LUA=<version>: use that version, or die
5.2|5.3) if ! lua$LUA -v &> /dev/null; then
echo "!!! lua v$LUA support requested, but lua${LUA/./} not installed" 2>&1
exit 1
fi
;;
# LUA=no: accept and do nothing
no) ;;
# Anything else is a fail
*) echo "Invalid LUA value '$LUA'. Supported values are: yes no 5.2 5.3" 2>&1
exit 1
;;
esac
echo "=== LUA='$LUA'"
if [ "$LUA" != "no" ] && lua$LUA -v &>/dev/null; then
LUAOPT="-I/usr/include/lua$LUA"
WITHLUA="with lua $LUA"
EXTRADOC="printenv.lua"
sed -i '/^CRYPTOLIBS/s,$, -llua,' Makefile.boot
sed -i '/^CRYPTOLIBS/s,$, -llua'"$LUA"',' Makefile.boot
sed -i 's,/usr/libexec/httpd,bozohttpd,' printenv.lua
else
LUAOPT="-DNO_LUA_SUPPORT"
WITHLUA="without"
WITHLUA="without lua"
EXTRADOC=""
fi
# 20181203 bkw: Support local compile options, to selectively disable
# unneeded features.
if [ -e "$CWD/defines.local" ]; then
DEFFILE=$CWD/defines.local
elif [ -e $CWD/defines.default ]; then
DEFFILE=$CWD/defines.default
fi
if [ -n "$DEFFILE" ]; then
DEFINES="$( echo $( sed 's,#.*$,,' "$DEFFILE" ) )"
echo "=== using defines from $DEFFILE: '$DEFINES'"
else
DEFINES="-DDO_HTPASSWD"
fi
# 20180629 bkw: The man page was written for NetBSD, where I guess
# bozohttpd is installed as "httpd". On Slackware this is Apache. The
# man page shows example commands referring to "httpd", which will
@ -133,7 +187,7 @@ patch -p1 < $CWD/fix_warnings.diff
# Fix build (from Arch Linux' AUR).
sed -i 's/d_namlen/d_reclen/g' bozohttpd.c
make -f Makefile.boot OPT="$SLKCFLAGS -Wall" LOCAL_CFLAGS="-DDO_HTPASSWD $LUAOPT"
make -f Makefile.boot OPT="$SLKCFLAGS -Wall" LOCAL_CFLAGS="$DEFINES $LUAOPT"
mkdir -p $PKG/usr/bin $PKG/usr/sbin $PKG/usr/man/man8
install -s -m755 $PRGNAM $PKG/usr/sbin
@ -143,6 +197,7 @@ gzip -9c < $PRGNAM.8 > $PKG/usr/man/man8/$PRGNAM.8.gz
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a CHANGES $EXTRADOC $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
[ -n "$DEFFILE" ] && cat "$DEFFILE" > $PKG/usr/doc/$PRGNAM-$VERSION/defines.local
mkdir -p $PKG/install
sed "s,@WITHLUA@,$WITHLUA," $CWD/slack-desc > $PKG/install/slack-desc

View file

@ -1,8 +1,8 @@
PRGNAM="bozohttpd"
VERSION="20170201"
VERSION="20181125"
HOMEPAGE="http://www.eterna.com.au/bozohttpd/"
DOWNLOAD="http://www.eterna.com.au/bozohttpd/bozohttpd-20170201.tar.bz2"
MD5SUM="0c9548ed0bde00f6d350335224a17f2f"
DOWNLOAD="http://www.eterna.com.au/bozohttpd/bozohttpd-20181125.tar.bz2"
MD5SUM="e9ee8f82ebcf9ef9b293c6af32672082"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""

View file

@ -0,0 +1,35 @@
# There are quite a few features in bozohttpd that can be disabled at
# compile time. The SlackBuild reads this file to build a list of -D
# compiler flags. You can edit this file directly, or if you prefer,
# copy it to "defines.local" (the SlackBuild will use that instead of
# "defines.default", if it exists).
# To help you keep track of how you built the package, whichever of
# defines.local or defines.default is used, will be installed to the
# doc dir as "/usr/doc/bozohttpd-$VERSION/defines.local". This means
# you can easily rebuild the package with the same options by copying
# the installed defines.local to the SlackBuild directory.
# Obviously, comments are allowed in this file :)
# If you want to disable Lua, don't use this file. Add LUA=no to the
# script's environment instead.
# HTTP Basic Auth. Enabled by default, comment out this line to disable:
-DDO_HTPASSWD
# CGI script support (-c, -C, -E options). Uncomment to disable:
# -DNO_CGIBIN_SUPPORT
# Userdir (~user) support (-u, -p, -E options). Uncomment to disable:
# -DNO_USER_SUPPORT
# Daemon mode support, for running standalone instead of being called
# by inetd (-b, -f options). Uncomment to disable:
# -DNO_DAEMON_MODE
# Dynamic MIME content. Uncomment to disable:
# -DNO_DYNAMIC_CONTENT
# SSL support (-z, -Z options). Uncomment to disable:
# -DNO_SSL_SUPPORT

View file

@ -16,4 +16,4 @@ bozohttpd: hosting support, as well as multiple IP-based servers on a
bozohttpd: single machine. It is capable of serving pages via the IPv6
bozohttpd: protocol. bozohttpd features SSL support.
bozohttpd:
bozohttpd: This package built @WITHLUA@ Lua dynamic content support.
bozohttpd: This package built @WITHLUA@ dynamic content support.