void-packages/srcpkgs/pwnat/template
Đoàn Trần Công Danh 49cb564d14 srcpkgs/p*: convert patches to -Np1
* par is kept at -Np0

```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

23 lines
623 B
Bash

# Template file for 'pwnat'
pkgname=pwnat
version=0.3
revision=2
# the git-hash of v0.3 as it isn't tagged
_githash=572fcfb76a1b4b46faaa6b36817a39671b6f3c7e
wrksrc="${pkgname}-${_githash}"
build_style=gnu-makefile
short_desc="Serverless NAT to NAT hole punching"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-3.0-or-later"
homepage="http://samy.pl/pwnat/"
distfiles="https://github.com/samyk/pwnat/archive/${_githash}.tar.gz"
checksum=365da981ba1a39d7e3c8427fbcd9e7fcd3dd16cd30ae7e3b0aca50511fd8e1b1
do_configure() {
sed -i 's#sys/unistd.h#unistd.h#' $(find -name '*.[ch]')
}
do_install() {
vbin pwnat
}