Patches for aports can be sent to this list

1

[alpine-aports] [PATCH] testing/nethack: new APKBUILD

Details
Message ID
<20190306232956.10910-1-sir@cmpwn.com>
Sender timestamp
1551914996
DKIM signature
missing
Download raw message
Patch: +74 -0
---
 testing/nethack/APKBUILD | 74 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)
 create mode 100644 testing/nethack/APKBUILD

diff --git a/testing/nethack/APKBUILD b/testing/nethack/APKBUILD
new file mode 100644
index 0000000000..6ed122f557
--- /dev/null
+++ b/testing/nethack/APKBUILD
@@ -0,0 +1,74 @@
+# Maintainer: Drew DeVault <sir@cmpwn.com>
+# Based on the Arch Linux package
+pkgname=nethack
+pkgver=3.6.1
+pkgrel=0
+pkgdesc="A single player dungeon exploration game"
+url="https://www.nethack.org/index.html"
+arch="all"
+license="NGPL"
+makedepends="ncurses-dev"
+subpackages="$pkgname-doc"
+source="http://downloads.sourceforge.net/$pkgname/$pkgname-${pkgver//.}-src.tgz"
+builddir="$srcdir/$pkgname-$pkgver"
+options="suid"
+
+prepare() {
+	cd "$builddir"
+	# Fix nonstandard cp usage
+	sed -e 's/cp -n/cp/g' -i sys/unix/hints/linux
+	# Configuration stuff
+	sed -e 's|^/\* \(#define LINUX\) \*/|\1|' \
+		-e 's|^/\* \(#define TIMED_DELAY\) \*/|\1|' \
+		-i include/unixconf.h
+	# we are setting up for setgid games, so modify all necessary permissions
+	# to allow full access for groups
+	sed -e '/^HACKDIR/ s|/games/lib/\$(GAME)dir|/var/games/nethack/|' \
+		-e '/^SHELLDIR/ s|/games|/usr/bin|' \
+		-e '/^VARDIRPERM/ s|0755|0775|' \
+		-e '/^VARFILEPERM/ s|0600|0664|' \
+		-e '/^GAMEPERM/ s|0755|02755|' \
+		-e 's|\(DSYSCF_FILE=\)\\"[^"]*\\"|\1\\"/var/games/nethack/sysconf\\"|' \
+		-e 's|\(DHACKDIR=\)\\"[^"]*\\"|\1\\"/var/games/nethack/\\"|' \
+		-i sys/unix/hints/linux
+	sed -e 's|^#GAMEUID.*|GAMEUID = root|' \
+		-e 's|^#GAMEGRP.*|GAMEGRP = games|' \
+		-e '/^FILEPERM\s*=/ s|0644|0664|' \
+		-e '/^DIRPERM\s*=/ s|0755|0775|' \
+		-i sys/unix/Makefile.top
+	sed -e "/^MANDIR\s*=/s|/usr/man/man6|$pkgdir/usr/share/man/man6|" \
+		-i sys/unix/Makefile.doc
+}
+
+build() {
+	cd "$builddir"/sys/unix
+	sh setup.sh hints/linux
+	cd "$builddir"
+	make
+}
+
+check() {
+	cd "$builddir"
+	NETHACKDIR=/tmp ./src/nethack --version
+}
+
+package() {
+	cd "$builddir"
+	install -dm755 $pkgdir/usr/share/man/man6
+	install -dm755 $pkgdir/usr/share/doc/nethack
+	install -dm775 $pkgdir/var/games/
+	make PREFIX=$pkgdir -j1 install manpages # Multi-threaded builds fail.
+	sed -e "s|HACKDIR=$pkgdir/|HACKDIR=/|" \
+		-e 's|HACK=$HACKDIR|HACK=/usr/lib/nethack|' \
+		-i $pkgdir/usr/bin/nethack
+
+	install -dm755 $pkgdir/usr/lib/nethack
+	mv $pkgdir/var/games/nethack/nethack $pkgdir/usr/lib/nethack/
+	mv $pkgdir/var/games/nethack/recover $pkgdir/usr/lib/nethack/
+
+	chown -R root:games $pkgdir/var/games/
+	chown root:games $pkgdir/usr/lib/nethack/nethack
+
+	install -Dm644 doc/Guidebook.txt $pkgdir/usr/share/doc/nethack/Guidebook.txt
+}
+sha512sums="bd6e36c163f0d85e1ab1fc659464696b5a02c3864a800ad47e047fdc4a35fff4ef7dd28a9b071fa46f7f67fa45c97fdc77bc1f2bdbad80cc02950d73731d9c30  nethack-361-src.tgz"
-- 
2.21.0



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Leonardo
Details
Message ID
<e4371179-bc55-3e36-fc4f-0e4f5e74e5ce@gmail.com>
In-Reply-To
<20190306232956.10910-1-sir@cmpwn.com> (view parent)
Sender timestamp
1554300004
DKIM signature
missing
Download raw message
Hi,

On 3/7/19 12:29 AM, Drew DeVault wrote:
> ---
>   testing/nethack/APKBUILD | 74 ++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 74 insertions(+)
>   create mode 100644 testing/nethack/APKBUILD
>
> diff --git a/testing/nethack/APKBUILD b/testing/nethack/APKBUILD
> new file mode 100644
> index 0000000000..6ed122f557
> --- /dev/null
> +++ b/testing/nethack/APKBUILD
> @@ -0,0 +1,74 @@
> +# Maintainer: Drew DeVault <sir@cmpwn.com>
> +# Based on the Arch Linux package
> +pkgname=nethack
> +pkgver=3.6.1
> +pkgrel=0
> +pkgdesc="A single player dungeon exploration game"
> +url="https://www.nethack.org/index.html"
> +arch="all"
> +license="NGPL"
> +makedepends="ncurses-dev"

it's missing linux-headers (vt.h) and flex/bison (yacc).

> +subpackages="$pkgname-doc"
> +source="http://downloads.sourceforge.net/$pkgname/$pkgname-${pkgver//.}-src.tgz"
> +builddir="$srcdir/$pkgname-$pkgver"
> +options="suid"
> +
> +prepare() {
> +	cd "$builddir"
> +	# Fix nonstandard cp usage
> +	sed -e 's/cp -n/cp/g' -i sys/unix/hints/linux
> +	# Configuration stuff
> +	sed -e 's|^/\* \(#define LINUX\) \*/|\1|' \
> +		-e 's|^/\* \(#define TIMED_DELAY\) \*/|\1|' \
> +		-i include/unixconf.h
> +	# we are setting up for setgid games, so modify all necessary permissions
> +	# to allow full access for groups
> +	sed -e '/^HACKDIR/ s|/games/lib/\$(GAME)dir|/var/games/nethack/|' \
> +		-e '/^SHELLDIR/ s|/games|/usr/bin|' \
> +		-e '/^VARDIRPERM/ s|0755|0775|' \
> +		-e '/^VARFILEPERM/ s|0600|0664|' \
> +		-e '/^GAMEPERM/ s|0755|02755|' \
> +		-e 's|\(DSYSCF_FILE=\)\\"[^"]*\\"|\1\\"/var/games/nethack/sysconf\\"|' \
> +		-e 's|\(DHACKDIR=\)\\"[^"]*\\"|\1\\"/var/games/nethack/\\"|' \
> +		-i sys/unix/hints/linux
> +	sed -e 's|^#GAMEUID.*|GAMEUID = root|' \
> +		-e 's|^#GAMEGRP.*|GAMEGRP = games|' \
> +		-e '/^FILEPERM\s*=/ s|0644|0664|' \
> +		-e '/^DIRPERM\s*=/ s|0755|0775|' \
> +		-i sys/unix/Makefile.top
> +	sed -e "/^MANDIR\s*=/s|/usr/man/man6|$pkgdir/usr/share/man/man6|" \
> +		-i sys/unix/Makefile.doc
> +}
> +

i'm not a fan of all this sed stuff. It would be better a patch, but 
since it goes into testing I can close an eye ;-).

Merged.

Thanks!

/eo



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---