blob: b40b148512503930de1bba20b2e8d7ff87f4767d [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
Brad Bishop26bdd442019-08-16 17:08:17 -04009SRCREV = "2845bf5bff2b820d2336c8c8061cbfc5f271e720"
Andrew Geissler595f6302022-01-24 19:11:47 +000010SRC_URI = "git://github.com/blueness/${BPN};branch=master;protocol=https \
Andrew Geissler87f5cff2022-09-30 13:13:31 -050011 file://0001-Define-_GNU_SOURCE-if-HAVE_SIGSET-is-set.patch \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050012 file://thttpd.service \
13 file://thttpd.conf \
14 file://init"
15
Brad Bishop316dfdd2018-06-25 12:45:53 -040016UPSTREAM_CHECK_URI = "https://github.com/blueness/sthttpd/releases/"
17UPSTREAM_CHECK_REGEX = "v(?P<pver>\d+(\.\d+)+).tar.gz"
18
Brad Bishop26bdd442019-08-16 17:08:17 -040019S = "${WORKDIR}/git"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050020
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080021inherit autotools update-rc.d systemd update-alternatives
22
23ALTERNATIVE_PRIORITY = "100"
Patrick Williams213cb262021-08-07 19:21:33 -050024ALTERNATIVE:${PN}-doc = "htpasswd.1"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080025ALTERNATIVE_LINK_NAME[htpasswd.1] = "${mandir}/man1/htpasswd.1"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050026
27SRV_DIR ?= "${servicedir}/www"
28
29# Note that `${sbindir}/makeweb' is installed setgid to this group,
30# but ${SRV_DIR} is not installed chgrp'd to the group by default.
31WEBGROUP ?= "www-data"
32
Patrick Williams213cb262021-08-07 19:21:33 -050033do_configure:prepend () {
Brad Bishopd7bf8c12018-02-25 22:55:05 -050034 export WEBDIR=${SRV_DIR}
35 export WEBGROUP=${WEBGROUP}
36}
37
Patrick Williams213cb262021-08-07 19:21:33 -050038do_install:append () {
Brad Bishopd7bf8c12018-02-25 22:55:05 -050039 install -d ${D}${sysconfdir}/init.d
40 install -c -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/thttpd
41 install -c -m 755 ${WORKDIR}/thttpd.conf ${D}${sysconfdir}
42 sed -i -e 's,@@CONFFILE,${sysconfdir}/thttpd.conf,g' ${D}${sysconfdir}/init.d/thttpd
43 sed -i -e 's,@@SRVDIR,${SRV_DIR},g' ${D}${sysconfdir}/thttpd.conf
44 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/thttpd
45
46 install -d ${D}${systemd_unitdir}/system
47 install -m 0644 ${WORKDIR}/thttpd.service ${D}${systemd_unitdir}/system
48 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${systemd_unitdir}/system/thttpd.service
49 sed -i 's!/var/!${localstatedir}/!g' ${D}${systemd_unitdir}/system/thttpd.service
50 sed -i -e 's,@@CONFFILE,${sysconfdir}/thttpd.conf,g' ${D}${systemd_unitdir}/system/thttpd.service
51}
52
53INITSCRIPT_NAME = "thttpd"
54INITSCRIPT_PARAMS = "defaults"
55
Patrick Williams213cb262021-08-07 19:21:33 -050056SYSTEMD_SERVICE:${PN} = "thttpd.service"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050057
Patrick Williams213cb262021-08-07 19:21:33 -050058FILES:${PN} += "${SRV_DIR}"
59FILES:${PN}-dbg += "${SRV_DIR}/cgi-bin/.debug"