diff options
author | felics@felics-tablet | 2016-02-01 14:17:17 +0100 |
---|---|---|
committer | felics@felics-tablet | 2016-02-01 14:17:17 +0100 |
commit | 67a95a7eb3e4cd65f2ec61fcd0b0f6ad9b57a602 (patch) | |
tree | 031f09bfddb744c1b6a1c3d3159f9f49c37d1870 | |
download | aur-67a95a7eb3e4cd65f2ec61fcd0b0f6ad9b57a602.tar.gz |
Initial commit.
-rw-r--r-- | .SRCINFO | 44 | ||||
-rw-r--r-- | PKGBUILD | 144 | ||||
-rw-r--r-- | conf_d_wwwoffle | 10 | ||||
-rw-r--r-- | initscript_openrc | 29 | ||||
-rw-r--r-- | initscript_systemd | 13 | ||||
-rw-r--r-- | initscript_sysvinit | 48 | ||||
-rw-r--r-- | wwwoffle.install | 40 |
7 files changed, 328 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..7a3e5630b3ce --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,44 @@ +# Generated by mksrcinfo v8 +# Mon Feb 1 13:16:22 UTC 2016 +pkgbase = wwwoffle-svn + pkgdesc = Simple caching proxy server with special features (request, recursive fetch, ...) for use with dial-up internet links. Includes startup scripts for OpenRC, System V init, systemd. + pkgver = 2.9j.r2202 + pkgrel = 1 + url = http://www.gedanken.org.uk/software/wwwoffle/ + install = wwwoffle.install + arch = i686 + arch = x86_64 + arch = arm + arch = arm64 + license = GPL + depends = zlib + depends = gnutls + depends = libgcrypt + provides = wwwoffle=2.9j.r2202 + provides = wwwoffle-sysvinit=2.9j.r2202 + provides = wwwoffle-openrc=2.9j.r2202 + provides = wwwoffle-systemd=2.9j.r2202 + conflicts = wwwoffle + conflicts = wwwoffle-sysvinit + conflicts = wwwoffle-openrc + conflicts = wwwoffle-systemd + replaces = wwwoffle<=2.9j.r2202 + replaces = wwwoffle-sysvinit<=2.9j.r2202 + replaces = wwwoffle-openrc<=2.9j.r2202 + replaces = wwwoffle-systemd<=2.9j.r2202 + backup = etc/wwwoffle/wwwoffle.conf + source = wwwoffle::svn+http://gedanken.org.uk/svn/wwwoffle/trunk + source = conf_d_wwwoffle + source = initscript_openrc + source = initscript_systemd + source = initscript_sysvinit + source = wwwoffle.install + sha256sums = SKIP + sha256sums = cd05738f73b109dd074f6dd919300eeae55c2aa812a15e0ae61b32622423c867 + sha256sums = 0d5bfcd1e348f6bdad042f780b2ea8a235314d5750a66ae008a0ea391bc5cc11 + sha256sums = 04fd88f2a100e3ff9a96da6a70e58457252722cbf6350ffdbf08f17e62b64869 + sha256sums = 47f3df8ed05888452c00f8246f97456a4c55499b67e59c40da272b0e7fb1f2df + sha256sums = 87eb11ad6e43eb9ac866806e413b187196d2d3b9383de76139d4e4ff71ffe855 + +pkgname = wwwoffle-svn + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..22c4419c8259 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,144 @@ +# Maintainer: dreieck +# Contributor: Vasco Costa <vasco dot costa at geekslot dot com> +# Contributor: jaro3 + +_pkgname=wwwoffle +pkgname="${_pkgname}-svn" +# _pkgver=2.9i +pkgver=2.9j.r2202 +pkgrel=1 +pkgdesc="Simple caching proxy server with special features (request, recursive fetch, ...) for use with dial-up internet links. Includes startup scripts for OpenRC, System V init, systemd." +arch=('i686' 'x86_64' 'arm' 'arm64') +url="http://www.gedanken.org.uk/software/wwwoffle/" +license=('GPL') +depends=('zlib' 'gnutls' 'libgcrypt') + +provides=( + "${_pkgname}=${pkgver}" + "${_pkgname}-sysvinit=${pkgver}" + "${_pkgname}-openrc=${pkgver}" + "${_pkgname}-systemd=${pkgver}" +) +replaces=( + "${_pkgname}<=${pkgver}" + "${_pkgname}-sysvinit<=${pkgver}" + "${_pkgname}-openrc<=${pkgver}" + "${_pkgname}-systemd<=${pkgver}" +) +conflicts=( + "${_pkgname}" + "${_pkgname}-sysvinit" + "${_pkgname}-openrc" + "${_pkgname}-systemd" +) + +backup=('etc/wwwoffle/wwwoffle.conf') +install="${_pkgname}.install" + +_svnurl="http://gedanken.org.uk/svn/wwwoffle/trunk" + +source=( + # "http://www.gedanken.org.uk/software/wwwoffle/download/${_pkgname}-${_pkgver}.tgz" + "${_pkgname}::svn+${_svnurl}" + 'conf_d_wwwoffle' + 'initscript_openrc' + 'initscript_systemd' + 'initscript_sysvinit' + "${install}" +) + +sha256sums=( + # 'e6341a4ec2631dc22fd5209c7e5ffe628a5832ad191d444c56aebc3837eed2ae' + 'SKIP' + 'cd05738f73b109dd074f6dd919300eeae55c2aa812a15e0ae61b32622423c867' + '0d5bfcd1e348f6bdad042f780b2ea8a235314d5750a66ae008a0ea391bc5cc11' + '04fd88f2a100e3ff9a96da6a70e58457252722cbf6350ffdbf08f17e62b64869' + '47f3df8ed05888452c00f8246f97456a4c55499b67e59c40da272b0e7fb1f2df' + '87eb11ad6e43eb9ac866806e413b187196d2d3b9383de76139d4e4ff71ffe855' +) + +pkgver() { + # Format: RELEASE.rREVISION, e.g. 2.9j.r2202 + + _unpackeddir="${srcdir}/${_pkgname}" + + _rev="$(svn info "${_svnurl}" | grep '^Revision' | cut -d' ' -f2)" + + if [ -z "${_rev}" ]; then + echo "$0: Error: Could not determine SVN revision." > /dev/stderr + echo "Aborting." > /dev/stderr + false + exit 1 + fi + + # Well, this _is_ useless use of cat, but to make it more clear to see in which order things are going on I do the cat first and then the grep. + _ver="$(cat "${_unpackeddir}/conf/wwwoffle.conf.template" | \ + grep -E '^#.*WWWOFFLE.*[Vv]ersion' | \ + head -n 1 | \ + sed 's|.* \([^ ]*\)$|\1|g' | \ + sed 's|\.$||g')" + + if [ -z "${_ver}" ]; then + echo "$0: Error: Could not determine version." > /dev/stderr + echo "Aborting." > /dev/stderr + false + exit 1 + fi + + echo "${_ver}.r${_rev}" +} + +build() { + _unpackeddir="${srcdir}/${_pkgname}" + cd "${_unpackeddir}" + + # libtoolize --force + # aclocal + # autoheader + autoconf -o configure -v configure.in + + ./configure \ + --prefix=/usr \ + --bindir=/usr/bin \ + --sbindir=/usr/bin \ + --exec-prefix=/usr \ + --with-zlib=/usr/include \ + --with-gnutls=/usr/include/gnutls \ + --with-gcrypt=/usr/include \ + --with-ipv6 \ + --with-spooldir=/var/spool/wwwoffle \ + --with-confdir=/etc/wwwoffle \ + --with-default-language=en + + make || return 1 +} + +package() { + _unpackeddir="${srcdir}/${_pkgname}" + cd "${_unpackeddir}" + + # Install the software. + make DESTDIR="${pkgdir}" install + + # Move documentation into the place we want it. + mkdir -p "${pkgdir}/usr/share" + mv -v "${pkgdir}/usr/doc" "${pkgdir}/usr/share/doc" + + # Symlink the HTML-Documentation under wwwoffle's spool directory to the documentation directory. Note: The html documentation needs to stay at wwwoffle's spool directory, since it serves it from there when it's webinterface is accessed. + mkdir -p "${pkgdir}/usr/share/doc/wwwoffle/html" + ln -sv "/var/spool/wwwoffle/html"/{de,en,es,fr,it,nl,pl,ru} "${pkgdir}/usr/share/doc/wwwoffle/html/" + + # Install startup scripts for different init systems. + install -D -m755 "${srcdir}/initscript_sysvinit" "${pkgdir}/etc/rc.d/wwwoffle" + install -D -m755 "${srcdir}/initscript_openrc" "${pkgdir}/etc/init.d/wwwoffle" + install -D -m644 "${srcdir}/initscript_systemd" "${pkgdir}/usr/lib/systemd/system/wwwoffle.service" + + # Install a default configuration file. + install -D -m644 "${srcdir}/conf_d_wwwoffle" "${pkgdir}/etc/conf.d/wwwoffle" + + # Change config such that wwwoffle runs as user wwwoffle and group wwwoffle. (Adding user and group is handled by the ${install}-script.) + sed -i -e 's/^#run-uid.*/ run-uid = wwwoffle/' \ + "${pkgdir}/etc/wwwoffle/wwwoffle.conf" + sed -i -e 's/^#run-gid.*/ run-gid = wwwoffle/' \ + "${pkgdir}/etc/wwwoffle/wwwoffle.conf" +} diff --git a/conf_d_wwwoffle b/conf_d_wwwoffle new file mode 100644 index 000000000000..7b0eafe106e4 --- /dev/null +++ b/conf_d_wwwoffle @@ -0,0 +1,10 @@ +# +# Parameters to be passed to wwwoffle. +# +# NOTE: +# This file is parsed when using System V initscript or openrc-initscript, +# but it is ignored when using systemd to start up wwwoffle. +# When using systemd, edit the wwwoffle service definition directly to change startup options. +# + +WWWOFFLE_ARGS="-c /etc/wwwoffle/wwwoffle.conf" diff --git a/initscript_openrc b/initscript_openrc new file mode 100644 index 000000000000..b40d3ffb67e6 --- /dev/null +++ b/initscript_openrc @@ -0,0 +1,29 @@ +#!/usr/bin/openrc-run +# OpenRC wwwoffle script + +## The WWWOFFLE_ARGS environment variable should be set within /etc/conf.d/wwwoffle! + +_DAEMON="/usr/sbin/wwwoffled" +_DAEMON_ARGS=( + ${WWWOFFLE_ARGS} + ) + +depend() { + use logger dns +} + +start() { + ebegin "Starting $(basename "${_DAEMON}"): Executing ${_DAEMON} ${_DAEMON_ARGS[@]}" + + start-stop-daemon --start --quiet --exec "${_DAEMON}" -- "${_DAEMON_ARGS[@]}" + + eend "$?" +} + +stop() { + ebegin "Stopping $(basename "${_DAEMON}")" + + start-stop-daemon --stop --quiet --exec "${_DAEMON}" + + eend "$?" +} diff --git a/initscript_systemd b/initscript_systemd new file mode 100644 index 000000000000..75ad23d83847 --- /dev/null +++ b/initscript_systemd @@ -0,0 +1,13 @@ +# wwwoffle init script for systemd. +# Taken from https://build.opensuse.org/package/show/server:proxy/wwwoffle +# Thanks to "jaro3" for pointing this out. +[Unit] +Description=The wwwoffle proxy server +After=network.target + +[Service] +ExecStart=/usr/sbin/wwwoffled -d -c /etc/wwwoffle/wwwoffle.conf +ExecReload=/usr/bin/wwwoffle -config -c /etc/wwwoffle/wwwoffle.conf + +[Install] +WantedBy=multi-user.target diff --git a/initscript_sysvinit b/initscript_sysvinit new file mode 100644 index 000000000000..5c2f7d9838bb --- /dev/null +++ b/initscript_sysvinit @@ -0,0 +1,48 @@ +#!/bin/bash + +# source application-specific settings + +# WWWOFFLE_ARGS will be by sourcing '/etc/conf.d/wwwoffle'. +WWWOFFLE_ARGS= +[ -f /etc/conf.d/wwwoffle ] && . /etc/conf.d/wwwoffle + +_pretty_name="wwwoffle" +_DAEMON="/usr/sbin/wwwoffled" +_DAEMON_ARGS=( + ${WWWOFFLE_ARGS} + ) + +. /etc/rc.conf +. /etc/rc.d/functions + +PID=`pidof -o %PPID "${_DAEMON}"` +case "$1" in + start) + stat_busy "Starting ${_pretty_name}" + [ -z "$PID" ] && "${_DAEMON}" "${_DAEMON_ARGS[@]}" + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon wwwoffle + stat_done + fi + ;; + stop) + stat_busy "Stopping ${_pretty_name}" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon wwwoffle + stat_done + fi + ;; + restart) + $0 stop + sleep 5 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 diff --git a/wwwoffle.install b/wwwoffle.install new file mode 100644 index 000000000000..80626e6d5310 --- /dev/null +++ b/wwwoffle.install @@ -0,0 +1,40 @@ +post_install() { + post_upgrade +} + +post_upgrade() { + echo "ATTENTION WWWOFFLE:" + echo "-------------------" + echo "init-scripts were installed for:" + echo " * sysvinit ('/etc/rc.d/wwwoffle')," + echo " * openrc ('/etc/init.d/wwwoffle') and" + echo " * systemd ('/usr/lib/systemd/system/wwwoffle.service')." + echo "Which one will be used depends on your init system you use." + echo "" + echo "In order to define the options passed to wwwoffle during startup" + echo "(including which configuration file to use), edit" + echo " * the file '/etc/conf.d/wwwoffle' when using sysvinit or openrc," + echo " * the file '/usr/lib/systemd/system/wwwoffle.service' when using" + echo " systemd." + echo "-------------------" + echo "Set bind-ipv4 = none in wwwoffle.conf if you get ipv4 related warnings." + echo "-------------------" + if [ ! `grep wwwoffle /etc/group` ]; then + echo ">>> Adding group wwwoffle." + groupadd wwwoffle &> /dev/null; + fi + id wwwoffle &> /dev/null || \ + (echo ">>> Adding user wwwoffle." && useradd -g wwwoffle wwwoffle) + chown -R wwwoffle:wwwoffle /var/spool/wwwoffle /etc/wwwoffle +} + +pre_remove() { + echo ">>> Removing user wwwoffle." + userdel wwwoffle &> /dev/null + echo ">>> Removing group wwwoffle." + groupdel wwwoffle &> /dev/null +} + +op=$1 +shift +$op $* |