diff options
author | Jack Mitchell <jmitchell@cbnl.com> | 2014-06-16 17:40:29 +0100 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2014-06-21 10:36:53 +0200 |
commit | 117716e668fee5910df7f06a9b2b57bf0ad5285a (patch) | |
tree | 30ac9a3d358d901b5f674f2be54a6554a182a091 /meta-webserver/recipes-httpd/sthttpd/sthttpd_2.26.4.bb | |
parent | a6eaef942529ed9fc511bd86dd00369862297b26 (diff) | |
download | meta-openembedded-contrib-117716e668fee5910df7f06a9b2b57bf0ad5285a.tar.gz |
sthttpd: improve init scripts to use config file
Rather than put hardcoded values into the init scripts,
use a config file. The SRV_DIR is a special value as it
should be used in the conifg file and also passed to make
so it can put the html files in the correct directory.
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-webserver/recipes-httpd/sthttpd/sthttpd_2.26.4.bb')
-rw-r--r-- | meta-webserver/recipes-httpd/sthttpd/sthttpd_2.26.4.bb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.26.4.bb b/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.26.4.bb index 0abd13169e..703492167f 100644 --- a/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.26.4.bb +++ b/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.26.4.bb @@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://src/thttpd.c;beginline=1;endline=26;md5=0c5762c2c34dc SRC_URI = "http://opensource.dyc.edu/pub/sthttpd/sthttpd-${PV}.tar.gz \ file://thttpd.service \ + file://thttpd.conf \ file://init" SRC_URI[md5sum] = "e645a85a97d3cb883011a35bc2211815" @@ -15,19 +16,23 @@ S = "${WORKDIR}/sthttpd-${PV}" inherit autotools update-rc.d systemd -EXTRA_OEMAKE += "'WEBDIR=${servicedir}/www'" +SRV_DIR ?= "${servicedir}/www" + +EXTRA_OEMAKE += "'WEBDIR=${SRV_DIR}'" do_install_append () { install -d ${D}${sysconfdir}/init.d install -c -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/thttpd - sed -i -e 's,@@SRVDIR,${servicedir}/www,g' ${D}${sysconfdir}/init.d/thttpd + install -c -m 755 ${WORKDIR}/thttpd.conf ${D}${sysconfdir} + sed -i -e 's,@@CONFFILE,${sysconfdir}/thttpd.conf,g' ${D}${sysconfdir}/init.d/thttpd + sed -i -e 's,@@SRVDIR,${SRV_DIR},g' ${D}${sysconfdir}/thttpd.conf sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/thttpd install -d ${D}${systemd_unitdir}/system install -m 0644 ${WORKDIR}/thttpd.service ${D}${systemd_unitdir}/system sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${systemd_unitdir}/system/thttpd.service sed -i 's!/var/!${localstatedir}/!g' ${D}${systemd_unitdir}/system/thttpd.service - sed -i -e 's,@@SRVDIR,${servicedir}/www,g' ${D}${systemd_unitdir}/system/thttpd.service + sed -i -e 's,@@CONFFILE,${sysconfdir}/thttpd.conf,g' ${D}${systemd_unitdir}/system/thttpd.service } INITSCRIPT_NAME = "thttpd" @@ -35,6 +40,6 @@ INITSCRIPT_PARAMS = "defaults" SYSTEMD_SERVICE_${PN} = "thttpd.service" -FILES_${PN} += "${servicedir}" -FILES_${PN}-dbg += "${servicedir}/www/cgi-bin/.debug" +FILES_${PN} += "${SRV_DIR}" +FILES_${PN}-dbg += "${SRV_DIR}/cgi-bin/.debug" |