diff options
author | Deposite Pirate | 2018-09-16 18:48:36 +0200 |
---|---|---|
committer | Deposite Pirate | 2018-09-16 18:48:36 +0200 |
commit | d150a5f3e462fa7fe194a805a4aa0076f4d03ab9 (patch) | |
tree | ce5e44d69c5f3175bfdbd1e3717b52c5dcca5638 /games/bsd_games/bsd_games.build | |
parent | f29d3519ce073ec30f99754d93304324f7f26d65 (diff) |
Add ports.
Diffstat (limited to 'games/bsd_games/bsd_games.build')
-rwxr-xr-x | games/bsd_games/bsd_games.build | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/games/bsd_games/bsd_games.build b/games/bsd_games/bsd_games.build new file mode 100755 index 0000000..30bccc7 --- /dev/null +++ b/games/bsd_games/bsd_games.build @@ -0,0 +1,106 @@ +#!/bin/bash +# +# Maintainer: Deposite Pirate <ofni.sknuplatem@etaripd> + +source /usr/src/ports/Build/build.sh + +NAME=bsd_games +VERSION=2.17 +BUILD=2 + +# Description + +cat > ${PKG}/install/slack-desc <<EOF +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + +$(padd)|-----handy-ruler------------------------------------------------------| +${NAME}: bsd_games (Classic BSD text games collection) +${NAME}: +${NAME}: Contains the following console classics : adventure arithmetic atc +${NAME}: backgammon banner battlestar bcd caesar canfield cfscores countmail +${NAME}: cribbage factor fish fortune gomoku hangman hunt mille monop morse +${NAME}: number phantasia pig pom ppt primes quiz rain random robots rot13 +${NAME}: sail snake snscore teachgammon trek wargames worm worms wump +${NAME}: +${NAME}: Adds a call to 'fortune' to /etc/profile.d/ so that users will get a +${NAME}: fortune message when they log in. +${NAME}: +EOF + +cat >> ${PKG}/install/doinst.sh <<EOF +#!/bin/sh +config() { + NEW="\$1" + OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r \$OLD ]; then + mv \$NEW \$OLD + elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then + # toss the redundant copy + rm \$NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +for file in \$(find var/lib/bsdgames -type f ); do + config \${file} + rm -f \${file} +done +EOF + +# Sources + +SRCNAME[0]=bsd-games +SRCVERS[0]=${VERSION} +SRCPACK[0]=ftp://ftp.ibiblio.org/pub/Linux/games/${SRCNAME[0]}-${SRCVERS[0]}.tar.gz + +build0() +{ +sed -i "s|@PKGDIR@|${PKG}|g" config.params +cp fortune/datfiles/unamerican-o.real fortune/datfiles/unamerican-o.fake +cp fortune/datfiles/unamerican-o.real unamerican-o +./configure +make ${JOBS} +make install +doc AUTHORS BUGS THANKS +changelog NEWS +install.dir ${PKG}${SYS_DIR[etc]}/{profile.d,tmpfiles.d} +install.bin fortune.{sh,csh} ${PKG}${SYS_DIR[etc]}/profile.d +install.dat hunt.conf.tmpfiles ${PKG}${SYS_DIR[etc]}/tmpfiles.d/hunt.conf +install.dir ${PKG}${SYS_DIR[share]}/dict +install.dat hangman-words ${PKG}${SYS_DIR[share]}/dict/words +# Scores etc... +find ${PKG}${SYS_DIR[var]}/lib/bsdgames -type f -exec mv {} {}.new \; +chown -R root.games ${PKG}${SYS_DIR[var]}/lib/bsdgames +chmod 0664 ${PKG}${SYS_DIR[var]}/lib/bsdgames/* +chmod 0664 ${PKG}${SYS_DIR[var]}/lib/bsdgames/{hack,phantasia}/* +chmod 0775 ${PKG}${SYS_DIR[var]}/lib/bsdgames/{hack,phantasia} +#FIXME: this should not go here +#install.dir ${PKG}${SYS_DIR[share]}/application-data/bsdgames/data/hack/save +# Conflicting files +mv ${PKG}${SYS_DIR[bin]}/fish ${PKG}${SYS_DIR[bin]}/go-fish +mv ${PKG}${SYS_DIR[man]}/man6/fish.6 ${PKG}${SYS_DIR[man]}/man6/go-fish.6 +mv ${PKG}${SYS_DIR[man]}/man6/worm.6 ${PKG}${SYS_DIR[man]}/man6/worm-game.6 +# Extra fortunes +rm -f ${PKG}${SYS_DIR[share]}/application-data/bsdgames/fortune/limerick{,.dat} +install.dat extra-fortunes/* ${PKG}${SYS_DIR[share]}/application-data/bsdgames/fortune +( +cd ${PKG}${SYS_DIR[share]}/application-data/bsdgames/fortune +rm -f *.dat +for file in ./*; do + ${PKG}${SYS_DIR[bin]}/strfile -r $(basename ${file} .dat) +done +for file in ./*-o; do + ${PKG}${SYS_DIR[bin]}/strfile -r -x $(basename ${file} .dat) +done +) +# Clean-up +rm -rf \ + ${PKG}/tmp \ + ${PKG}${SYS_DIR[doc]}/trek.me +} |