summaryrefslogtreecommitdiffstats
path: root/meta-webserver/recipes-httpd/sthttpd
diff options
context:
space:
mode:
Diffstat (limited to 'meta-webserver/recipes-httpd/sthttpd')
-rw-r--r--meta-webserver/recipes-httpd/sthttpd/sthttpd/init52
-rw-r--r--meta-webserver/recipes-httpd/sthttpd/sthttpd/thttpd.service10
-rw-r--r--meta-webserver/recipes-httpd/sthttpd/sthttpd_2.26.4.bb40
3 files changed, 102 insertions, 0 deletions
diff --git a/meta-webserver/recipes-httpd/sthttpd/sthttpd/init b/meta-webserver/recipes-httpd/sthttpd/sthttpd/init
new file mode 100644
index 0000000000..70f6797a75
--- /dev/null
+++ b/meta-webserver/recipes-httpd/sthttpd/sthttpd/init
@@ -0,0 +1,52 @@
1#!/bin/sh
2
3### BEGIN INIT INFO
4# Provides: thttpd
5# Required-Start: $remote_fs $syslog
6# Required-Stop: $remote_fs $syslog
7# Default-Start: 2 3 4 5
8# Default-Stop: 0 1 6
9# Short-Description: Small http server
10# Description: thttpd is a simple, small, portable, fast, and secure HTTP server.
11### END INIT INFO
12
13
14thttpd=/usr/sbin/thttpd
15test -x "$thttpd" || exit 0
16
17
18case "$1" in
19 start)
20 echo -n "Starting thttpd"
21 start-stop-daemon --start --quiet --exec $thttpd -- -d @@SRVDIR
22 echo "."
23 ;;
24 stop)
25 echo -n "Stopping thttpd"
26 start-stop-daemon --stop --quiet --exec $thttpd
27 echo "."
28 ;;
29 reload|force-reload)
30 start-stop-daemon --stop --quiet --signal 1 --exec $thttpd
31 ;;
32 restart)
33 echo -n "Stopping thttpd"
34 start-stop-daemon --stop --quiet --exec $thttpd -- -d @@SRVDIR
35 echo "."
36 echo -n "Waiting for thttpd to die off"
37 for i in 1 2 3 ;
38 do
39 sleep 1
40 echo -n "."
41 done
42 echo ""
43 echo -n "Starting thttpd"
44 start-stop-daemon --start --quiet --exec $thttpd -- -d @@SRVDIR
45 echo "."
46 ;;
47 *)
48 echo "Usage: /etc/init.d/thttpd {start|stop|reload|restart|force-reload}"
49 exit 1
50esac
51
52exit 0
diff --git a/meta-webserver/recipes-httpd/sthttpd/sthttpd/thttpd.service b/meta-webserver/recipes-httpd/sthttpd/sthttpd/thttpd.service
new file mode 100644
index 0000000000..e2dae61fd0
--- /dev/null
+++ b/meta-webserver/recipes-httpd/sthttpd/sthttpd/thttpd.service
@@ -0,0 +1,10 @@
1[Unit]
2Description=Tiny/Turbo/Throttling Web Server
3
4[Service]
5Type=forking
6ExecStart=/usr/sbin/thttpd -d @@SRVDIR -c cgi-bin/* -i /var/run/thttpd.pid
7PIDFile=/var/run/thttpd.pid
8
9[Install]
10WantedBy=multi-user.target
diff --git a/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.26.4.bb b/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.26.4.bb
new file mode 100644
index 0000000000..0abd13169e
--- /dev/null
+++ b/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.26.4.bb
@@ -0,0 +1,40 @@
1SUMMARY = "A simple, small, portable, fast, and secure HTTP server"
2DESCRIPTION = "A simple, small, portable, fast, and secure HTTP server (supported fork of thttpd)."
3HOMEPAGE = "http://opensource.dyc.edu/sthttpd"
4LICENSE = "BSD-2-Clause"
5LIC_FILES_CHKSUM = "file://src/thttpd.c;beginline=1;endline=26;md5=0c5762c2c34dcbe9eb18815516502872"
6
7SRC_URI = "http://opensource.dyc.edu/pub/sthttpd/sthttpd-${PV}.tar.gz \
8 file://thttpd.service \
9 file://init"
10
11SRC_URI[md5sum] = "e645a85a97d3cb883011a35bc2211815"
12SRC_URI[sha256sum] = "78e87979140cbda123c81b4051552242dbbffb5dec1a17e5f95ec4826b1eaddb"
13
14S = "${WORKDIR}/sthttpd-${PV}"
15
16inherit autotools update-rc.d systemd
17
18EXTRA_OEMAKE += "'WEBDIR=${servicedir}/www'"
19
20do_install_append () {
21 install -d ${D}${sysconfdir}/init.d
22 install -c -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/thttpd
23 sed -i -e 's,@@SRVDIR,${servicedir}/www,g' ${D}${sysconfdir}/init.d/thttpd
24 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/thttpd
25
26 install -d ${D}${systemd_unitdir}/system
27 install -m 0644 ${WORKDIR}/thttpd.service ${D}${systemd_unitdir}/system
28 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${systemd_unitdir}/system/thttpd.service
29 sed -i 's!/var/!${localstatedir}/!g' ${D}${systemd_unitdir}/system/thttpd.service
30 sed -i -e 's,@@SRVDIR,${servicedir}/www,g' ${D}${systemd_unitdir}/system/thttpd.service
31}
32
33INITSCRIPT_NAME = "thttpd"
34INITSCRIPT_PARAMS = "defaults"
35
36SYSTEMD_SERVICE_${PN} = "thttpd.service"
37
38FILES_${PN} += "${servicedir}"
39FILES_${PN}-dbg += "${servicedir}/www/cgi-bin/.debug"
40