diff options
Diffstat (limited to 'meta-webserver/recipes-httpd/sthttpd')
4 files changed, 108 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 000000000..f5f7b0124 --- /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 | |||
14 | thttpd=/usr/sbin/thttpd | ||
15 | test -x "$thttpd" || exit 0 | ||
16 | |||
17 | |||
18 | case "$1" in | ||
19 | start) | ||
20 | echo -n "Starting thttpd" | ||
21 | start-stop-daemon --start --quiet --exec $thttpd -- -C @@CONFFILE | ||
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 -- -C @@CONFFILE | ||
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 -- -C @@CONFFILE | ||
45 | echo "." | ||
46 | ;; | ||
47 | *) | ||
48 | echo "Usage: /etc/init.d/thttpd {start|stop|reload|restart|force-reload}" | ||
49 | exit 1 | ||
50 | esac | ||
51 | |||
52 | exit 0 | ||
diff --git a/meta-webserver/recipes-httpd/sthttpd/sthttpd/thttpd.conf b/meta-webserver/recipes-httpd/sthttpd/sthttpd/thttpd.conf new file mode 100644 index 000000000..397984f36 --- /dev/null +++ b/meta-webserver/recipes-httpd/sthttpd/sthttpd/thttpd.conf | |||
@@ -0,0 +1 @@ | |||
dir=@@SRVDIR | |||
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 000000000..f1095007c --- /dev/null +++ b/meta-webserver/recipes-httpd/sthttpd/sthttpd/thttpd.service | |||
@@ -0,0 +1,10 @@ | |||
1 | [Unit] | ||
2 | Description=Tiny/Turbo/Throttling Web Server | ||
3 | |||
4 | [Service] | ||
5 | Type=forking | ||
6 | ExecStart=/usr/sbin/thttpd -C @@CONFFILE -c cgi-bin/* -i /var/run/thttpd.pid | ||
7 | PIDFile=/var/run/thttpd.pid | ||
8 | |||
9 | [Install] | ||
10 | WantedBy=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 000000000..703492167 --- /dev/null +++ b/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.26.4.bb | |||
@@ -0,0 +1,45 @@ | |||
1 | SUMMARY = "A simple, small, portable, fast, and secure HTTP server" | ||
2 | DESCRIPTION = "A simple, small, portable, fast, and secure HTTP server (supported fork of thttpd)." | ||
3 | HOMEPAGE = "http://opensource.dyc.edu/sthttpd" | ||
4 | LICENSE = "BSD-2-Clause" | ||
5 | LIC_FILES_CHKSUM = "file://src/thttpd.c;beginline=1;endline=26;md5=0c5762c2c34dcbe9eb18815516502872" | ||
6 | |||
7 | SRC_URI = "http://opensource.dyc.edu/pub/sthttpd/sthttpd-${PV}.tar.gz \ | ||
8 | file://thttpd.service \ | ||
9 | file://thttpd.conf \ | ||
10 | file://init" | ||
11 | |||
12 | SRC_URI[md5sum] = "e645a85a97d3cb883011a35bc2211815" | ||
13 | SRC_URI[sha256sum] = "78e87979140cbda123c81b4051552242dbbffb5dec1a17e5f95ec4826b1eaddb" | ||
14 | |||
15 | S = "${WORKDIR}/sthttpd-${PV}" | ||
16 | |||
17 | inherit autotools update-rc.d systemd | ||
18 | |||
19 | SRV_DIR ?= "${servicedir}/www" | ||
20 | |||
21 | EXTRA_OEMAKE += "'WEBDIR=${SRV_DIR}'" | ||
22 | |||
23 | do_install_append () { | ||
24 | install -d ${D}${sysconfdir}/init.d | ||
25 | install -c -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/thttpd | ||
26 | install -c -m 755 ${WORKDIR}/thttpd.conf ${D}${sysconfdir} | ||
27 | sed -i -e 's,@@CONFFILE,${sysconfdir}/thttpd.conf,g' ${D}${sysconfdir}/init.d/thttpd | ||
28 | sed -i -e 's,@@SRVDIR,${SRV_DIR},g' ${D}${sysconfdir}/thttpd.conf | ||
29 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/thttpd | ||
30 | |||
31 | install -d ${D}${systemd_unitdir}/system | ||
32 | install -m 0644 ${WORKDIR}/thttpd.service ${D}${systemd_unitdir}/system | ||
33 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${systemd_unitdir}/system/thttpd.service | ||
34 | sed -i 's!/var/!${localstatedir}/!g' ${D}${systemd_unitdir}/system/thttpd.service | ||
35 | sed -i -e 's,@@CONFFILE,${sysconfdir}/thttpd.conf,g' ${D}${systemd_unitdir}/system/thttpd.service | ||
36 | } | ||
37 | |||
38 | INITSCRIPT_NAME = "thttpd" | ||
39 | INITSCRIPT_PARAMS = "defaults" | ||
40 | |||
41 | SYSTEMD_SERVICE_${PN} = "thttpd.service" | ||
42 | |||
43 | FILES_${PN} += "${SRV_DIR}" | ||
44 | FILES_${PN}-dbg += "${SRV_DIR}/cgi-bin/.debug" | ||
45 | |||