blob: a6b1ff0fc64dc226f18fd0d4e9dc02ca17dcbd82 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001SUMMARY = "A simple, fast and secure HTTP server"
2HOMEPAGE = "http://www.nazgul.ch/dev_nostromo.html"
3LICENSE = "MIT"
Patrick Williamsddad1a12017-02-23 20:36:32 -06004LIC_FILES_CHKSUM = "file://src/nhttpd/main.c;beginline=2;endline=14;md5=0bb3711a867b9704d3bfabcf5529b64e"
Patrick Williamsb48b7b42016-08-17 15:04:38 -05005
6SRC_URI = "http://www.nazgul.ch/dev/${BPN}-${PV}.tar.gz \
7 file://0001-GNUmakefile-add-possibility-to-override-variables.patch \
8 file://nhttpd.conf \
9 file://volatiles \
10 file://tmpfiles.conf \
11 file://nostromo \
12"
13
Patrick Williamsddad1a12017-02-23 20:36:32 -060014SRC_URI[md5sum] = "27aa241d78ff78920354c3e03a5026ea"
15SRC_URI[sha256sum] = "541494ecfeafec58c0876ccc90cc23b06e0144f6f42029af44c7cdb1f411e8eb"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050016
17TARGET_CC_ARCH += "${LDFLAGS}"
18
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080019DEPENDS = "openssl groff-native base-passwd virtual/crypt"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050020
Patrick Williamsddad1a12017-02-23 20:36:32 -060021inherit update-rc.d
Patrick Williamsb48b7b42016-08-17 15:04:38 -050022
23INITSCRIPT_NAME = "nostromo"
24INITSCRIPT_PARAMS = "defaults 70"
25
26do_compile() {
27 oe_runmake
28}
29
Patrick Williamsb48b7b42016-08-17 15:04:38 -050030do_install() {
31 install -d ${D}/${sbindir}
32 install -m 0755 src/nhttpd/nhttpd ${D}/${sbindir}/nhttpd
33 install -m 0755 src/tools/crypt ${D}/${sbindir}/crypt
34 install -d ${D}/${mandir}/man8
35 install -m 0444 src/nhttpd/nhttpd.8 ${D}/${mandir}/man8/nhttpd.8
36 install -d ${D}${localstatedir}/nostromo/conf
37 install -d ${D}${localstatedir}/nostromo/htdocs/cgi-bin
38 install -d ${D}${localstatedir}/nostromo/icons
39 install -d ${D}${sysconfdir}/init.d
40 install -m 0644 conf/mimes ${D}${localstatedir}/nostromo/conf/mimes
41 install -m 0644 ${WORKDIR}/nhttpd.conf ${D}${sysconfdir}
42 install -m 0755 ${WORKDIR}/nostromo ${D}${sysconfdir}/init.d
43 install -D -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/nostromo
44 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
45 install -D -m 0644 ${WORKDIR}/tmpfiles.conf ${D}${sysconfdir}/tmpfiles.d/nostromo.conf
46 fi
47 install -m 0644 htdocs/index.html ${D}${localstatedir}/nostromo/htdocs/index.html
48 install -m 0644 htdocs/nostromo.gif ${D}${localstatedir}/nostromo/htdocs/nostromo.gif
49 install -m 0644 icons/dir.gif ${D}${localstatedir}/nostromo/icons/dir.gif
50 install -m 0644 icons/file.gif ${D}${localstatedir}/nostromo/icons/file.gif
51 chown -R www-data:www-data ${D}/${localstatedir}/nostromo
52}
53
54CONFFILES_${PN} += "/var/nostromo/conf/mimes ${sysconfdir}/nhttpd.conf"
55
56pkg_postinst_${PN} () {
57 if [ -z "$D" ]; then
58 if [ -e /sys/fs/cgroup/systemd ]; then
59 systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/nostromo.conf
60 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
61 ${sysconfdir}/init.d/populate-volatile.sh update
62 fi
63 fi
64}