Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 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 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 7 | DEPENDS += "base-passwd virtual/crypt" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 8 | |
| 9 | SRC_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 | |
| 14 | SRC_URI[md5sum] = "3cda1b6c8c8542b1510eadb8e540d8b6" |
| 15 | SRC_URI[sha256sum] = "a1ee2806432eaf5b5dd267a0523701f9f1fa00fefd499d5bec42165a41e05846" |
| 16 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 17 | UPSTREAM_CHECK_URI = "https://github.com/blueness/sthttpd/releases/" |
| 18 | UPSTREAM_CHECK_REGEX = "v(?P<pver>\d+(\.\d+)+).tar.gz" |
| 19 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 20 | S = "${WORKDIR}/sthttpd-${PV}" |
| 21 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 22 | inherit autotools update-rc.d systemd update-alternatives |
| 23 | |
| 24 | ALTERNATIVE_PRIORITY = "100" |
| 25 | ALTERNATIVE_${PN}-doc = "htpasswd.1" |
| 26 | ALTERNATIVE_LINK_NAME[htpasswd.1] = "${mandir}/man1/htpasswd.1" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 27 | |
| 28 | SRV_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. |
| 32 | WEBGROUP ?= "www-data" |
| 33 | |
| 34 | do_configure_prepend () { |
| 35 | export WEBDIR=${SRV_DIR} |
| 36 | export WEBGROUP=${WEBGROUP} |
| 37 | } |
| 38 | |
| 39 | do_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 | |
| 54 | INITSCRIPT_NAME = "thttpd" |
| 55 | INITSCRIPT_PARAMS = "defaults" |
| 56 | |
| 57 | SYSTEMD_SERVICE_${PN} = "thttpd.service" |
| 58 | |
| 59 | FILES_${PN} += "${SRV_DIR}" |
| 60 | FILES_${PN}-dbg += "${SRV_DIR}/cgi-bin/.debug" |