#!/bin/mkpkg # description: Simple FastCGI wrapper for CGI scripts # url: https://github.com/gnosek/fcgiwrap name=fcgiwrap version=1.1.0 release=2 depends=(fcgi2) makedeps=(autoconf automake libtool m4) groups=(fcgiwrap:user:fcgiwrap:/var/lib/fcgiwrap:750) services=(fcgiwrap) permissions=( /var/lib/fcgiwrap:fcgiwrap:fcgiwrap:750 ) source=(https://github.com/gnosek/fcgiwrap/archive/refs/tags/$version.tar.gz) sha256sums=( "4c7de0db2634c38297d5fcef61ab4a3e21856dd7247d49c33d9b19542bd1c61f" ) build() { cd $name-$version autoreconf -i ./configure \ --prefix=/usr \ --mandir=/share/man make make DESTDIR=$PKG install # rawnix uses unified /usr/bin # install -d $PKG/usr/bin # mv $PKG/usr/sbin/fcgiwrap $PKG/usr/bin/ # rmdir $PKG/usr/sbin } post_build() { install -d $PKG/etc/sv/fcgiwrap/log # Listen on a unix socket; nginx (running as http) needs to reach it. # We start fcgiwrap as fcgiwrap user, then chmod the socket so http can connect. printf '%s\n' \ '#!/bin/sh' \ 'exec 2>&1' \ '' \ 'grp=fcgiwrap' \ 'getent group http >/dev/null && grp=http' \ '' \ 'install -d -m 750 -o fcgiwrap -g "$grp" /run/fcgiwrap' \ 'rm -f /run/fcgiwrap/sock' \ '' \ 'umask 0111' \ 'exec chpst -u fcgiwrap:fcgiwrap fcgiwrap -c 4 -s unix:/run/fcgiwrap/sock' \ > $PKG/etc/sv/fcgiwrap/run printf '%s\n' \ '#!/bin/sh' \ 'mkdir -p /var/log/fcgiwrap' \ 'exec svlogd -tt /var/log/fcgiwrap' \ > $PKG/etc/sv/fcgiwrap/log/run printf '%s\n' \ '#!/bin/sh' \ 'rm -f /run/fcgiwrap/sock' \ > $PKG/etc/sv/fcgiwrap/finish chmod 755 $PKG/etc/sv/fcgiwrap/run chmod 755 $PKG/etc/sv/fcgiwrap/log/run chmod 755 $PKG/etc/sv/fcgiwrap/finish } signify() { untrusted comment: public key RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3 } # vim: filetype=sh