aboutsummaryrefslogtreecommitdiff
path: root/games/freeminer
diff options
context:
space:
mode:
authorDmitry Marakasov <amdmi3@FreeBSD.org>2013-12-07 01:25:01 +0000
committerDmitry Marakasov <amdmi3@FreeBSD.org>2013-12-07 01:25:01 +0000
commit2d08067666d3b3505068726ab90eb63116638bbe (patch)
treef1cbabdd6e696cde068c04677f920e54f1e254bb /games/freeminer
parent335986c64aa77eaa74ac44fca47ddc3edacef614 (diff)
downloadports-2d08067666d3b3505068726ab90eb63116638bbe.tar.gz
ports-2d08067666d3b3505068726ab90eb63116638bbe.zip
Notes
Diffstat (limited to 'games/freeminer')
-rw-r--r--games/freeminer/Makefile86
-rw-r--r--games/freeminer/distinfo2
-rw-r--r--games/freeminer/files/freeminer.in76
-rw-r--r--games/freeminer/pkg-descr3
-rw-r--r--games/freeminer/pkg-message9
-rw-r--r--games/freeminer/pkg-plist7
6 files changed, 183 insertions, 0 deletions
diff --git a/games/freeminer/Makefile b/games/freeminer/Makefile
new file mode 100644
index 000000000000..207b4f4c07fc
--- /dev/null
+++ b/games/freeminer/Makefile
@@ -0,0 +1,86 @@
+# Created by: Dmitry Marakasov <amdmi3@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME= freeminer
+PORTVERSION= 0.4.8.2
+CATEGORIES= games
+
+MAINTAINER= amdmi3@FreeBSD.org
+COMMENT= Open source sandbox game inspired by Minecraft
+
+LICENSE= LGPL21
+
+LIB_DEPENDS= libIrrlicht.so:${PORTSDIR}/x11-toolkits/irrlicht \
+ sqlite3:${PORTSDIR}/databases/sqlite3
+
+USE_GITHUB= yes
+GH_ACCOUNT= ${PORTNAME}
+GH_COMMIT= 79bf405
+
+USES= cmake
+CMAKE_ARGS= -DCUSTOM_MANDIR="${PREFIX}/man" \
+ -DCUSTOM_EXAMPLE_CONF_DIR="${PREFIX}/etc"
+
+PORTDATA= *
+PORTDOCS= *
+
+OPTIONS_DEFINE= CLIENT SERVER CURL NLS SOUND DOCS EXAMPLES FREETYPE LEVELDB LUAJIT
+OPTIONS_DEFAULT=CLIENT SERVER CURL SOUND
+OPTIONS_SUB= yes
+
+CLIENT_DESC= Build client
+SERVER_DESC= Build server
+CURL_DESC= Enable cURL support for fetching media
+SOUND_DESC= Enable sound
+LEVELDB_DESC= Enable LevelDB backend
+FREETYPE_DESC= Support for TrueType fonts with unicode
+LUAJIT_DESC= LuaJIT support
+
+CLIENT_CMAKE_ON= -DBUILD_CLIENT=1
+CLIENT_CMAKE_OFF= -DBUILD_CLIENT=0
+CLIENT_LIB_DEPENDS= libjpeg.so:${PORTSDIR}/graphics/jpeg \
+ libpng.so:${PORTSDIR}/graphics/png
+CLIENT_USE= GL=gl XORG=x11
+SERVER_CMAKE_ON= -DBUILD_SERVER=1
+SERVER_CMAKE_OFF= -DBUILD_SERVER=0
+CURL_CMAKE_ON= -DENABLE_CURL=1
+CURL_CMAKE_OFF= -DENABLE_CURL=0
+CURL_LIB_DEPENDS= libcurl.so:${PORTSDIR}/ftp/curl
+NLS_CMAKE_ON= -DENABLE_GETTEXT=1
+NLS_CMAKE_OFF= -DENABLE_GETTEXT=0
+NLS_USES= gettext
+NLS_LDFLAGS= -L${LOCALBASE}/lib
+SOUND_CMAKE_ON= -DENABLE_SOUND=1
+SOUND_CMAKE_OFF= -DENABLE_SOUND=0
+LEVELDB_CMAKE_ON= -DENABLE_LEVELDB=1
+LEVELDB_CMAKE_OFF= -DENABLE_LEVELDB=0
+LEVELDB_LIB_DEPENDS= libleveldb.so:${PORTSDIR}/databases/leveldb
+FREETYPE_CMAKE_ON= -DENABLE_FREETYPE=1
+FREETYPE_CMAKE_OFF= -DENABLE_FREETYPE=0
+FREETYPE_LIB_DEPENDS= libfreetype.so:${PORTSDIR}/print/freetype2
+LUAJIT_LIB_DEPENDS= libluajit-5.1.so:${PORTSDIR}/lang/luajit
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSOUND}
+USE_OPENAL+= yes
+LIB_DEPENDS+= libvorbis.so:${PORTSDIR}/audio/libvorbis
+.endif
+
+.if ${PORT_OPTIONS:MSERVER}
+USE_RC_SUBR= ${PORTNAME}
+USERS= minetest # reuse, as freeminer is a fork of
+GROUPS= minetest
+.endif
+
+post-patch:
+ @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' \
+ ${WRKSRC}/cmake/Modules/*.cmake
+ @${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|' \
+ ${WRKSRC}/src/CMakeLists.txt
+.if ! ${PORT_OPTIONS:MLUAJIT}
+ @${REINPLACE_CMD} -e '/find_/ s|LUA_|NO&|g' \
+ ${WRKSRC}/src/CMakeLists.txt
+.endif
+
+.include <bsd.port.mk>
diff --git a/games/freeminer/distinfo b/games/freeminer/distinfo
new file mode 100644
index 000000000000..99a6d8d45399
--- /dev/null
+++ b/games/freeminer/distinfo
@@ -0,0 +1,2 @@
+SHA256 (freeminer-0.4.8.2.tar.gz) = 38606ece229b82332765b7777a6ed97f0062eeb1ded4a3b5e1a1211720047f14
+SIZE (freeminer-0.4.8.2.tar.gz) = 5313173
diff --git a/games/freeminer/files/freeminer.in b/games/freeminer/files/freeminer.in
new file mode 100644
index 000000000000..4734b3e54dcb
--- /dev/null
+++ b/games/freeminer/files/freeminer.in
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: freeminer
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following line to /etc/rc.conf[.local] to enable freeminer server
+#
+# freeminer_enable (bool): Set to "NO" by default
+# Set it to "YES" to enable freeminer server
+# freeminer_conffile (str): Path to config file (required).
+# (default: /usr/local/etc/freeminer.conf)
+# freeminer_rundir (str): Path to directory holding a pidfile.
+# (default: /var/run/freeminer)
+# freeminer_user (str): User to run as
+# (default: freeminer)
+# freeminer_group (str): Group to run as
+# (default: freeminer)
+# freeminer_logdir (str): Path to log directory
+# (default: /var/log/freeminer)
+# freeminer_dbdir (str): Path to world database directory
+# (default: /var/db/freeminer)
+
+. /etc/rc.subr
+
+name=freeminer
+rcvar=freeminer_enable
+
+load_rc_config ${name}
+
+: ${freeminer_enable="NO"}
+: ${freeminer_config="/usr/local/etc/freeminer.conf"}
+: ${freeminer_rundir="/var/run/freeminer"}
+: ${freeminer_user="freeminer"}
+: ${freeminer_group="freeminer"}
+: ${freeminer_logdir="/var/log/freeminer"}
+: ${freeminer_dbdir="/var/db/freeminer"}
+: ${freeminer_args:="--logfile ${freeminer_logdir}/debug.log --world ${freeminer_dbdir}/world ${freeminer_flags}"}
+
+pidfile=
+
+case "${freeminer_args}" in
+*--config\ *)
+ echo "Warning \$freeminer_args includes --config option." \
+ "Please use \$freeminer_conffile instead."
+ ;;
+*)
+ freeminer_args="--config ${freeminer_config} ${freeminer_args}"
+ ;;
+esac
+
+command=/usr/sbin/daemon
+procname=/usr/local/bin/freeminerserver
+pidfile=${freeminer_rundir}/freeminer.pid
+command_args="-c -f -p ${pidfile} ${procname} ${freeminer_args}"
+required_files=${freeminer_config}
+start_precmd=freeminer_prestart
+
+freeminer_prestart () {
+ if [ ! -d ${freeminer_rundir} ]; then
+ mkdir -m 755 -p ${freeminer_rundir}
+ chown -R ${freeminer_user}:${freeminer_group} ${freeminer_rundir}
+ fi
+ if [ ! -d ${freeminer_logdir} ]; then
+ mkdir -m 755 -p ${freeminer_logdir}
+ chown -R ${freeminer_user}:${freeminer_group} ${freeminer_logdir}
+ fi
+ if [ ! -d ${freeminer_dbdir} ]; then
+ mkdir -m 755 -p ${freeminer_dbdir}/data
+ chown -R ${freeminer_user}:${freeminer_group} ${freeminer_dbdir}
+ fi
+}
+
+run_rc_command "$1"
diff --git a/games/freeminer/pkg-descr b/games/freeminer/pkg-descr
new file mode 100644
index 000000000000..f8044139ed6d
--- /dev/null
+++ b/games/freeminer/pkg-descr
@@ -0,0 +1,3 @@
+Freeminer is a Minecraft-inspired sandbox game.
+
+WWW: http://freeminer.org/
diff --git a/games/freeminer/pkg-message b/games/freeminer/pkg-message
new file mode 100644
index 000000000000..7e1157455bfb
--- /dev/null
+++ b/games/freeminer/pkg-message
@@ -0,0 +1,9 @@
+Freeminer engine has been installed.
+
+Note that for offline play or for server hosting you also need
+to install game data. For now, only one game is available for
+freeminer and you can install it with games/freeminer-default
+port.
+
+For online play engine is sufficient as it will downloaded all
+required data automatically.
diff --git a/games/freeminer/pkg-plist b/games/freeminer/pkg-plist
new file mode 100644
index 000000000000..e194429f13ed
--- /dev/null
+++ b/games/freeminer/pkg-plist
@@ -0,0 +1,7 @@
+%%CLIENT%%bin/freeminer
+%%SERVER%%bin/freeminerserver
+@unexec if cmp -s %D/etc/freeminer.conf.example %D/etc/freeminer.conf; then rm -f %D/etc/freeminer.conf; fi
+etc/freeminer.conf.example
+@exec if [ ! -f %B/freeminer.conf ]; then cp -p %D/%F %B/freeminer.conf; fi
+man/man6/freeminer.6.gz
+man/man6/freeminerserver.6.gz