From 7a65a910b77ad191d69881098c47f9b0c852d92e Mon Sep 17 00:00:00 2001 From: root Date: Tue, 13 Aug 2013 01:33:19 -0700 Subject: Tue Aug 13 01:31:08 PDT 2013 --- community/yaws/PKGBUILD | 51 +++++++++++++++++++++++++++++++++++++++++++++ community/yaws/yaws.install | 13 ++++++++++++ community/yaws/yaws.service | 13 ++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 community/yaws/PKGBUILD create mode 100644 community/yaws/yaws.install create mode 100644 community/yaws/yaws.service (limited to 'community/yaws') diff --git a/community/yaws/PKGBUILD b/community/yaws/PKGBUILD new file mode 100644 index 000000000..2b525469c --- /dev/null +++ b/community/yaws/PKGBUILD @@ -0,0 +1,51 @@ +# $Id: PKGBUILD 94952 2013-08-01 13:32:19Z arodseth $ +# Maintainer: Alexander Rødseth +# Maintainer: Vesa Kaihlavirta +# Contributor: Patrick Smits + +pkgname=yaws +pkgver=1.96 +pkgrel=2 +pkgdesc='Yet Another Web Server, pure Erlang HTTP server/framework' +arch=('x86_64' 'i686') +url='http://yaws.hyber.org/' +license=('BSD') +depends=('pam' 'erlang') # segfaults with erlang-nox +backup=('etc/yaws/yaws.conf') +options=('!emptydirs') +install=$pkgname.install +source=("http://yaws.hyber.org/download/$pkgname-$pkgver.tar.gz" + "$pkgname.service") +sha256sums=('8d4f16d18937335ac021ca4c65c8ee81dc4d71f133718c7148856cc6bf1f55e2' + '3f8347add6e3741e77f7bb9ba6b31feb1c878e2e58ecf19063891e801fa24698') + +prepare() { + cd "$pkgname-$pkgver" + + # python2 fix + for file in cgi.yaws cgi-bin/foo.py; do + sed -i '0,/on/s//on2/' "www/$file" + done + # R16B1 fix + sed -i 's/:sha(Salted)/:hash(sha, Salted)/' src/yaws_websockets.erl +} + +build() { + cd "$pkgname-$pkgver" + + ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var + make +} + +package() { + cd "$pkgname-$pkgver" + + make DESTDIR="$pkgdir" install + install -d "$pkgdir/usr/lib/erlang/lib" + ln -s /usr/lib/yaws "$pkgdir/usr/lib/erlang/lib/$pkgname-$pkgver" + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + install -Dm644 "$srcdir/$pkgname.service" \ + "$pkgdir/usr/lib/systemd/system/$pkgname.service" +} + +# vim:set ts=2 sw=2 et: diff --git a/community/yaws/yaws.install b/community/yaws/yaws.install new file mode 100644 index 000000000..2b28403e1 --- /dev/null +++ b/community/yaws/yaws.install @@ -0,0 +1,13 @@ +post_upgrade() { + mkdir -p /usr/var/log/yaws +} + +post_install() { + post_upgrade +} + +post_remove() { + rmdir --ignore-fail-on-non-empty /usr/var/log/yaws +} + +# vim:set ts=2 sw=2 et: diff --git a/community/yaws/yaws.service b/community/yaws/yaws.service new file mode 100644 index 000000000..7e2ced32d --- /dev/null +++ b/community/yaws/yaws.service @@ -0,0 +1,13 @@ +[Unit] +Description=A fast lightweight webserver. +After=syslog.target network.target + +[Service] +Type=forking +GuessMainPID=no +ExecStart=/usr/bin/yaws --daemon --heart +ExecReload=/usr/bin/yaws --hup +ExecStop=/usr/bin/yaws --stop + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3-54-g00ecf