From 6e8b8060f28fade79d3413b9ebd06befc1e661df Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 21 Dec 2018 16:12:23 -0500 Subject: [PATCH] Add fcgiwrap --- sr.ht/buildall.yml | 1 + sr.ht/fcgiwrap/APKBUILD | 42 +++++++++++++++++++++++++++++ sr.ht/fcgiwrap/fcgiwrap.initd | 28 +++++++++++++++++++ sr.ht/fcgiwrap/fcgiwrap.pre-install | 7 +++++ 4 files changed, 78 insertions(+) create mode 100644 sr.ht/fcgiwrap/APKBUILD create mode 100644 sr.ht/fcgiwrap/fcgiwrap.initd create mode 100644 sr.ht/fcgiwrap/fcgiwrap.pre-install diff --git a/sr.ht/buildall.yml b/sr.ht/buildall.yml index 97eef43..9456a95 100644 --- a/sr.ht/buildall.yml +++ b/sr.ht/buildall.yml @@ -10,6 +10,7 @@ environment: repo_server: deploy@mirror.sr.ht repo_path: /var/www/mirror.sr.ht/alpine/sr.ht/x86_64 packages: + - fcgiwrap - py-alembic - py-cssselect2 - py-editor diff --git a/sr.ht/fcgiwrap/APKBUILD b/sr.ht/fcgiwrap/APKBUILD new file mode 100644 index 0000000..e87c54e --- /dev/null +++ b/sr.ht/fcgiwrap/APKBUILD @@ -0,0 +1,42 @@ +# Maintainer: Drew DeVault +pkgname=fcgiwrap +pkgver=1.1.0 +pkgrel=3 +pkgdesc="Simple server for running CGI applications over FastCGI" +url="https://github.com/gnosek/fcgiwrap" +arch="all" +license="MIT" +pkgusers="fcgiwrap" +pkggroups="www-data" +install="$pkgname.pre-install" +makedepends="$depends_dev autoconf libtool automake fcgi-dev" +subpackages="$pkgname-doc $pkgname-openrc" +source="$pkgname-$pkgver.tar.gz::https://github.com/gnosek/$pkgname/archive/$pkgver.tar.gz + $pkgname.initd" +builddir="$srcdir/$pkgname-$pkgver" + +build() { + cd "$builddir" + autoreconf --install + CFLAGS="$CFLAGS -Wno-implicit-fallthrough" \ + ./configure --prefix=/usr \ + --mandir=/share/man \ + --sbindir=/bin + make +} + +check() { + cd "$builddir" + ./fcgiwrap -h >/dev/null +} + +package() { + cd "$builddir" + mkdir -p "$pkgdir"/var/run/fcgiwrap + make DESTDIR="$pkgdir" install + install -Dm755 $srcdir/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname + chown $pkgusers.$pkggroups "$pkgdir"/var/run/fcgiwrap +} + +sha512sums="b8d35762d1d3c94a67602290b0092f0c38cffbbcd3dbc16597abf8b92172909b04450c238de2e430e841a17dd47fdd48d6a001f77539966980ef1af61e447ddc fcgiwrap-1.1.0.tar.gz +96cd7febc4da598762baf32a7864cabbd7dd9bc019107f41b588bcf5b9b9064f6efa0d0f3721ff352b92beabe2e8ae11e84615c5185bf09b7f8aa07a59031ca9 fcgiwrap.initd" diff --git a/sr.ht/fcgiwrap/fcgiwrap.initd b/sr.ht/fcgiwrap/fcgiwrap.initd new file mode 100644 index 0000000..f2deb38 --- /dev/null +++ b/sr.ht/fcgiwrap/fcgiwrap.initd @@ -0,0 +1,28 @@ +#!/sbin/openrc-run + +name="fcgiwrap" +description="fcgiwrap cgi daemon" + +command="/usr/bin/fcgiwrap" +command_args="-c 3 -s unix:/var/run/fcgiwrap/fcgiwrap.sock" +command_background="yes" +pidfile="/var/run/fcgiwrap/fcgiwrap.pid" +user="fcgiwrap" +group="www-data" + +depend() { + need net localmount + after firewall +} + +start() { + checkpath --directory --owner fcgiwrap:www-data ${pidfile%/*} + ebegin "Starting ${name}" + start-stop-daemon --exec ${command} \ + --pidfile ${pidfile} --make-pidfile \ + --background \ + -u ${user} -g ${group} \ + --start -- ${command_args} + eend $? +} + diff --git a/sr.ht/fcgiwrap/fcgiwrap.pre-install b/sr.ht/fcgiwrap/fcgiwrap.pre-install new file mode 100644 index 0000000..cdd114e --- /dev/null +++ b/sr.ht/fcgiwrap/fcgiwrap.pre-install @@ -0,0 +1,7 @@ +#!/bin/sh + +addgroup -S www-data 2>/dev/null +adduser -S -D -H -h /var/run/fcgiwrap -s /sbin/nologin -G www-data \ + fcgiwrap 2>/dev/null +exit 0 + -- 2.45.2