void-packages/srcpkgs/nethack/template
Đoàn Trần Công Danh 65749575ab srcpkgs/n*: 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

59 lines
1.6 KiB
Bash

# Template file for 'nethack'
pkgname=nethack
version=3.6.6
revision=2
wrksrc="NetHack-NetHack-${version}_Released"
conf_files="/etc/nethack/sysconf"
make_dirs="/var/games/nethack/save 0775 nethack nethack"
hostmakedepends="flex"
makedepends="ncurses-devel ncurses-libtinfo-devel"
depends="gzip"
short_desc="Exploring The Mazes of Menace"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="NGPL"
homepage="http://www.nethack.org/"
distfiles="https://www.nethack.org/download/${version}/nethack-${version//./}-src.tgz"
checksum=cfde0c3ab6dd7c22ae82e1e5a59ab80152304eb23fb06e3129439271e5643ed2
nocross=yes
system_accounts="$pkgname"
do_configure() {
sh sys/unix/setup.sh sys/unix/hints/linux
}
do_build() {
make all dungeon \
CC="$CC" LINK="$CC" LFLAGS="$LDFLAGS" LEX=flex \
HACKDIR="/var/games/nethack"
}
do_install() {
vmkdir usr/share/man/man6
vmkdir var/games
vmkdir etc/nethack
make install manpages \
PREFIX=$DESTDIR \
SHELLDIR=$DESTDIR/usr/bin \
MANDIR=$DESTDIR/usr/share/man/man6 \
GAMEDIR=$DESTDIR/usr/lib/nethack \
VARDIR=$DESTDIR/var/games/nethack \
INSTDIR=$DESTDIR/usr/lib/nethack \
HACKDIR=$DESTDIR/usr/lib/nethack \
GAMEPERM=0755 \
DIRPERM=0775 \
VARDIRPERM=0775 \
CHOWN=: CHGRP=: FLEX=lex
mv $DESTDIR/usr/lib/nethack/nhdat $DESTDIR/var/games/nethack
mv $DESTDIR/usr/lib/nethack/symbols $DESTDIR/var/games/nethack
mv $DESTDIR/usr/lib/nethack/sysconf $DESTDIR/etc/nethack
rm $DESTDIR/var/games/nethack/{logfile,perm,record,xlogfile}
sed -i -e 's,^HACKDIR=.*,HACKDIR=/var/games/nethack,' \
-e 's,^HACK=.*,HACK=/usr/lib/nethack/nethack,' \
$DESTDIR/usr/bin/nethack
vdoc doc/Guidebook.txt
vlicense dat/license LICENSE
}