blob: 562ecd0049850b38ac83d74d29c9f7fff3c77e31 [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"
4LIC_FILES_CHKSUM = "file://src/nhttpd/main.c;beginline=2;endline=14;md5=e5ec3fa723b29b7d59d205afd8d36938"
5
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
14SRC_URI[md5sum] = "dc6cfd6b5aae04c370c7f818fa7bde55"
15SRC_URI[sha256sum] = "5f62578285e02449406b46cf06a7888fe3dc4a90bedf58cc18523bad62f6b914"
16
17TARGET_CC_ARCH += "${LDFLAGS}"
18
19DEPENDS = "openssl"
20
21inherit update-rc.d useradd
22
23INITSCRIPT_NAME = "nostromo"
24INITSCRIPT_PARAMS = "defaults 70"
25
26do_compile() {
27 oe_runmake
28}
29
30# we need user/group www-data to exist when we install
31#
32USERADD_PACKAGES = "${PN}"
33USERADD_PARAM_${PN} = "--system -g www-data www-data"
34
35do_install() {
36 install -d ${D}/${sbindir}
37 install -m 0755 src/nhttpd/nhttpd ${D}/${sbindir}/nhttpd
38 install -m 0755 src/tools/crypt ${D}/${sbindir}/crypt
39 install -d ${D}/${mandir}/man8
40 install -m 0444 src/nhttpd/nhttpd.8 ${D}/${mandir}/man8/nhttpd.8
41 install -d ${D}${localstatedir}/nostromo/conf
42 install -d ${D}${localstatedir}/nostromo/htdocs/cgi-bin
43 install -d ${D}${localstatedir}/nostromo/icons
44 install -d ${D}${sysconfdir}/init.d
45 install -m 0644 conf/mimes ${D}${localstatedir}/nostromo/conf/mimes
46 install -m 0644 ${WORKDIR}/nhttpd.conf ${D}${sysconfdir}
47 install -m 0755 ${WORKDIR}/nostromo ${D}${sysconfdir}/init.d
48 install -D -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/nostromo
49 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
50 install -D -m 0644 ${WORKDIR}/tmpfiles.conf ${D}${sysconfdir}/tmpfiles.d/nostromo.conf
51 fi
52 install -m 0644 htdocs/index.html ${D}${localstatedir}/nostromo/htdocs/index.html
53 install -m 0644 htdocs/nostromo.gif ${D}${localstatedir}/nostromo/htdocs/nostromo.gif
54 install -m 0644 icons/dir.gif ${D}${localstatedir}/nostromo/icons/dir.gif
55 install -m 0644 icons/file.gif ${D}${localstatedir}/nostromo/icons/file.gif
56 chown -R www-data:www-data ${D}/${localstatedir}/nostromo
57}
58
59CONFFILES_${PN} += "/var/nostromo/conf/mimes ${sysconfdir}/nhttpd.conf"
60
61pkg_postinst_${PN} () {
62 if [ -z "$D" ]; then
63 if [ -e /sys/fs/cgroup/systemd ]; then
64 systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/nostromo.conf
65 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
66 ${sysconfdir}/init.d/populate-volatile.sh update
67 fi
68 fi
69}