blob: 8632b97f44e111fe7759a7123eec850931e419e9 [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
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08007DEPENDS += "base-passwd virtual/crypt"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05008
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
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080022inherit autotools update-rc.d systemd update-alternatives
23
24ALTERNATIVE_PRIORITY = "100"
25ALTERNATIVE_${PN}-doc = "htpasswd.1"
26ALTERNATIVE_LINK_NAME[htpasswd.1] = "${mandir}/man1/htpasswd.1"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050027
28SRV_DIR ?= "${servicedir}/www"
29
30# Note that `${sbindir}/makeweb' is installed setgid to this group,
31# but ${SRV_DIR} is not installed chgrp'd to the group by default.
32WEBGROUP ?= "www-data"
33
34do_configure_prepend () {
35 export WEBDIR=${SRV_DIR}
36 export WEBGROUP=${WEBGROUP}
37}
38
39do_install_append () {
40 install -d ${D}${sysconfdir}/init.d
41 install -c -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/thttpd
42 install -c -m 755 ${WORKDIR}/thttpd.conf ${D}${sysconfdir}
43 sed -i -e 's,@@CONFFILE,${sysconfdir}/thttpd.conf,g' ${D}${sysconfdir}/init.d/thttpd
44 sed -i -e 's,@@SRVDIR,${SRV_DIR},g' ${D}${sysconfdir}/thttpd.conf
45 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/thttpd
46
47 install -d ${D}${systemd_unitdir}/system
48 install -m 0644 ${WORKDIR}/thttpd.service ${D}${systemd_unitdir}/system
49 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${systemd_unitdir}/system/thttpd.service
50 sed -i 's!/var/!${localstatedir}/!g' ${D}${systemd_unitdir}/system/thttpd.service
51 sed -i -e 's,@@CONFFILE,${sysconfdir}/thttpd.conf,g' ${D}${systemd_unitdir}/system/thttpd.service
52}
53
54INITSCRIPT_NAME = "thttpd"
55INITSCRIPT_PARAMS = "defaults"
56
57SYSTEMD_SERVICE_${PN} = "thttpd.service"
58
59FILES_${PN} += "${SRV_DIR}"
60FILES_${PN}-dbg += "${SRV_DIR}/cgi-bin/.debug"