void-packages/srcpkgs/kcgi/template
Đoàn Trần Công Danh dd9d4a1979 srcpkgs/k*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

47 lines
1.3 KiB
Bash

# Template file for 'kcgi'
pkgname=kcgi
version=0.12.5
revision=1
build_style=configure
configure_args="PREFIX=/usr MANDIR=/usr/share/man SBINDIR=/usr/bin"
make_cmd="bmake"
make_check_target="regress"
hostmakedepends="bmake which pkg-config"
makedepends="zlib-devel"
checkdepends="libcurl-devel"
short_desc="Minimal CGI library for web applications in C"
maintainer="Duncaen <duncaen@voidlinux.org>"
license="ISC"
homepage="http://kristaps.bsd.lv/kcgi/"
changelog="https://kristaps.bsd.lv/kcgi/archive.html"
distfiles="http://kristaps.bsd.lv/kcgi/snapshots/kcgi-${version}.tgz"
checksum=06ed033de3723651d76e2fac1c2442aaa3a28ac231cbfda4142dfb8782cab363
seccomp_audit_get_suffix() {
case "$1" in
i686*) echo "X86" ;;
x86_64*) echo "X86_64" ;;
arm*) echo "ARM" ;;
aarch64*) echo "AARCH64" ;;
ppc64le*) echo "PPC64LE" ;;
ppc64*) echo "PPC64" ;;
ppc*) echo "PPC" ;;
*) echo "UNKNOWN" ;;
esac
}
post_configure() {
local suffix origsuffix
suffix="$(seccomp_audit_get_suffix ${XBPS_TARGET_MACHINE})"
origsuffix="$(seccomp_audit_get_suffix ${XBPS_MACHINE})"
if [ "$suffix" != "UNKNOWN" ]; then
sed -i "s/AUDIT_ARCH_${origsuffix}/AUDIT_ARCH_${suffix}/" config.h
else
sed -i "/AUDIT_ARCH_${origsuffix}/d" config.h
fi
}
post_install() {
sed -n '2,16p' kcgi.c > LICENSE
vlicense LICENSE
}