From 76315ea38d4c0bd3737972773374a69d2c1805aa Mon Sep 17 00:00:00 2001 From: hasufell Date: Wed, 17 Feb 2016 02:03:35 +0100 Subject: [PATCH] www-servers/hiawatha: initial import of version 10.1 --- metadata/accounts/groups/hiawatha.conf | 0 metadata/accounts/users/hiawatha.conf | 4 + metadata/categories.conf | 1 + .../hiawatha/files/hiawatha-10.1-cflags.patch | 17 +++ .../www-servers/hiawatha/files/hiawatha.initd | 26 +++++ .../hiawatha/files/systemd/hiawatha.service | 9 ++ .../hiawatha/hiawatha-10.1.exheres-0 | 106 ++++++++++++++++++ 7 files changed, 163 insertions(+) create mode 100644 metadata/accounts/groups/hiawatha.conf create mode 100644 metadata/accounts/users/hiawatha.conf create mode 100644 packages/www-servers/hiawatha/files/hiawatha-10.1-cflags.patch create mode 100644 packages/www-servers/hiawatha/files/hiawatha.initd create mode 100644 packages/www-servers/hiawatha/files/systemd/hiawatha.service create mode 100644 packages/www-servers/hiawatha/hiawatha-10.1.exheres-0 diff --git a/metadata/accounts/groups/hiawatha.conf b/metadata/accounts/groups/hiawatha.conf new file mode 100644 index 0000000..e69de29 diff --git a/metadata/accounts/users/hiawatha.conf b/metadata/accounts/users/hiawatha.conf new file mode 100644 index 0000000..ace28aa --- /dev/null +++ b/metadata/accounts/users/hiawatha.conf @@ -0,0 +1,4 @@ +gecos = User for hiawatha server +home = /var/www/hiawatha +shell = /sbin/nologin +primary_group = hiawatha diff --git a/metadata/categories.conf b/metadata/categories.conf index 6f3863e..fcceaba 100644 --- a/metadata/categories.conf +++ b/metadata/categories.conf @@ -17,6 +17,7 @@ sci-physics sys-apps voip www-apps +www-servers x11-apps x11-themes x11-wm diff --git a/packages/www-servers/hiawatha/files/hiawatha-10.1-cflags.patch b/packages/www-servers/hiawatha/files/hiawatha-10.1-cflags.patch new file mode 100644 index 0000000..4ff33cd --- /dev/null +++ b/packages/www-servers/hiawatha/files/hiawatha-10.1-cflags.patch @@ -0,0 +1,17 @@ +From: Julian Ospald +Date: Fri May 23 16:59:33 UTC 2014 +Subject: make optimization level build-type dependant + +--- hiawatha-9.5/CMakeLists.txt ++++ hiawatha-9.5/CMakeLists.txt +@@ -2,7 +2,9 @@ + project(Hiawatha C) + + # Compiler +-set(CMAKE_C_FLAGS "-O2 -Wall -Wextra ${CMAKE_C_FLAGS}") ++set(CMAKE_C_FLAGS "-Wall -Wextra ${CMAKE_C_FLAGS}") ++set(CMAKE_C_FLAGS_RELEASE "-O2") ++set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2") + set(CMAKE_BUILD_TYPE "RelWithDebInfo") + + # Options diff --git a/packages/www-servers/hiawatha/files/hiawatha.initd b/packages/www-servers/hiawatha/files/hiawatha.initd new file mode 100644 index 0000000..5635aba --- /dev/null +++ b/packages/www-servers/hiawatha/files/hiawatha.initd @@ -0,0 +1,26 @@ +#!/sbin/runscript +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +depend() { + need net +} + +start() { + ebegin "Starting ${SVCNAME}" + start-stop-daemon \ + --start \ + --exec "/usr/sbin/hiawatha" \ + --pidfile "@HIAWATHA_PID_DIR@/hiawatha.pid" + eend $? +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon \ + --stop \ + --exec "/usr/sbin/hiawatha" \ + --pidfile "@HIAWATHA_PID_DIR@/hiawatha.pid" + eend $? +} diff --git a/packages/www-servers/hiawatha/files/systemd/hiawatha.service b/packages/www-servers/hiawatha/files/systemd/hiawatha.service new file mode 100644 index 0000000..35e740b --- /dev/null +++ b/packages/www-servers/hiawatha/files/systemd/hiawatha.service @@ -0,0 +1,9 @@ +[Unit] +Description=Hiawatha webserver +After=network.target + +[Service] +ExecStart=/usr/sbin/hiawatha -d + +[Install] +WantedBy=multi-user.target diff --git a/packages/www-servers/hiawatha/hiawatha-10.1.exheres-0 b/packages/www-servers/hiawatha/hiawatha-10.1.exheres-0 new file mode 100644 index 0000000..39bf665 --- /dev/null +++ b/packages/www-servers/hiawatha/hiawatha-10.1.exheres-0 @@ -0,0 +1,106 @@ +# Copyright 2016 Julian Ospald +# Distributed under the terms of the GNU General Public License v2 + +require cmake systemd-service + +SUMMARY="Advanced and secure webserver" +HOMEPAGE="http://www.hiawatha-webserver.org" +DOWNLOADS="http://www.hiawatha-webserver.org/files/${PNV}.tar.gz" + +LICENCES="GPL-2" +SLOT="0" +PLATFORMS="~amd64 ~x86" +MYOPTIONS=" + cache [[ description = [ Enable caching of content ] ]] + ipv6 + monitor [[ description = [ Enabling monitoring support ] ]] + rewrite [[ description = [ Enable the rewrite toolkit ] ]] + rproxy [[ description = [ Enable reverse proxy support ] ]] + ssl [[ description = [ Enable TLS support via mbedtls ] ]] + tomahawk [[ description = [ Enable Tomahawk control server ] ]] + xslt [[ description = [ Enable XSLT support. + This is also needed for directory listings ] ]] +" + +DEPENDENCIES=" + build+run: + sys-libs/zlib + ssl? ( dev-libs/mbedtls[threads] ) + xslt? ( + dev-libs/libxslt + dev-libs/libxml2:2.0 + ) + run: + group/hiawatha + user/hiawatha + monitor? ( www-apps/hiawatha-monitor ) +" + +HIAWATHA_CONFIG_DIR="/etc/hiawatha" +HIAWATHA_LOG_DIR="/var/log/hiawatha" +HIAWATHA_PID_DIR="/run" +HIAWATHA_WEBROOT_DIR="/var/www/hiawatha" +HIAWATHA_WORK_DIR="/var/lib/hiawatha" +HIAWATHA_USER="hiawatha" +HIAWATHA_GROUP="hiawatha" + +DEFAULT_SRC_PREPARE_PATCHES=( "${FILES}"/${PNV}-cflags.patch ) + +CMAKE_SRC_CONFIGURE_PARAMS=( + -DCONFIG_DIR:STRING="${HIAWATHA_CONFIG_DIR}" + -DLOG_DIR:STRING="${HIAWATHA_LOG_DIR}" + -DPID_DIR:STRING="${HIAWATHA_PID_DIR}" + -DWEBROOT_DIR:STRING="${HIAWATHA_WEBROOT_DIR}" + -DWORK_DIR:STRING="${HIAWATHA_WORK_DIR}" + -DENABLE_LOADCHECK=YES + -DCMAKE_INSTALL_SBINDIR="/usr/$(exhost --target)/bin" +) + +CMAKE_SRC_CONFIGURE_TESTS=( + 'cache ENABLE_CACHE' + 'ipv6 ENABLE_IPV6' + 'monitor ENABLE_MONITOR' + 'rprocy ENABLE_RPROXY' + 'ssl ENABLE_TLS' + 'tomahawk ENABLE_TOMAHAWK' + 'rewrite ENABLE_TOOLKIT' + 'xslt ENABLE_XSLT' + 'ssl USE_SYSTEM_MBEDTLS' +) + +src_prepare() { + default + + edo grep -E "^#ServerId =.*$" "config/hiawatha.conf.in" 1>/dev/null + edo sed -r -i -e "s|^#ServerId =.*$|ServerId = hiawatha|" \ + config/hiawatha.conf.in + + edo grep -E "@HIAWATHA_PID_DIR@" "${FILES}/hiawatha.initd" 1>/dev/null + edo sed -r -e "s|@HIAWATHA_PID_DIR@|${HIAWATHA_PID_DIR}|" \ + "${FILES}/hiawatha.initd" > "${TEMP}/hiawatha.initd" +} + +src_install() { + cmake_src_install + + edo rm -r "${IMAGE%/}${HIAWATHA_WEBROOT_DIR}"/* + + insinto /etc/init.d + newins "${TEMP}"/hiawatha.initd hiawatha + install_systemd_files + + local i + for i in "${HIAWATHA_LOG_DIR}" "${HIAWATHA_WORK_DIR}" ; do + keepdir "${i}" + edo chown ${HIAWATHA_USER}:${HIAWATHA_GROUP} "${IMAGE%/}${i}" + edo chmod 0750 "${IMAGE%/}${i}" + done + + # hiawatha creates empty /run dir + edo rm -r "${IMAGE%/}/run" + + keepdir "${HIAWATHA_WEBROOT_DIR}" + edo chown ${HIAWATHA_USER}:${HIAWATHA_GROUP} \ + "${IMAGE%/}${HIAWATHA_WEBROOT_DIR}" +} +