# Maintainer: Kyle Keen # Contributor: Kurt Marasco # Contributor: Pascal Ernster # Contributor: Kewl pkgname=hiawatha pkgver=10.9 pkgrel=2 pkgdesc="Secure and advanced webserver" url="https://www.hiawatha-webserver.org/" arch=('x86_64') license=('GPL2') depends=('libxslt' 'mbedtls') optdepends=('php-fpm: PHP fastcgi' 'php: lefh') makedepends=('cmake') backup=( 'etc/hiawatha/hiawatha.conf' 'etc/hiawatha/cgi-wrapper.conf' 'etc/hiawatha/mimetype.conf' ) source=( "https://www.hiawatha-webserver.org/files/$pkgname-$pkgver.tar.gz" 'hiawatha.service' 'lefh-renew.service' 'lefh-renew.timer' ) sha256sums=('74dd43812272c3ddbf067b6d4da1773cdeef2ffe71e8f164449fabf8431752b8' 'fb789b12bb6246237b15a9244f58317abdd53e5ca4eb55880e40a498b2237155' 'db1d647d86370583c24ae7a37feab78e3f0015d441ff5bc8f9b32e1a91ec4c8e' 'd12c5a68c293f66d95ae4df704ea349adbad972fb25475ab1a0a24fb42bfc70b') prepare() { cd "${srcdir}/${pkgname}-${pkgver}" sed -i 's/www-data/http/g' extra/logrotate.in sed -e 's|#ServerId = www-data|ServerId = http|' \ -e 's|/var/www/|/srv/http/|g' \ -e 's|//|/|g' \ -e 's|#CGIextension = cgi|&\n#TriggerOnCGIstatus = no|g' \ -e 's|ConnectTo = 127.0.0.1:2005|ConnectTo = 127.0.0.1:9000|g' \ -e 's|# Extension = php|&\n# SessionTimeout = 30|g' \ -e 's|#ErrorHandler = 404:/error.cgi|&\n#UseGZfile = yes|g' \ -i config/hiawatha.conf.in sed -e 's|/etc/init.d/hiawatha restart|systemctl restart hiawatha.service|' \ -i extra/letsencrypt/letsencrypt.conf.in } build() { cd "${srcdir}/${pkgname}-${pkgver}" mkdir -p build cd build cmake ../ -DCMAKE_INSTALL_PREFIX="/" \ -DCMAKE_INSTALL_BINDIR="/usr/bin" \ -DCMAKE_INSTALL_SBINDIR="/usr/bin" \ -DCMAKE_INSTALL_SYSCONFDIR="/etc/hiawatha" \ -DCMAKE_INSTALL_LIBDIR="/usr/lib" \ -DCMAKE_INSTALL_MANDIR="/usr/share/man" \ -DCONFIG_DIR="/etc/hiawatha" \ -DLOG_DIR="/var/log/hiawatha" \ -DPID_DIR="/run" \ -DENABLE_TLS=ON \ -DUSE_SYSTEM_MBEDTLS=ON \ -DENABLE_MONITOR=ON \ -DWEBROOT_DIR="/srv/http/hiawatha" \ -DWORK_DIR="/var/lib/hiawatha" make # Features enabled by default # -DENABLE_CACHE # -DENABLE_IPV6 # -DENABLE_RPROXY # -DENABLE_TOOLKIT # -DENABLE_XSLT # Features disabled by default # -DENABLE_DEBUG # -DENABLE_TOMAHAWK } package() { cd "${srcdir}/${pkgname}-${pkgver}/build" make DESTDIR="${pkgdir}/" install rmdir "${pkgdir}/run" rm "${pkgdir}/srv/http/hiawatha/index.html" rmdir -p --ignore-fail-on-non-empty "${pkgdir}/srv/http/hiawatha" install -Dm644 -t "${pkgdir}/etc/logrotate.d" logrotate.d/hiawatha install -Dm644 -t "${pkgdir}/usr/lib/systemd/system" ${srcdir}/{hiawatha.service,lefh-renew.service,lefh-renew.timer} }