blob: 37bd7537dda53a962be689927fd83c39396e5336 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001SUMMARY = "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
7DEPENDS += "base-passwd"
8
9SRC_URI = "https://github.com/blueness/${BPN}/archive/v${PV}.tar.gz;downloadfilename=${BP}.tar.gz \
10 file://thttpd.service \
11 file://thttpd.conf \
12 file://init"
13
14SRC_URI[md5sum] = "3cda1b6c8c8542b1510eadb8e540d8b6"
15SRC_URI[sha256sum] = "a1ee2806432eaf5b5dd267a0523701f9f1fa00fefd499d5bec42165a41e05846"
16
Brad Bishop316dfdd2018-06-25 12:45:53 -040017UPSTREAM_CHECK_URI = "https://github.com/blueness/sthttpd/releases/"
18UPSTREAM_CHECK_REGEX = "v(?P<pver>\d+(\.\d+)+).tar.gz"
19
Brad Bishopd7bf8c12018-02-25 22:55:05 -050020S = "${WORKDIR}/sthttpd-${PV}"
21
22inherit autotools update-rc.d systemd
23
24SRV_DIR ?= "${servicedir}/www"
25
26# Note that `${sbindir}/makeweb' is installed setgid to this group,
27# but ${SRV_DIR} is not installed chgrp'd to the group by default.
28WEBGROUP ?= "www-data"
29
30do_configure_prepend () {
31 export WEBDIR=${SRV_DIR}
32 export WEBGROUP=${WEBGROUP}
33}
34
35do_install_append () {
36 install -d ${D}${sysconfdir}/init.d
37 install -c -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/thttpd
38 install -c -m 755 ${WORKDIR}/thttpd.conf ${D}${sysconfdir}
39 sed -i -e 's,@@CONFFILE,${sysconfdir}/thttpd.conf,g' ${D}${sysconfdir}/init.d/thttpd
40 sed -i -e 's,@@SRVDIR,${SRV_DIR},g' ${D}${sysconfdir}/thttpd.conf
41 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/thttpd
42
43 install -d ${D}${systemd_unitdir}/system
44 install -m 0644 ${WORKDIR}/thttpd.service ${D}${systemd_unitdir}/system
45 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${systemd_unitdir}/system/thttpd.service
46 sed -i 's!/var/!${localstatedir}/!g' ${D}${systemd_unitdir}/system/thttpd.service
47 sed -i -e 's,@@CONFFILE,${sysconfdir}/thttpd.conf,g' ${D}${systemd_unitdir}/system/thttpd.service
48}
49
50INITSCRIPT_NAME = "thttpd"
51INITSCRIPT_PARAMS = "defaults"
52
53SYSTEMD_SERVICE_${PN} = "thttpd.service"
54
55FILES_${PN} += "${SRV_DIR}"
56FILES_${PN}-dbg += "${SRV_DIR}/cgi-bin/.debug"