o Add wrapper scripts for the executables cube_client and cube_server, and
place the programs in libexec because it needs to write files in the data directory (otherwise it crashes). o Use %%DATADIR%% in pkg-plist. PR: ports/85270 Submitted by: Alejandro Pulver <alejandro@varnet.biz> Approved by: maintainer
This commit is contained in:
@@ -15,7 +15,7 @@ DISTNAME= ${PORTNAME}_${PORTVERSION:S/./_/g}
|
||||
MAINTAINER= avleeuwen@piwebs.com
|
||||
COMMENT= An OpenGL 3D First Person Shooter game
|
||||
|
||||
EXTRACT_DEPENDS+= unzip:${PORTSDIR}/archivers/unzip
|
||||
EXTRACT_DEPENDS+= unzip:${PORTSDIR}/archivers/unzip
|
||||
|
||||
USE_SDL= image mixer sdl
|
||||
USE_GMAKE= yes
|
||||
@@ -27,11 +27,12 @@ BUILD_WRKSRC= ${WRKSRC}/source/src
|
||||
DATADIR= ${PREFIX}/share/cube
|
||||
CONFIGURE_WRKSRC= ${WRKSRC}/source/enet
|
||||
|
||||
SUB_FILES= cube_client cube_server
|
||||
|
||||
post-extract:
|
||||
@ ${UNZIP_CMD} -a -q -o ${WRKSRC}/source/${DISTNAME}_src.zip -d ${WRKSRC}/source/
|
||||
|
||||
post-patch:
|
||||
@${ECHO_CMD} '#define DATADIR "${DATADIR}"' >> ${BUILD_WRKSRC}/cube.h
|
||||
@${REINPLACE_CMD} -e 's|%%CXX%%|${CXX}|g ; \
|
||||
s|%%CXXFLAGS%%|${CXXFLAGS}|g ; s|%%X11BASE%%|${X11BASE}|g' \
|
||||
${BUILD_WRKSRC}/Makefile
|
||||
@@ -40,8 +41,10 @@ pre-configure:
|
||||
@${CHMOD} u+x ${CONFIGURE_WRKSRC}/configure
|
||||
|
||||
do-install:
|
||||
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/cube_client ${PREFIX}/bin
|
||||
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/cube_server ${PREFIX}/bin
|
||||
${INSTALL_SCRIPT} ${WRKDIR}/cube_client ${PREFIX}/bin
|
||||
${INSTALL_SCRIPT} ${WRKDIR}/cube_server ${PREFIX}/bin
|
||||
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/cube_client ${PREFIX}/libexec
|
||||
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/cube_server ${PREFIX}/libexec
|
||||
${MKDIR} ${DATADIR}/savegames
|
||||
${CP} -Rp ${WRKSRC}/packages ${DATADIR}
|
||||
${CP} -Rp ${WRKSRC}/data ${DATADIR}
|
||||
|
||||
19
games/cube/files/cube_client.in
Normal file
19
games/cube/files/cube_client.in
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
# The executable needs to be run from its data directory, and needs to store
|
||||
# configuration in it. We therefore mirror the data directory hierarchy in
|
||||
# ~/.cube, and create symlinks to the data files, but the configuration file
|
||||
# is copied, and write permission for the user is added to it.
|
||||
|
||||
cd %%DATADIR%% || exit 1
|
||||
|
||||
find * -type d -exec mkdir -p ~/.cube/{} \; || exit 1
|
||||
|
||||
test -f ~/.cube/autoexec.cfg || cp autoexec.cfg ~/.cube &&
|
||||
chmod u+w ~/.cube/autoexec.cfg
|
||||
|
||||
find * -type f -exec ln -s %%DATADIR%%/{} ~/.cube/{} \; 2>/dev/null || exit 1
|
||||
|
||||
cd ~/.cube || exit 1
|
||||
|
||||
exec %%PREFIX%%/libexec/cube_client
|
||||
19
games/cube/files/cube_server.in
Normal file
19
games/cube/files/cube_server.in
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
# The executable needs to be run from its data directory, and needs to store
|
||||
# configuration in it. We therefore mirror the data directory hierarchy in
|
||||
# ~/.cube, and create symlinks to the data files, but the configuration file
|
||||
# is copied, and write permission for the user is added to it.
|
||||
|
||||
cd %%DATADIR%% || exit 1
|
||||
|
||||
find * -type d -exec mkdir -p ~/.cube/{} \; || exit 1
|
||||
|
||||
test -f ~/.cube/autoexec.cfg || cp autoexec.cfg ~/.cube &&
|
||||
chmod u+w ~/.cube/autoexec.cfg
|
||||
|
||||
find * -type f -exec ln -s %%DATADIR%%/{} ~/.cube/{} \; 2>/dev/null || exit 1
|
||||
|
||||
cd ~/.cube || exit 1
|
||||
|
||||
exec %%PREFIX%%/libexec/cube_server
|
||||
@@ -1,19 +0,0 @@
|
||||
--- source/src/main.old Thu Oct 17 22:27:33 2002
|
||||
+++ source/src/main.cpp Thu Oct 17 22:58:12 2002
|
||||
@@ -1,6 +1,7 @@
|
||||
// main.cpp: initialisation & main loop
|
||||
|
||||
#include "cube.h"
|
||||
+#include <unistd.h>
|
||||
|
||||
void cleanup(char *msg) // single program exit point;
|
||||
{
|
||||
@@ -101,6 +102,8 @@
|
||||
|
||||
#define log(s) puts("init: " s)
|
||||
log("sdl");
|
||||
+
|
||||
+ ::chdir(DATADIR);
|
||||
|
||||
for(int i = 1; i<argc; i++)
|
||||
{
|
||||
1752
games/cube/pkg-plist
1752
games/cube/pkg-plist
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user