aboutsummaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorpawel <pawel@FreeBSD.org>2014-04-11 20:58:55 +0800
committerpawel <pawel@FreeBSD.org>2014-04-11 20:58:55 +0800
commitfb12003beb184fb1a6f6868df316d22b6747a15f (patch)
treeb403e410ecbf128827ebb40b9f7ff3fd3a1858b3 /games
parent6e147c01ab80ba24871c4c28c1bd041596f7ab3c (diff)
downloadfreebsd-ports-gnome-fb12003beb184fb1a6f6868df316d22b6747a15f.tar.gz
freebsd-ports-gnome-fb12003beb184fb1a6f6868df316d22b6747a15f.tar.zst
freebsd-ports-gnome-fb12003beb184fb1a6f6868df316d22b6747a15f.zip
- Add staging support
- Move ownership setting, /var dir creation to pkg-plist - Automatically install/remove sample files - Update pkg-message info, use SUB_FILES for DOCSDIR sub
Diffstat (limited to 'games')
-rw-r--r--games/conquest/Makefile39
-rw-r--r--games/conquest/files/pkg-message.in7
-rw-r--r--games/conquest/pkg-install7
-rw-r--r--games/conquest/pkg-message16
-rw-r--r--games/conquest/pkg-plist10
5 files changed, 30 insertions, 49 deletions
diff --git a/games/conquest/Makefile b/games/conquest/Makefile
index 9197ab630db5..e3b1b522f1bf 100644
--- a/games/conquest/Makefile
+++ b/games/conquest/Makefile
@@ -18,41 +18,32 @@ CONFIGURE_ARGS= --sysconfdir=${LOCALBASE}/etc/conquest \
--localstatedir=/var/games
CFLAGS+= -Wno-return-type
GROUPS= ${PORTNAME}
-BINGRP= conquest
-SHAREGRP= conquest
MAKE_JOBS_UNSAFE= yes
PORTDOCS= README
+SUB_FILES= pkg-message
+
OPTIONS_DEFINE= DOCS
-NO_STAGE= yes
post-patch:
${REINPLACE_CMD} "s|^.*@chgrp .(CONQGROUP) conq.*||g; \
s|^.*@chmod 2771 conq.*||g;" ${WRKSRC}/Makefile.in
${REINPLACE_CMD} "s/# include <termio.h>//g" ${WRKSRC}/c_defs.h
${REINPLACE_CMD} "s/-O2 -fPIC//g" ${WRKSRC}/configure
-.include <bsd.port.options.mk>
-
do-install:
- ${INSTALL_PROGRAM} -m 2550 ${WRKSRC}/conqai ${PREFIX}/sbin
- ${INSTALL_PROGRAM} -m 2551 ${WRKSRC}/conqdriv ${PREFIX}/libexec
- ${INSTALL_PROGRAM} -m 2551 ${WRKSRC}/conqoper ${PREFIX}/sbin
- ${INSTALL_PROGRAM} ${WRKSRC}/conqstrat ${PREFIX}/sbin
- ${INSTALL_PROGRAM} -m 2551 ${WRKSRC}/conquest ${PREFIX}/bin
- @${MKDIR} ${PREFIX}/etc/conquest
- ${INSTALL_DATA} ${WRKSRC}/conqrule \
- ${PREFIX}/etc/conquest/conqrule.sample
- @${MKDIR} ${DATADIR}
- ${INSTALL_DATA} ${WRKSRC}/conqnews.doc ${DATADIR}/conqnews.doc.sample
- ${INSTALL_DATA} ${WRKSRC}/conquest.doc ${DATADIR}
-.if ${PORT_OPTIONS:MDOCS}
- @${MKDIR} ${DOCSDIR}
- ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
-.endif
- @${SH} pkg-install ${PORTNAME} POST-INSTALL
-
-post-install:
- @${CAT} ${PKGMESSAGE}
+ ${INSTALL_PROGRAM} -m 2550 ${WRKSRC}/conqai ${STAGEDIR}${PREFIX}/sbin
+ ${INSTALL_PROGRAM} -m 2551 ${WRKSRC}/conqdriv ${STAGEDIR}${PREFIX}/libexec
+ ${INSTALL_PROGRAM} -m 2551 ${WRKSRC}/conqoper ${STAGEDIR}${PREFIX}/sbin
+ ${INSTALL_PROGRAM} ${WRKSRC}/conqstrat ${STAGEDIR}${PREFIX}/sbin
+ ${INSTALL_PROGRAM} -m 2551 ${WRKSRC}/conquest ${STAGEDIR}${PREFIX}/bin
+ @${MKDIR} ${STAGEDIR}${ETCDIR}
+ ${INSTALL_DATA} ${WRKSRC}/conqrule ${STAGEDIR}${ETCDIR}/conqrule.sample
+ @${MKDIR} ${STAGEDIR}${DATADIR}
+ ${INSTALL_DATA} ${WRKSRC}/conqnews.doc \
+ ${STAGEDIR}${DATADIR}/conqnews.doc.sample
+ ${INSTALL_DATA} ${WRKSRC}/conquest.doc ${STAGEDIR}${DATADIR}
+ @${MKDIR} ${STAGEDIR}${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR}
.include <bsd.port.mk>
diff --git a/games/conquest/files/pkg-message.in b/games/conquest/files/pkg-message.in
new file mode 100644
index 000000000000..e267d092ea70
--- /dev/null
+++ b/games/conquest/files/pkg-message.in
@@ -0,0 +1,7 @@
+Before Conquest can be run it must be configured, you need to
+initialise and enable the game:
+
+# sbin/conqoper -C
+# sbin/conqoper -Ie -E
+
+Conqoper is documented in %%DOCSDIR%%/README.
diff --git a/games/conquest/pkg-install b/games/conquest/pkg-install
deleted file mode 100644
index 26f77ef404cb..000000000000
--- a/games/conquest/pkg-install
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-case "$2" in
- POST-INSTALL)
- install -d -o root -g conquest -m 770 /var/games/conquest
- ;;
-esac
diff --git a/games/conquest/pkg-message b/games/conquest/pkg-message
deleted file mode 100644
index cb1b0097e520..000000000000
--- a/games/conquest/pkg-message
+++ /dev/null
@@ -1,16 +0,0 @@
-Before Conquest can be run it must be configured. First copy the sample
-configuration into place:
-
-# cp etc/conquest/conqrule.sample etc/conquest/conqrule
-
-Then you can initialise and enable the game:
-
-# sbin/conqoper -C
-# sbin/conqoper -Ie -E
-
-Conqoper is documented in share/doc/conquest/README.
-
-Also a file for the in-game news must be created. This package includes a
-sample news file you can copy into place:
-
-# cp share/conquest/conqnews.doc.sample share/conquest/conqnews.doc
diff --git a/games/conquest/pkg-plist b/games/conquest/pkg-plist
index 584a09d1465d..59694317f2c3 100644
--- a/games/conquest/pkg-plist
+++ b/games/conquest/pkg-plist
@@ -1,10 +1,16 @@
+@group conquest
bin/conquest
+@unexec if cmp -s %D/etc/conquest/conqrule.sample %D/etc/conquest/conqrule ; then rm -f %D/etc/conquest/conqrule; fi
etc/conquest/conqrule.sample
+@exec if [ ! -f %D/etc/conquest/conqrule ] ; then cp -p %D/%F %B/conqrule; fi
libexec/conqdriv
sbin/conqai
sbin/conqoper
sbin/conqstrat
+@unexec if cmp -s %D/%%DATADIR%%/conqnews.doc.sample %D/%%DATADIR%%/conqnews.doc ; then rm -f %D/%%DATADIR%%/conqnews.doc; fi
%%DATADIR%%/conqnews.doc.sample
+@exec if [ ! -f %D/%%DATADIR%%/conqnews.doc ] ; then cp -p %D/%F %B/conqnews.doc; fi
%%DATADIR%%/conquest.doc
-@dirrm etc/conquest
-@dirrm %%DATADIR%%
+@dirrmtry etc/conquest
+@dirrmtry %%DATADIR%%
+@exec install -d -o root -g conquest -m 770 /var/games/conquest || true