summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorElias Riedel Gårding2019-04-06 16:08:00 +0200
committerElias Riedel Gårding2019-04-06 16:16:17 +0200
commit783e2bdd7c03104262e1d8e4e54ae3885c0d45d1 (patch)
tree17cf0726af48e752ee2e6625410f0c5ffb671658
downloadaur-783e2bdd7c03104262e1d8e4e54ae3885c0d45d1.tar.gz
First version
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD71
-rw-r--r--nbsdgames-git.install13
3 files changed, 102 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..dbc1efbcf546
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+pkgbase = nbsdgames-git
+ pkgdesc = A collection of curses-based console games
+ pkgver = r35.06237f9_score_patch
+ pkgrel = 1
+ url = https://github.com/untakenstupidnick/nbsdgames
+ install = nbsdgames-git.install
+ arch = x86_64
+ license = custom
+ makedepends = git
+ makedepends = make
+ depends = ncurses
+ provides = nbsdgames
+ conflicts = nbsdgames
+ source = git+https://github.com/untakenstupidnick/nbsdgames.git
+ md5sums = SKIP
+
+pkgname = nbsdgames-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..7eb0d4fc715c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,71 @@
+# Maintainer: Elias Riedel Gårding <eliasrg@kth.se>
+# Author: untakenstupidnick <abakh@tuta.io>
+# Discussion: https://www.reddit.com/r/linux/comments/b8y7rp/i_have_made_a_bunch_of_fancy_terminal_games_more/
+pkgname=nbsdgames-git
+pkgver=r35.06237f9_score_patch
+pkgrel=1
+pkgdesc="A collection of curses-based console games"
+arch=('x86_64')
+url="https://github.com/untakenstupidnick/nbsdgames"
+license=('custom')
+depends=('ncurses')
+makedepends=('git' 'make')
+provides=('nbsdgames')
+conflicts=('nbsdgames')
+install=nbsdgames-git.install
+source=("git+https://github.com/untakenstupidnick/nbsdgames.git")
+md5sums=('SKIP')
+
+
+prepare() {
+ # Save a copyright notice (copied from the source code)
+ cat > LICENSE <<EOF
+copyright Hossein Bakhtiarifar 2018 (c)
+No rights are reserved and this software comes with no warranties of any kind to the extent permitted by law.
+EOF
+
+ # Configure jewels and pipes to store scores in ~/.local/games/nbsdgames
+ # (more appropriate for single-user systems) and save a message about it
+ savedir="$HOME/.local/games/${pkgname%%-git}"
+
+ sed -i "1,2s_/usr/games_${savedir}_" \
+ "${pkgname%%-git}/sources/config.h"
+
+ cat > score.txt <<EOF
+${pkgname%%-git} was compiled to store scores from jewels and pipes in $savedir.
+EOF
+}
+
+
+pkgver() {
+ cd "${pkgname%%-git}"
+ printf "r%s.%s_score_patch" \
+ "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+
+build() {
+ # The repo contains pre-compiled binaries, but ignore them and build
+ # from source instead.
+ cd "${pkgname%%-git}/sources"
+ make
+}
+
+
+package() {
+ mkdir -p "$pkgdir/usr/share/licenses/${pkgname}"
+ cp LICENSE "$pkgdir/usr/share/licenses/${pkgname}"
+
+ mkdir -p "$pkgdir/usr/share/doc/${pkgname%%-git}"
+ cp score.txt "$pkgdir/usr/share/doc/${pkgname%%-git}"
+
+ cd "${pkgname%%-git}"
+ cp README.md "$pkgdir/usr/share/doc/${pkgname%%-git}"
+
+ # Install games as /usr/bin/nbsd_* to avoid conflicts
+ mkdir -p "$pkgdir/usr/bin"
+ find sources -type f -executable | while read f
+ do
+ cp "$f" "$pkgdir/usr/bin/nbsd_$(basename "$f")"
+ done
+}
diff --git a/nbsdgames-git.install b/nbsdgames-git.install
new file mode 100644
index 000000000000..898ad44123b4
--- /dev/null
+++ b/nbsdgames-git.install
@@ -0,0 +1,13 @@
+post_install() {
+ cat usr/share/doc/nbsdgames/score.txt
+ echo "You may create empty files jw_scores and pp_scores in this directory."
+}
+
+post_upgrade() {
+ post_install
+}
+
+pre_remove() {
+ cat usr/share/doc/nbsdgames/score.txt
+ echo "You may wish to delete this directory if it exists."
+}