summaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorswallace <swallace@FreeBSD.org>1994-09-19 05:41:13 +0000
committerswallace <swallace@FreeBSD.org>1994-09-19 05:41:13 +0000
commitc15ded12c6ef30dac4161c8c1c8b2d6b4a628d40 (patch)
treedf711a1adec790589545d446f9e69770419830d5 /games
parent2796b2bd7a1d4af638944ef0308d26126f29c116 (diff)
downloadFreeBSD-src-c15ded12c6ef30dac4161c8c1c8b2d6b4a628d40.zip
FreeBSD-src-c15ded12c6ef30dac4161c8c1c8b2d6b4a628d40.tar.gz
Change setup.c so that game files are generated into obj dir,
then Makefile installs into ${DESTDIR}/var/games/phantasia
Diffstat (limited to 'games')
-rw-r--r--games/phantasia/Makefile9
-rw-r--r--games/phantasia/pathnames.h8
-rw-r--r--games/phantasia/setup.c32
3 files changed, 32 insertions, 17 deletions
diff --git a/games/phantasia/Makefile b/games/phantasia/Makefile
index 06a6671..2f1073b 100644
--- a/games/phantasia/Makefile
+++ b/games/phantasia/Makefile
@@ -15,7 +15,14 @@ setup: phantglobs.o setup.o monsters.asc ${LIBM}
beforeinstall:
./setup -m ${.CURDIR}/monsters.asc
- chown games.bin ${DESTDIR}/var/games/phantasia/*
+ install -c -m 660 -o games -g bin gold ${DESTDIR}/var/games/phantasia
+ install -c -m 660 -o games -g bin lastdead ${DESTDIR}/var/games/phantasia
+ install -c -m 660 -o games -g bin mess ${DESTDIR}/var/games/phantasia
+ install -c -m 660 -o games -g bin monsters ${DESTDIR}/var/games/phantasia
+ install -c -m 660 -o games -g bin motd ${DESTDIR}/var/games/phantasia
+ install -c -m 660 -o games -g bin characs ${DESTDIR}/var/games/phantasia
+ install -c -m 660 -o games -g bin scoreboard ${DESTDIR}/var/games/phantasia
+ install -c -m 660 -o games -g bin void ${DESTDIR}/var/games/phantasia
# Make Phantasia map. Change the map commands reflect your installation.
# PLOTDEVICE is used for plotting the map. Change as appropriate.
diff --git a/games/phantasia/pathnames.h b/games/phantasia/pathnames.h
index 9e4d46b..cce5475 100644
--- a/games/phantasia/pathnames.h
+++ b/games/phantasia/pathnames.h
@@ -42,3 +42,11 @@
#define _PATH_PEOPLE "/var/games/phantasia/characs"
#define _PATH_SCORE "/var/games/phantasia/scoreboard"
#define _PATH_VOID "/var/games/phantasia/void"
+#define _SPATH_GOLD "gold"
+#define _SPATH_LASTDEAD "lastdead"
+#define _SPATH_MESS "mess"
+#define _SPATH_MONST "monsters"
+#define _SPATH_MOTD "motd"
+#define _SPATH_PEOPLE "characs"
+#define _SPATH_SCORE "scoreboard"
+#define _SPATH_VOID "void"
diff --git a/games/phantasia/setup.c b/games/phantasia/setup.c
index f916727..0306678 100644
--- a/games/phantasia/setup.c
+++ b/games/phantasia/setup.c
@@ -38,14 +38,14 @@
/************************************************************************/
static char *files[] = { /* all files to create */
- _PATH_MONST,
- _PATH_PEOPLE,
- _PATH_MESS,
- _PATH_LASTDEAD,
- _PATH_MOTD,
- _PATH_GOLD,
- _PATH_VOID,
- _PATH_SCORE,
+ _SPATH_MONST,
+ _SPATH_PEOPLE,
+ _SPATH_MESS,
+ _SPATH_LASTDEAD,
+ _SPATH_MOTD,
+ _SPATH_GOLD,
+ _SPATH_VOID,
+ _SPATH_SCORE,
NULL,
};
@@ -86,7 +86,7 @@ main(argc, argv)
if (stat(*filename, &fbuf) == 0)
/* file exists; remove it */
{
- if (!strcmp(*filename, _PATH_PEOPLE))
+ if (!strcmp(*filename, _SPATH_PEOPLE))
/* do not reset character file if it already exists */
{
++filename;
@@ -111,8 +111,8 @@ main(argc, argv)
Enrgyvoid.ev_active = TRUE;
Enrgyvoid.ev_x = ROLL(-1.0e6, 2.0e6);
Enrgyvoid.ev_y = ROLL(-1.0e6, 2.0e6);
- if ((fp = fopen(_PATH_VOID, "w")) == NULL)
- Error("Cannot update %s.\n", _PATH_VOID);
+ if ((fp = fopen(_SPATH_VOID, "w")) == NULL)
+ Error("Cannot update %s.\n", _SPATH_VOID);
else
{
fwrite(&Enrgyvoid, SZ_VOIDSTRUCT, 1, fp);
@@ -120,8 +120,8 @@ main(argc, argv)
}
/* create binary monster data base */
- if ((Monstfp = fopen(_PATH_MONST, "w")) == NULL)
- Error("Cannot update %s.\n", _PATH_MONST);
+ if ((Monstfp = fopen(_SPATH_MONST, "w")) == NULL)
+ Error("Cannot update %s.\n", _SPATH_MONST);
else
{
if ((fp = fopen(monsterfile, "r")) == NULL)
@@ -160,8 +160,8 @@ main(argc, argv)
printf("One line 'motd' ? ");
if (fgets(Databuf, SZ_DATABUF, stdin) == NULL)
Databuf[0] = '\0';
- if ((fp = fopen(_PATH_MOTD, "w")) == NULL)
- Error("Cannot update %s.\n", _PATH_MOTD);
+ if ((fp = fopen(_SPATH_MOTD, "w")) == NULL)
+ Error("Cannot update %s.\n", _SPATH_MOTD);
else
{
fwrite(Databuf, sizeof(char), strlen(Databuf), fp);
@@ -170,7 +170,7 @@ main(argc, argv)
/* report compile-time options */
printf("Compiled options:\n\n");
- printf("Phantasia destination directory: %s\n", _PATH_PHANTDIR);
+ printf("Phantasia destination directory: %s\n", _SPATH_PHANTDIR);
printf("Wizard: root UID: 0\n");
#ifdef BSD41
OpenPOWER on IntegriCloud