diff options
author | Patrick Wozniak | 2017-02-26 13:52:26 +0100 |
---|---|---|
committer | Patrick Wozniak | 2017-02-26 13:53:39 +0100 |
commit | 3e013ab1f4cd3206c648ab584e6c990d3a417fd8 (patch) | |
tree | beb03dc758455ad18555ee4c66df7b1793205960 | |
download | aur-3e013ab1f4cd3206c648ab584e6c990d3a417fd8.tar.gz |
initial commit
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | PKGBUILD | 43 | ||||
-rw-r--r-- | kwakd.install | 31 | ||||
-rw-r--r-- | kwakd.service | 11 |
4 files changed, 103 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..e8e9d127b005 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = kwakd-git + pkgdesc = A web server serving blank html pages + pkgver = r12.acdf0e1 + pkgrel = 1 + url = https://github.com/fetchinson/kwakd + install = kwakd.install + arch = any + license = GPL + makedepends = git + depends = bash + conflicts = kwakd + source = git://github.com/fetchinson/kwakd.git + source = kwakd.service + sha256sums = SKIP + sha256sums = 5ae20e1ef81436ba5452447c32c46db4d343f08f5abe0aa41076425a9cee4715 + +pkgname = kwakd-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..8a85a612296b --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,43 @@ +# Contributor: Tom Vincent <http://tlvince.com/contact> +# Contributor: Jente Hidskes <hjdskes@gmail.com> +# Maintainer: Patrick Wozniak <hello@patwoz.de> + +pkgname=kwakd-git +_gitname=kwakd +pkgver=r12.acdf0e1 +pkgrel=1 +pkgdesc="A web server serving blank html pages" +url="https://github.com/fetchinson/$_gitname" +arch=('any' ) +license=("GPL") +depends=('bash') +makedepends=('git') +conflicts=('kwakd') +source=( + "git://github.com/fetchinson/${_gitname}.git" + "${_gitname}.service" +) +install="${_gitname}.install" +sha256sums=( + 'SKIP' + '5ae20e1ef81436ba5452447c32c46db4d343f08f5abe0aa41076425a9cee4715' +) + +pkgver() { + cd "$_gitname" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +build() { + cd "$_gitname" + autoreconf -i + ./configure --prefix=/usr + make +} + +package() { + cd "$_gitname" + make DESTDIR=$pkgdir install + install -Dm644 "$srcdir/$_gitname.service" "$pkgdir/usr/lib/systemd/system/$_gitname.service" +} + diff --git a/kwakd.install b/kwakd.install new file mode 100644 index 000000000000..dc67f9300e15 --- /dev/null +++ b/kwakd.install @@ -0,0 +1,31 @@ +#!/bin/sh +# kwakd.install file. +# Copyright 2012 Tom Vincent <http://tlvince.com/contact/> + +add_user() { + getent group kwakd &>/dev/null || groupadd -r kwakd >/dev/null + getent passwd kwakd &>/dev/null || \ + useradd -r -g kwakd -d / -s /bin/false -c kwakd kwakd >/dev/null +} + +# Allow kwakd to bind to port 80 without root permissions +# See: http://stackoverflow.com/a/10552029 +grant_bind() { + setcap cap_net_bind_service=ep /usr/bin/kwakd +} + +post_install() { + add_user + grant_bind +} + +post_upgrade() { + add_user + grant_bind +} + +post_remove() { + getent passwd kwakd &>/dev/null && userdel kwakd >/dev/null + getent group kwakd &>/dev/null && groupdel kwakd >/dev/null + true +} diff --git a/kwakd.service b/kwakd.service new file mode 100644 index 000000000000..b9a492b160f2 --- /dev/null +++ b/kwakd.service @@ -0,0 +1,11 @@ +[Unit] +Description=Web server serving blank html + +[Service] +Type=simple +User=kwakd +ExecStart=/usr/bin/kwakd -p 80 +Restart=on-failure + +[Install] +WantedBy=multi-user.target |