# Maintainer: Kurt Marasco # Contributor: Pascal Ernster pkgname=hiawatha pkgver=9.2 pkgrel=1 pkgdesc="Secure and advanced webserver" url="https://www.hiawatha-webserver.org/" arch=('i686' 'x86_64') license=('GPL') depends=('libxslt' 'polarssl') optdepends=('php-fpm: Provides modern PHP fast cgi support (Recommended) ') makedepends=('cmake') install=$pkgname.install backup=( usr/lib/systemd/system/hiawatha.service etc/hiawatha/hiawatha.conf etc/hiawatha/hiawatha.conf.sample etc/hiawatha/cgi-wrapper.conf etc/hiawatha/mimetype.conf srv/http/hiawatha/cdcatalog.xml srv/http/hiawatha/cdcatalog.xslt ) source=( "http://hiawatha-webserver.org/files/${pkgname}-${pkgver}.tar.gz" 'hiawatha.conf.sample' 'cdcatalog.xml' 'cdcatalog.xslt' 'hiawatha.service' 'hiawatha.install' ) sha256sums=( '5d9cdec51c618bb3efab747030e593d9bd49dfaf3236254c8e0cb60715716dbf' '4671d2586cbe3cd6497b16ff422c6143cdab40641ef3c9c4988c478351a8f5e7' '7757d6e5fe363b917a2823ba8b5194509ed6914e7c088d04ae72f9bd73efcb58' 'f28aa336da6f0fb124a1092039e695d233569cb32632223f786603ffb6ed5471' 'fb789b12bb6246237b15a9244f58317abdd53e5ca4eb55880e40a498b2237155' '3b60a884102a6212a4963c041dd2a5a32fb18833f758e9be5d021bbc630ed627' ) build() { cd "$srcdir/${pkgname}-${pkgver}" 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_SSL=ON \ -DUSE_SYSTEM_POLARSSL=on \ -DWEBROOT_DIR="/srv/http" \ -DWORK_DIR="/var/lib/hiawatha" make # The default capabilities are installed by this PKGBUILD # The following build options are available to customize your installation: # modify the above cmake command to customize #option description required libraries when feature enabled # cmake options # -DENABLE_CACHE=ON|off Enable internal cache support. # -DENABLE_DEBUG=on|OFF Enable debug information (for development only). # -DENABLE_IPV6=ON|off Enable IPv6 support. # -DENABLE_MONITOR=on|OFF Enable support for the Hiawatha Monitor. # -DENABLE_RPROXY=ON|off Enable reverse proxy support. # -DENABLE_SSL=ON|off Enable SSL (PolarSSL) support. # -DENABLE_TOMAHAWK=on|OFF Enable Tomahawk, Hiawatha command shell. # -DENABLE_TOOLKIT=ON|off Enable the URL Toolkit. # -DENABLE_XSLT=ON|off Enable XSLT support. libxml2, libxslt1 # -DUSE_SYSTEM_POLARSSL=on|OFF Compile Hiawatha against the system's PolarSSL library (>=1.2.0). # The following path settings are available for CMake. # -DCMAKE_INSTALL_PREFIX= The prefix for all other CMAKE_INSTALL directories. # -DCMAKE_INSTALL_BINDIR= Location of the ssi-cgi binary. # -DCMAKE_INSTALL_SBINDIR= Location of the other Hiawatha binaries. # -DCMAKE_INSTALL_SYSCONFDIR= The configuration files will be installed in /hiawatha. # -DCMAKE_INSTALL_LIBDIR= The PolarSSL shared library will be installed in /hiawatha. # -DCMAKE_INSTALL_MANDIR= Manual pages will be installed in /man1. # -DCONFIG_DIR= Location of the Hiawatha configuration files. # -DLOG_DIR= Log directory used in the default hiawatha.conf. # -DPID_DIR= Location of the Hiawatha and php-fcgi PID files. # -DWEBROOT_DIR= Webroot directory used in the default hiawatha.conf. # -DWORK_DIR= Path of directory where Hiawatha can write temporary files. } package() { cd "$srcdir/$pkgname-$pkgver" make DESTDIR="$pkgdir/" install # Fix hiawatha.conf (formerly httpd.conf) sed -e 's|#ServerId = www-data|ServerId = http|' \ -e 's|/var/www/|/srv/http/|g' \ -e 's|//|/|g' \ -e 's|#CGIextension = cgi|&\n#TriggerOnCGIstatus = yes|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 "$pkgdir/etc/hiawatha/hiawatha.conf" # Fix hiawatha logrotate file (/etc/logrotate.d/hiawatha) sed -e 's|www-data|http|g' -i "$srcdir/$pkgname-$pkgver/logrotate.d/hiawatha" mkdir "$pkgdir/etc/logrotate.d" install -m644 "$srcdir/$pkgname-$pkgver/logrotate.d/hiawatha" "$pkgdir/etc/logrotate.d/hiawatha" # Add startup scripts install -D -m755 "$srcdir/hiawatha.service" "$pkgdir/usr/lib/systemd/system/hiawatha.service" # Install sample configuration implementing a virtual server for phpmyadmin, php-fpm, and a default website on localhost install -m644 "$srcdir/hiawatha.conf.sample" "$pkgdir/etc/hiawatha/" # Install sample XSLT transformation on default website on localhost install -m644 "$srcdir/cdcatalog.xml" "$pkgdir/srv/http" install -m644 "$srcdir/cdcatalog.xslt" "$pkgdir/srv/http" }