blob: e2072d42b23206d686e92c7fdcf217ef5f983428 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
#!/bin/sh
# Slackware build script for suPHP
# Written by Menno E. Duursma <druiloor@zonnet.nl>
# Exit on most errors
set -e
PRGNAM=suphp
VERSION=0.6.2
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
CWD=`pwd`
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp} # Drop the package in /tmp
# The stock Apache on Slackware runs httpd onder system
# user/group account 'nobody'. If you happen to use some
# other account (which should improve security) change below
# and make sure /etc/apache/suphp.conf matches
HTTPD_USER=nobody
HTTPD_GROUP=nobody
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
fi
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar -xzvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R u+w,go+r-w,a-s .
# Apply patch to have it globally honor the suPHP_Engine directive
cat $CWD/suphp-0.6.2-vhosts.patch | patch -p0 --verbose
# Default to secure settings, as any of the configuretion options
# can be overwritten in the config-file /etc/apache/suphp.conf anyways
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--with-apr=/usr/bin/apr-1-config \
--with-apxs=/usr/sbin/apxs \
--sysconfdir=/etc/apache \
--with-apache-user=$HTTPD_USER \
--with-logfile=/var/log/apache/suphp_log
# Compile the application and install it into the $PKG directory
make
make install-strip DESTDIR=$PKG
# The above misses Apache module
( cd $PKG
strip --strip-unneeded usr/libexec/apache/mod_suphp.so
)
# Copy program documentation into the package
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a AUTHORS COPYING ChangeLog doc/* $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
# Add a sample configuration file
mkdir -p $PKG/etc/apache
cat $CWD/suphp.conf \
| tr 'webserver_user=nobody' "webserver_user=$HTTPD_USER" \
>> $PKG/etc/apache/suphp.conf.new
# Copy the slack-desc (and a custom doinst.sh if necessary) into ./install
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
# Make sure the access permissions on target host are such that
# only the group Apache runs as has access to it
echo "chgrp $HTTPD_GROUP usr/sbin/suphp" >> $PKG/install/doinst.sh
echo "chmod 4750 usr/sbin/suphp" >> $PKG/install/doinst.sh
# Make the package; be sure to leave it in $OUTPUT
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
# Clean up the extra stuff
if [ "$1" = "--cleanup" ]; then
rm -rf $TMP/$PRGNAM-$VERSION
rm -rf $PKG
fi
|