void-packages/srcpkgs/loksh/template
Đoàn Trần Công Danh 861ac185a6 srcpkgs/l*: 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

32 lines
907 B
Bash

# Template file for 'loksh'
pkgname=loksh
version=6.9
revision=1
build_style=meson
hostmakedepends="pkg-config"
makedepends="ncurses-devel"
short_desc="Linux port of OpenBSD's ksh"
maintainer="Renato Aguiar <renato@renatoaguiar.net>"
license="custom:Public Domain"
homepage="https://github.com/dimkr/loksh"
distfiles="https://github.com/dimkr/loksh/releases/download/${version}/loksh-${version}.tar.xz"
checksum=1633048cd5f1270c5fa28ab49d9cb9f7e8305ab6880601b0c15b88ecb92450f9
register_shell="/bin/loksh"
alternatives="
ksh:ksh:/usr/bin/loksh
ksh:ksh.1:/usr/share/man/man1/loksh.1
sh:sh:/usr/bin/loksh
sh:sh.1:/usr/share/man/man1/loksh-sh.1
"
post_install() {
vlicense LEGAL
mv ${DESTDIR}/usr/bin/ksh ${DESTDIR}/usr/bin/loksh
mv ${DESTDIR}/usr/share/man/man1/ksh.1 \
${DESTDIR}/usr/share/man/man1/loksh.1
mv ${DESTDIR}/usr/share/man/man1/sh.1 \
${DESTDIR}/usr/share/man/man1/loksh-sh.1
}