aboutsummaryrefslogtreecommitdiffstats
path: root/testing/thttpd
diff options
context:
space:
mode:
Diffstat (limited to 'testing/thttpd')
-rw-r--r--testing/thttpd/APKBUILD96
-rw-r--r--testing/thttpd/discreet.patch34
-rw-r--r--testing/thttpd/forwarded-for.patch16
-rw-r--r--testing/thttpd/getline.patch21
-rw-r--r--testing/thttpd/thttpd.conf8
-rw-r--r--testing/thttpd/thttpd.confd7
-rw-r--r--testing/thttpd/thttpd.initd28
-rw-r--r--testing/thttpd/thttpd.logrotated6
-rw-r--r--testing/thttpd/thttpd.post-install4
-rw-r--r--testing/thttpd/thttpd.pre-install4
10 files changed, 224 insertions, 0 deletions
diff --git a/testing/thttpd/APKBUILD b/testing/thttpd/APKBUILD
new file mode 100644
index 0000000000..220343234c
--- /dev/null
+++ b/testing/thttpd/APKBUILD
@@ -0,0 +1,96 @@
+# Contributor: z3bra <willy at mailoo dot org>
+# Maintainer:
+pkgname=thttpd
+pkgver=2.25b
+pkgrel=0
+pkgdesc="Simple, small, portable, fast, adn secure HTTP server"
+url="http://www.acme.com/software/thttpd"
+arch="all"
+license="custom:BSD"
+depends=""
+depends_dev=""
+makedepends="$depends_dev"
+install="$pkgname.pre-install $pkgname.post-install"
+subpackages="$pkgname-doc"
+source="http://www.acme.com/software/$pkgname/$pkgname-$pkgver.tar.gz
+ thttpd.initd
+ thttpd.confd
+ thttpd.conf
+ thttpd.logrotated
+ discreet.patch
+ forwarded-for.patch
+ getline.patch
+ "
+
+_builddir=$srcdir/$pkgname-$pkgver
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+ echo 'mkv video/x-matroska' >> mime_types.txt
+}
+
+build() {
+ cd "$_builddir"
+
+ ./configure --prefix=/usr --mandir=/usr/share/man
+ sed -e 's/^CFLAGS =/CFLAGS +=/' \
+ -e '/^STATICFLAG =/c STATICFLAG =' \
+ -i Makefile */Makefile
+
+ make
+}
+
+package() {
+ cd "$_builddir"
+
+ make \
+ BINDIR="$pkgdir"/usr/sbin \
+ WEBDIR="$pkgdir"/var/www/http \
+ MANDIR="$pkgdir"/usr/share/man \
+ WEBGROUP=root install
+
+ rm -rf "$pkgdir"/var/www/http/*
+
+ install -m755 -D "$srcdir"/$pkgname.initd \
+ "$pkgdir"/etc/init.d/$pkgname || return 1
+ install -m644 -D "$srcdir"/$pkgname.confd \
+ "$pkgdir"/etc/conf.d/$pkgname || return 1
+ install -m644 -D "$srcdir"/$pkgname.conf \
+ "$pkgdir"/etc/thttpd.conf || return 1
+ install -m644 -D "$srcdir"/$pkgname.logrotated \
+ "$pkgdir"/etc/logrotate.d/thttpd || return 1
+
+ install -d "$pkgdir"/var/log/thttpd
+ install -d "$pkgdir"/usr/share/licenses/"$pkgname"
+ head -n 26 thttpd.c > "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
+}
+
+md5sums="156b249b3b0bcd48b06badd2db0d56c5 thttpd-2.25b.tar.gz
+e73c541527e4784e1e234bab896fbe99 thttpd.initd
+7e53378c3ab359beee6f1b3198bdb353 thttpd.confd
+1828991ab3b4836247c94a7deb8947fa thttpd.conf
+e29e38de0195bdbacec8daaa016cabfa thttpd.logrotated
+055692a3037c35addc13e897ff8e5a02 discreet.patch
+9976ae6a2bb06b076a100c05235a72b8 forwarded-for.patch
+bf80d29e633eb0f6e3934649f9e010b2 getline.patch"
+sha256sums="07719b08b1cff6a21c08697a7bcb4395425b07ee753106262fb62a03a7d32360 thttpd-2.25b.tar.gz
+f20245ba64135f6a29cc3380d1940e2052e89edd56b12c4457009846b051bd15 thttpd.initd
+25f55ad96c73d8c22117dd6ef331e85fed5a3ba78b4b0ec329832e82a4159e4e thttpd.confd
+7fd376775c131474e123800b625fc43784c279b875061f4d5e3343742474355c thttpd.conf
+774ac53a3ea2b9ccf08b8ce75bf0253f72e25054ed0cd0bae4e257526248376c thttpd.logrotated
+da061d265b41d85aa5036dc439225e3fe709599b881e44ed8837a3c00fc54e7f discreet.patch
+eb3be98c65b8f9297867205772cd9939f526ac1c2227c24ba7e8ff754dd2216c forwarded-for.patch
+ab054c6178c91213293e2ad5eacec4d76a43c2140cbd4e516480acba9146e1d5 getline.patch"
+sha512sums="52cbf3eb95ad868b60af2bd45620142cc8c6a80c3ff31ca853640a944d38594ac53e060b950bd028b3be49da97db5e10b41073d21b3f49b73a54ee01349a6b1d thttpd-2.25b.tar.gz
+eeb042150c3b29b89c667cb8afc92d026e6b6cf772409dfb235fbd45823651b5e755cd93e3ae88304d77f171de8b3c46d558ac9c35eb9d2b640151b1761c89b7 thttpd.initd
+9b4309c2bc88d11ce71d40ab813e9cbe78e4ec7368e3e98f35da1d5a324ee0630a6892b43f58f84490e2b534a573673b106a9d5dd406fedefb2a4c664e455aa1 thttpd.confd
+691c4a4d455f9043ea2a188b8271db431924bd24d5083d153b422ff6e8fd99d43129a1d6af7b2f6515a52d4ee0e172848b4490b4cbe6337decd0c2332ab8fdd3 thttpd.conf
+5b2800825583e93cf4be76e71d2840b9894c1779a810d562a0b6145cae0c7504dadfdc1e844f1611a48cca3b4518d41b47e41a68f33043d58ffde85f1e56e3f3 thttpd.logrotated
+63f1f8cce5f29977dafd9dd364abc0e34bbf7049aef3a570efb96454fcf69fe6143d88e49640a52c58cbb6ad30d11dc2db5bd661fd1a6a26061ccc6913b1c117 discreet.patch
+02c079ca104f2358cd20756082657dca96f7a88cbeb611de81504f1581c5e085a7a2765ec55b6e0ae1948803afced85e8a45fc6deb2fef1ec5ba1ba96ce68b4b forwarded-for.patch
+503294520bd62170eae264ff1128f2b74d3d036d6c51b426e0a482f5d4a431f681f5076e6173ed04ee31065c042062759a3cc9208cf5c4a9c756ad806600635e getline.patch"
diff --git a/testing/thttpd/discreet.patch b/testing/thttpd/discreet.patch
new file mode 100644
index 0000000000..b427ecc2cb
--- /dev/null
+++ b/testing/thttpd/discreet.patch
@@ -0,0 +1,34 @@
+diff -Naur old/libhttpd.c new/libhttpd.c
+--- old/libhttpd.c 2012-04-27 14:24:50.971711600 +0200
++++ new/libhttpd.c 2012-04-27 14:33:24.559135581 +0200
+@@ -744,7 +744,7 @@
+ (void) my_snprintf( buf, sizeof(buf), "\
+ <HTML>\n\
+ <HEAD><TITLE>%d %s</TITLE></HEAD>\n\
+-<BODY BGCOLOR=\"#cc9999\" TEXT=\"#000000\" LINK=\"#2020ff\" VLINK=\"#4040cc\">\n\
++<BODY>\n\
+ <H2>%d %s</H2>\n",
+ status, title, status, title );
+ add_response( hc, buf );
+@@ -769,11 +769,8 @@
+ char buf[1000];
+
+ (void) my_snprintf( buf, sizeof(buf), "\
+-<HR>\n\
+-<ADDRESS><A HREF=\"%s\">%s</A></ADDRESS>\n\
+ </BODY>\n\
+-</HTML>\n",
+- SERVER_ADDRESS, EXPOSED_SERVER_SOFTWARE );
++</HTML>\n" );
+ add_response( hc, buf );
+ }
+
+@@ -2766,7 +2763,7 @@
+ (void) fprintf( fp, "\
+ <HTML>\n\
+ <HEAD><TITLE>Index of %.80s</TITLE></HEAD>\n\
+-<BODY BGCOLOR=\"#99cc99\" TEXT=\"#000000\" LINK=\"#2020ff\" VLINK=\"#4040cc\">\n\
++<BODY>\n\
+ <H2>Index of %.80s</H2>\n\
+ <PRE>\n\
+ mode links bytes last-changed name\n\
diff --git a/testing/thttpd/forwarded-for.patch b/testing/thttpd/forwarded-for.patch
new file mode 100644
index 0000000000..348eb00cf2
--- /dev/null
+++ b/testing/thttpd/forwarded-for.patch
@@ -0,0 +1,16 @@
+diff -Naur old/libhttpd.c new/libhttpd.c
+--- old/libhttpd.c 2005-06-30 03:50:39.000000000 +1000
++++ new/libhttpd.c 2012-10-24 12:12:17.144560917 +1100
+@@ -2207,6 +2207,12 @@
+ if ( strcasecmp( cp, "keep-alive" ) == 0 )
+ hc->keep_alive = 1;
+ }
++ else if ( strncasecmp( buf, "X-Forwarded-For:", 16 ) == 0 )
++ {
++ cp = &buf[16];
++ cp += strspn( cp, " \t" );
++ inet_aton( cp, &(hc->client_addr.sa_in.sin_addr) );
++ }
+ #ifdef LOG_UNKNOWN_HEADERS
+ else if ( strncasecmp( buf, "Accept-Charset:", 15 ) == 0 ||
+ strncasecmp( buf, "Accept-Language:", 16 ) == 0 ||
diff --git a/testing/thttpd/getline.patch b/testing/thttpd/getline.patch
new file mode 100644
index 0000000000..1ec3946b10
--- /dev/null
+++ b/testing/thttpd/getline.patch
@@ -0,0 +1,21 @@
+diff -Nur 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 2010-04-11 14:43:31.037809054 +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/testing/thttpd/thttpd.conf b/testing/thttpd/thttpd.conf
new file mode 100644
index 0000000000..3df0a660b0
--- /dev/null
+++ b/testing/thttpd/thttpd.conf
@@ -0,0 +1,8 @@
+dir=/var/www/http
+vhost
+chroot
+user=nobody
+cgipat=**.cgi
+logfile=/var/log/thttpd/thttpd.log
+pidfile=/var/run/thttpd.pid
+charset=utf-8
diff --git a/testing/thttpd/thttpd.confd b/testing/thttpd/thttpd.confd
new file mode 100644
index 0000000000..ad09531fe1
--- /dev/null
+++ b/testing/thttpd/thttpd.confd
@@ -0,0 +1,7 @@
+# Sample conf.d file for alpine linux
+
+#
+# Specify daemon options here.
+#
+
+sample_opts="-C /etc/thttpd.conf"
diff --git a/testing/thttpd/thttpd.initd b/testing/thttpd/thttpd.initd
new file mode 100644
index 0000000000..bd869489ee
--- /dev/null
+++ b/testing/thttpd/thttpd.initd
@@ -0,0 +1,28 @@
+#!/sbin/runscript
+
+# init.d file for thttpd
+
+name=thttpd
+daemon=/usr/sbin/$name
+
+depend() {
+ need net
+ after firewall
+}
+
+start() {
+ ebegin "Starting ${name}"
+ start-stop-daemon --start --quiet \
+ --pidfile /var/run/${name}.pid \
+ --exec ${daemon} -- ${sample_opts}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${name}"
+ start-stop-daemon --stop --quiet \
+ --pidfile /var/run/$name.pid \
+ --exec ${daemon}
+ eend $?
+}
+
diff --git a/testing/thttpd/thttpd.logrotated b/testing/thttpd/thttpd.logrotated
new file mode 100644
index 0000000000..cbc559fb33
--- /dev/null
+++ b/testing/thttpd/thttpd.logrotated
@@ -0,0 +1,6 @@
+/var/log/thttpd/*log {
+ missingok
+ postrotate
+ /etc/init.d/thttpd restart >/dev/null
+ endscript
+}
diff --git a/testing/thttpd/thttpd.post-install b/testing/thttpd/thttpd.post-install
new file mode 100644
index 0000000000..0586fcd5c5
--- /dev/null
+++ b/testing/thttpd/thttpd.post-install
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# add something which happends after install
+
diff --git a/testing/thttpd/thttpd.pre-install b/testing/thttpd/thttpd.pre-install
new file mode 100644
index 0000000000..46079e0c04
--- /dev/null
+++ b/testing/thttpd/thttpd.pre-install
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# add something which happends before install
+