summaryrefslogtreecommitdiffstats
path: root/network
diff options
context:
space:
mode:
author dsomero <xgizzmo@gmail.com>2010-05-23 22:07:53 -0400
committer David Somero <xgizzmo@slackbuilds.org>2010-05-23 23:31:06 -0500
commit51a3ab900726f87fd28ac613ef1a586b2313c6d5 (patch)
tree5d3ef902771caf079c05f48d1ed37ecbba1bf59a /network
parent2a2a59a710fec0285f0fef5b494a6484e97039fe (diff)
downloadslackbuilds-51a3ab900726f87fd28ac613ef1a586b2313c6d5.tar.gz
slackbuilds-51a3ab900726f87fd28ac613ef1a586b2313c6d5.tar.xz
network/thttpd: Miscellaneous cleanups and patch.
Cleaned up build and added a patch for building on glibc 2.10.
Diffstat (limited to 'network')
-rw-r--r--network/thttpd/patches/thttpd-2.25b-glibc-2.10.patch21
-rw-r--r--network/thttpd/thttpd.SlackBuild15
2 files changed, 35 insertions, 1 deletions
diff --git a/network/thttpd/patches/thttpd-2.25b-glibc-2.10.patch b/network/thttpd/patches/thttpd-2.25b-glibc-2.10.patch
new file mode 100644
index 0000000000..c97227827e
--- /dev/null
+++ b/network/thttpd/patches/thttpd-2.25b-glibc-2.10.patch
@@ -0,0 +1,21 @@
+diff -ur thttpd-2.25b.orig/extras/htpasswd.c thttpd-2.25b/extras/htpasswd.c
+--- thttpd-2.25b.orig/extras/htpasswd.c 2001-12-19 02:08:08.000000000 +0200
++++ thttpd-2.25b/extras/htpasswd.c 2009-08-09 16:40:06.000000000 +0300
+@@ -49,7 +49,7 @@
+ while((line[y++] = line[x++]));
+ }
+
+-static int getline(char *s, int n, FILE *f) {
++static int get_line(char *s, int n, FILE *f) {
+ register int i=0;
+
+ while(1) {
+@@ -189,7 +189,7 @@
+ strcpy(user,argv[2]);
+
+ found = 0;
+- while(!(getline(line,MAX_STRING_LEN,f))) {
++ while(!(get_line(line,MAX_STRING_LEN,f))) {
+ if(found || (line[0] == '#') || (!line[0])) {
+ putline(tfp,line);
+ continue;
diff --git a/network/thttpd/thttpd.SlackBuild b/network/thttpd/thttpd.SlackBuild
index cdfe75f307..7ec6f2fb55 100644
--- a/network/thttpd/thttpd.SlackBuild
+++ b/network/thttpd/thttpd.SlackBuild
@@ -25,10 +25,19 @@
PRGNAM=thttpd
VERSION=${VERSION:-2.25b}
-ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
@@ -43,6 +52,9 @@ elif [ "$ARCH" = "i686" ]; then
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
# Set the directory to serve through HTTP
@@ -67,6 +79,7 @@ find . \
cat $CWD/patches/additional-input-validation-httpd.c.diff | patch -p1
cat $CWD/patches/fix-buffer-overflow.diff | patch -p1
cat $CWD/patches/fix-insecure-tmp-creation-CVE-2005-3124.diff | patch -p1
+cat $CWD/patches/thttpd-2.25b-glibc-2.10.patch | patch -p1
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \