Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | SUMMARY = "Lightweight secure web server" |
| 2 | HOMEPAGE = "http://www.hiawatha-webserver.org" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 3 | LICENSE = "GPL-2.0-only" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe" |
| 5 | DEPENDS = "libxml2 libxslt virtual/crypt" |
| 6 | |
| 7 | SECTION = "net" |
| 8 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 9 | SRC_URI = "http://hiawatha-webserver.org/files/hiawatha-10/${BP}.tar.gz \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 10 | file://hiawatha-init \ |
| 11 | file://hiawatha.service " |
| 12 | |
Andrew Geissler | f103a7f | 2021-05-07 16:09:40 -0500 | [diff] [blame] | 13 | SRC_URI[md5sum] = "d9e282be06ed456207726b7ac0df9d48" |
| 14 | SRC_URI[sha256sum] = "61bf41146c51244769984135529fcffd0f6cb92be18dc12d460effc42f19f50d" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 15 | |
| 16 | INITSCRIPT_NAME = "hiawatha" |
| 17 | INITSCRIPT_PARAMS = "defaults 70" |
| 18 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 19 | SYSTEMD_SERVICE:${PN} = "hiawatha.service" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 20 | |
| 21 | inherit cmake update-rc.d systemd |
| 22 | |
| 23 | EXTRA_OECMAKE = " -DENABLE_IPV6=OFF \ |
| 24 | -DENABLE_CACHE=OFF \ |
| 25 | -DENABLE_DEBUG=OFF \ |
| 26 | -DENABLE_TLS=OFF \ |
| 27 | -DENABLE_TOOLKIT=OFF \ |
| 28 | -DENABLE_CHROOT=OFF \ |
| 29 | -DENABLE_XSLT=ON \ |
| 30 | -DENABLE_TOMAHAWK=OFF \ |
| 31 | -DCMAKE_INSTALL_MANDIR=${mandir} \ |
| 32 | -DCMAKE_INSTALL_BINDIR=${bindir} \ |
| 33 | -DCMAKE_INSTALL_SBINDIR=${sbindir} \ |
| 34 | -DCMAKE_INSTALL_SYSCONFDIR=${sysconfdir} \ |
| 35 | -DCMAKE_INSTALL_LIBDIR=${libdir} \ |
| 36 | -DCMAKE_INSTALL_FULL_LOCALSTATEDIR=${localstatedir}" |
| 37 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 38 | do_install:append() { |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 39 | # Copy over init script and sed in the correct sbin path |
| 40 | sed -i 's,sed_sbin_path,${sbindir},' ${WORKDIR}/hiawatha-init |
| 41 | mkdir -p ${D}${sysconfdir}/init.d |
| 42 | install -m 0755 ${WORKDIR}/hiawatha-init ${D}${sysconfdir}/init.d/hiawatha |
| 43 | |
| 44 | # configure php-fcgi to have a working configuration |
| 45 | # by default if php is installed |
| 46 | echo "Server = ${bindir}/php-cgi ; 2 ; 127.0.0.1:2005 ; nobody:nobody ; ${sysconfdir}/php/hiawatha-php5/php.ini" >> ${D}${sysconfdir}/hiawatha/php-fcgi.conf |
| 47 | |
| 48 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 49 | install -d ${D}/${systemd_unitdir}/system |
| 50 | install -m 644 ${WORKDIR}/hiawatha.service ${D}/${systemd_unitdir}/system |
| 51 | fi |
| 52 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 53 | # /var/log/hiawatha and /var/lib/hiawatha needs to be created in runtime. |
| 54 | # Use rmdir to catch if upstream stops creating these dirs, or adds |
| 55 | # something else in /var/log. |
| 56 | rmdir ${D}${localstatedir}/log/${BPN} ${D}${localstatedir}/log |
| 57 | rmdir ${D}${localstatedir}/run |
| 58 | rmdir --ignore-fail-on-non-empty ${D}${localstatedir} |
| 59 | |
| 60 | # Create /var/log/hiawatha at runtime. |
| 61 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" ]; then |
| 62 | install -d ${D}${nonarch_libdir}/tmpfiles.d |
| 63 | echo "d ${localstatedir}/log/${BPN} - - - -" > ${D}${nonarch_libdir}/tmpfiles.d/${BPN}.conf |
| 64 | fi |
| 65 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ]; then |
| 66 | install -d ${D}${sysconfdir}/default/volatiles |
| 67 | echo "d root root 0755 ${localstatedir}/log/${BPN} none" > ${D}${sysconfdir}/default/volatiles/99_${BPN} |
| 68 | fi |
| 69 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 70 | } |
| 71 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 72 | CONFFILES:${PN} = " \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 73 | ${sysconfdir}/hiawatha/cgi-wrapper.conf \ |
| 74 | ${sysconfdir}/hiawatha/hiawatha.conf \ |
| 75 | ${sysconfdir}/hiawatha/index.xslt \ |
| 76 | ${sysconfdir}/hiawatha/mimetype.conf \ |
| 77 | ${sysconfdir}/hiawatha/php-fcgi.conf \ |
| 78 | " |
| 79 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 80 | FILES:${PN} += "${nonarch_libdir}/tmpfiles.d" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 81 | FILES:${PN}-dev = "${libdir}/hiawatha/*${SOLIBSDEV}" |