summaryrefslogtreecommitdiff
path: root/games/xsoldier
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2001-09-14 03:48:06 +0000
committerjlam <jlam@pkgsrc.org>2001-09-14 03:48:06 +0000
commitcad6c11f9e9a5c20484b8b188d4bb8ef96369dcc (patch)
tree8727e497b7c47ff5e1dc7b196292816dbad98137 /games/xsoldier
parentaa0541e1f35bd69e986039899800eba0c0f7d177 (diff)
downloadpkgsrc-cad6c11f9e9a5c20484b8b188d4bb8ef96369dcc.tar.gz
Fix problems with xpkgwedge and score file installation noted by John
Darrow <John.P.Darrow@wheaton.edu> in pkg/13264. Changes noted in the PR were applied with some small changes to use FILES_SUBST/FILES_SUBST_SED to unify the various substitution patterns for the *INSTALL files, and to use ${CMP} instead of diff in the DEINSTALL file.
Diffstat (limited to 'games/xsoldier')
-rw-r--r--games/xsoldier/Makefile24
-rw-r--r--games/xsoldier/distinfo4
-rw-r--r--games/xsoldier/patches/patch-aa12
-rw-r--r--games/xsoldier/pkg/DEINSTALL71
-rw-r--r--games/xsoldier/pkg/INSTALL45
-rw-r--r--games/xsoldier/pkg/PLIST3
6 files changed, 149 insertions, 10 deletions
diff --git a/games/xsoldier/Makefile b/games/xsoldier/Makefile
index e8ae800022d..6a24f94ed8b 100644
--- a/games/xsoldier/Makefile
+++ b/games/xsoldier/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2001/08/22 17:38:58 jlam Exp $
+# $NetBSD: Makefile,v 1.7 2001/09/14 03:48:06 jlam Exp $
#
DISTNAME= xsoldier-0.96
@@ -12,8 +12,30 @@ COMMENT= Updated xgalaga type game with awesome graphics
USE_IMAKE= YES
NO_INSTALL_MANPAGES= YES
+DEINSTALL_FILE= ${WRKDIR}/DEINSTALL
+INSTALL_FILE= ${WRKDIR}/INSTALL
+
+MAKE_ENV+= BINOWN=${BINOWN}
+
+FILES_SUBST= CAT=${CAT:Q}
+FILES_SUBST+= CHGRP=${CHGRP:Q}
+FILES_SUBST+= CHMOD=${CHMOD:Q}
+FILES_SUBST+= CHOWN=${CHOWN:Q}
+FILES_SUBST+= CMP=${CMP:Q}
+FILES_SUBST+= CP=${CP:Q}
+FILES_SUBST+= ECHO=${ECHO:Q}
+FILES_SUBST+= RM=${RM:Q}
+FILES_SUBST_SED= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/}
+
post-patch:
${TOUCH} ${WRKSRC}/xsoldier.man
+pre-install:
+ ${SED} ${FILES_SUBST_SED} ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE}
+ ${SED} ${FILES_SUBST_SED} ${PKGDIR}/INSTALL > ${INSTALL_FILE}
+
+post-install:
+ PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL
+
.include "../../graphics/xpm/buildlink.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/games/xsoldier/distinfo b/games/xsoldier/distinfo
index cdbb330cd7f..a198ebfdc70 100644
--- a/games/xsoldier/distinfo
+++ b/games/xsoldier/distinfo
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.2 2001/04/21 02:08:42 wiz Exp $
+$NetBSD: distinfo,v 1.3 2001/09/14 03:48:06 jlam Exp $
SHA1 (xsoldier-0.96.tar.gz) = af16dbe1506cdd519a099ed58e26a5569400bea2
Size (xsoldier-0.96.tar.gz) = 82413 bytes
-SHA1 (patch-aa) = 426f57ec82b4fe8be553684bc2f6ec4162e80bc6
+SHA1 (patch-aa) = 26eb8778cf418e092e321bed04aee302135d2cbc
SHA1 (patch-ab) = 464407fb6e9e0af33b57d7dfc17a58acb1591f0a
SHA1 (patch-ac) = 3551fd7507aa0ff8faeb9cdc8e2addc03dbc1274
SHA1 (patch-ad) = 2d4b158bd7200b7228de4dc5e082b75e1d191adb
diff --git a/games/xsoldier/patches/patch-aa b/games/xsoldier/patches/patch-aa
index dbe5e32b367..18830af7a57 100644
--- a/games/xsoldier/patches/patch-aa
+++ b/games/xsoldier/patches/patch-aa
@@ -1,4 +1,4 @@
-$NetBSD: patch-aa,v 1.3 1998/09/15 00:05:41 garbled Exp $
+$NetBSD: patch-aa,v 1.4 2001/09/14 03:48:07 jlam Exp $
--- Imakefile.orig Fri Feb 28 08:48:57 1997
+++ Imakefile Mon Sep 14 16:52:46 1998
@@ -11,12 +11,12 @@
@@ -8,9 +8,9 @@ $NetBSD: patch-aa,v 1.3 1998/09/15 00:05:41 garbled Exp $
-PIXMAPDIR = /usr/local/games/lib/xsoldier
-SCOREDIR = /usr/local/games/lib/xsoldier
-BINDIR = /usr/local/games
-+PIXMAPDIR = $(X11BASE)/share/xsoldier
++PIXMAPDIR = $(PREFIX)/share/xsoldier
+SCOREDIR = /var/games/
-+BINDIR = $(X11BASE)/bin
++BINDIR = $(PREFIX)/bin
/* スコアファイル名.SCOREDIR 以下に置かれます. */
-SCOREFILE = .scorefile
@@ -25,8 +25,8 @@ $NetBSD: patch-aa,v 1.3 1998/09/15 00:05:41 garbled Exp $
- @if [ -d $(SCOREDIR) ]; then chmod 755 $(SCOREDIR); \
- else $(MKDIRHIER) $(SCOREDIR); chmod 755 $(SCOREDIR); fi
- $(INSTALL) -c -m 600 scorefile.txt $(SCOREDIR)/$(SCOREFILE)
-+ @if [ ! -e $(SCOREDIR)/$(SCOREFILE) ]; then \
-+ $(INSTALL) -c -g games -o bin -m 664 scorefile.txt $(SCOREDIR)/$(SCOREFILE) ; \
++ @if [ ! -e $(PIXMAPDIR)/$(SCOREFILE).score.dist ]; then \
++ $(BSD_INSTALL_DATA) scorefile.txt $(PIXMAPDIR)/$(SCOREFILE).score.dist ; \
+ fi
@echo "install score . done"
@@ -36,5 +36,5 @@ $NetBSD: patch-aa,v 1.3 1998/09/15 00:05:41 garbled Exp $
@if [ -d $(BINDIR) ]; then set +x; \
else (set -x; $(MKDIRHIER) $(BINDIR)); fi
- $(INSTALL) -c -m 4755 $(PROGRAM) $(BINDIR)/$(PROGRAM)
-+ $(INSTALL) -c -o bin -g games -m 2755 $(PROGRAM) $(BINDIR)/$(PROGRAM)
++ $(INSTALL) -c -o $(BINOWN) -g games -m 2755 $(PROGRAM) $(BINDIR)/$(PROGRAM)
@echo "install bin . done"
diff --git a/games/xsoldier/pkg/DEINSTALL b/games/xsoldier/pkg/DEINSTALL
new file mode 100644
index 00000000000..3ec9d84607b
--- /dev/null
+++ b/games/xsoldier/pkg/DEINSTALL
@@ -0,0 +1,71 @@
+#!/bin/sh
+#
+# $NetBSD: DEINSTALL,v 1.1 2001/09/14 03:48:07 jlam Exp $
+
+PKGNAME=$1
+STAGE=$2
+
+CAT="@CAT@"
+CMP="@CMP@"
+ECHO="@ECHO@"
+RM="@RM@"
+
+SCOREDISTDIR=${PKG_PREFIX}/share/xsoldier
+SCOREDIR=/var/games
+
+SCOREFILES=" ${SCOREDISTDIR}/xsoldier.score.dist ${SCOREDIR}/xsoldier"
+
+case ${STAGE} in
+DEINSTALL)
+ # Remove score files if they don't differ from the default
+ # score files.
+ #
+ ${ECHO} ${SCOREFILES} | while read SAMPLEFILE FILE
+ do
+ if ${CMP} -s ${FILE} ${SAMPLEFILE}
+ then
+ ${RM} -f ${FILE}
+ fi
+ done
+ ;;
+
+POST-DEINSTALL)
+ modified_files=''
+ for FILE in ${SCOREFILES}
+ do
+ if [ -f ${FILE} ]
+ then
+ modified_files="${modified_files} ${FILE}"
+ fi
+ done
+
+ if [ -n "${modified_files}" ]
+ then
+ ${CAT} << EOF
+===========================================================================
+If you won't be using ${PKGNAME} any longer, you may want to remove:
+EOF
+ if [ -n "${modified_files}" ]
+ then
+ ${CAT} << EOF
+
+ * the following files:
+
+EOF
+ for file in ${modified_files}
+ do
+ echo " ${file}"
+ done
+ fi
+ ${CAT} << EOF
+===========================================================================
+EOF
+ fi
+ ;;
+
+*)
+ echo "Unexpected argument: ${STAGE}"
+ exit 1
+ ;;
+esac
+exit 0
diff --git a/games/xsoldier/pkg/INSTALL b/games/xsoldier/pkg/INSTALL
new file mode 100644
index 00000000000..838ab0baa4f
--- /dev/null
+++ b/games/xsoldier/pkg/INSTALL
@@ -0,0 +1,45 @@
+#! /bin/sh
+#
+# $NetBSD: INSTALL,v 1.1 2001/09/14 03:48:07 jlam Exp $
+
+PKGNAME=$1
+STAGE=$2
+
+CHGRP="@CHGRP@"
+CHMOD="@CHMOD@"
+CHOWN="@CHOWN@"
+CP="@CP@"
+ECHO="@ECHO@"
+
+SCOREDIR=/var/games
+SCOREDISTDIR=${PKG_PREFIX}/share/xsoldier
+
+SCOREFILES=" ${SCOREDISTDIR}/xsoldier.score.dist ${SCOREDIR}/xsoldier"
+
+case ${STAGE} in
+PRE-INSTALL)
+ ;;
+
+POST-INSTALL)
+ echo "Installing score files:"
+ ${ECHO} ${SCOREFILES} | while read SAMPLEFILE FILE
+ do
+ if [ -f ${FILE} ]
+ then
+ echo " ${FILE} already exists"
+ else
+ echo " ${FILE}"
+ ${CP} ${SAMPLEFILE} ${FILE}
+ ${CHOWN} games ${FILE}
+ ${CHGRP} games ${FILE}
+ ${CHMOD} 664 ${FILE}
+ fi
+ done
+ ;;
+
+*)
+ echo "Unexpected argument: ${STAGE}"
+ exit 1
+ ;;
+esac
+exit 0
diff --git a/games/xsoldier/pkg/PLIST b/games/xsoldier/pkg/PLIST
index b2cd0a0adcf..ab17149f8a0 100644
--- a/games/xsoldier/pkg/PLIST
+++ b/games/xsoldier/pkg/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.2 1998/09/15 00:05:41 garbled Exp $
+@comment $NetBSD: PLIST,v 1.3 2001/09/14 03:48:08 jlam Exp $
bin/xsoldier
share/xsoldier/Boss1.xpm
share/xsoldier/Boss2.xpm
@@ -29,4 +29,5 @@ share/xsoldier/PlayerShot3.xpm
share/xsoldier/Star1.xpm
share/xsoldier/Star2.xpm
share/xsoldier/Title.xpm
+share/xsoldier/xsoldier.score.dist
@dirrm share/xsoldier