xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.27.1.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSUMMARY = "A simple, small, portable, fast, and secure HTTP server"
2*4882a593SmuzhiyunDESCRIPTION = "A simple, small, portable, fast, and secure HTTP server (supported fork of thttpd)."
3*4882a593SmuzhiyunHOMEPAGE = "http://opensource.dyc.edu/sthttpd"
4*4882a593SmuzhiyunLICENSE = "BSD-2-Clause"
5*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://src/thttpd.c;beginline=1;endline=26;md5=0c5762c2c34dcbe9eb18815516502872"
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunDEPENDS += "base-passwd virtual/crypt"
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunSRCREV = "2845bf5bff2b820d2336c8c8061cbfc5f271e720"
10*4882a593SmuzhiyunSRC_URI = "git://github.com/blueness/${BPN};branch=master;protocol=https \
11*4882a593Smuzhiyun           file://thttpd.service \
12*4882a593Smuzhiyun           file://thttpd.conf \
13*4882a593Smuzhiyun           file://init"
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunUPSTREAM_CHECK_URI = "https://github.com/blueness/sthttpd/releases/"
16*4882a593SmuzhiyunUPSTREAM_CHECK_REGEX = "v(?P<pver>\d+(\.\d+)+).tar.gz"
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunS = "${WORKDIR}/git"
19*4882a593Smuzhiyun
20*4882a593Smuzhiyuninherit autotools update-rc.d systemd update-alternatives
21*4882a593Smuzhiyun
22*4882a593SmuzhiyunALTERNATIVE_PRIORITY = "100"
23*4882a593SmuzhiyunALTERNATIVE:${PN}-doc = "htpasswd.1"
24*4882a593SmuzhiyunALTERNATIVE_LINK_NAME[htpasswd.1] = "${mandir}/man1/htpasswd.1"
25*4882a593Smuzhiyun
26*4882a593SmuzhiyunSRV_DIR ?= "${servicedir}/www"
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun# Note that `${sbindir}/makeweb' is installed setgid to this group,
29*4882a593Smuzhiyun# but ${SRV_DIR} is not installed chgrp'd to the group by default.
30*4882a593SmuzhiyunWEBGROUP ?= "www-data"
31*4882a593Smuzhiyun
32*4882a593Smuzhiyundo_configure:prepend () {
33*4882a593Smuzhiyun    export WEBDIR=${SRV_DIR}
34*4882a593Smuzhiyun    export WEBGROUP=${WEBGROUP}
35*4882a593Smuzhiyun}
36*4882a593Smuzhiyun
37*4882a593Smuzhiyundo_install:append () {
38*4882a593Smuzhiyun    install -d ${D}${sysconfdir}/init.d
39*4882a593Smuzhiyun    install -c -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/thttpd
40*4882a593Smuzhiyun    install -c -m 755 ${WORKDIR}/thttpd.conf ${D}${sysconfdir}
41*4882a593Smuzhiyun    sed -i -e 's,@@CONFFILE,${sysconfdir}/thttpd.conf,g' ${D}${sysconfdir}/init.d/thttpd
42*4882a593Smuzhiyun    sed -i -e 's,@@SRVDIR,${SRV_DIR},g' ${D}${sysconfdir}/thttpd.conf
43*4882a593Smuzhiyun    sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/thttpd
44*4882a593Smuzhiyun
45*4882a593Smuzhiyun    install -d ${D}${systemd_unitdir}/system
46*4882a593Smuzhiyun    install -m 0644 ${WORKDIR}/thttpd.service ${D}${systemd_unitdir}/system
47*4882a593Smuzhiyun    sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${systemd_unitdir}/system/thttpd.service
48*4882a593Smuzhiyun    sed -i 's!/var/!${localstatedir}/!g' ${D}${systemd_unitdir}/system/thttpd.service
49*4882a593Smuzhiyun    sed -i -e 's,@@CONFFILE,${sysconfdir}/thttpd.conf,g' ${D}${systemd_unitdir}/system/thttpd.service
50*4882a593Smuzhiyun}
51*4882a593Smuzhiyun
52*4882a593SmuzhiyunINITSCRIPT_NAME = "thttpd"
53*4882a593SmuzhiyunINITSCRIPT_PARAMS = "defaults"
54*4882a593Smuzhiyun
55*4882a593SmuzhiyunSYSTEMD_SERVICE:${PN} = "thttpd.service"
56*4882a593Smuzhiyun
57*4882a593SmuzhiyunFILES:${PN} += "${SRV_DIR}"
58*4882a593SmuzhiyunFILES:${PN}-dbg += "${SRV_DIR}/cgi-bin/.debug"
59