diff --git a/srcpkgs/sauerbraten-data b/srcpkgs/sauerbraten-data new file mode 120000 index 00000000000..3cb2a023b6d --- /dev/null +++ b/srcpkgs/sauerbraten-data @@ -0,0 +1 @@ +sauerbraten \ No newline at end of file diff --git a/srcpkgs/sauerbraten-server b/srcpkgs/sauerbraten-server new file mode 120000 index 00000000000..3cb2a023b6d --- /dev/null +++ b/srcpkgs/sauerbraten-server @@ -0,0 +1 @@ +sauerbraten \ No newline at end of file diff --git a/srcpkgs/sauerbraten/files/sauerbraten b/srcpkgs/sauerbraten/files/sauerbraten new file mode 100644 index 00000000000..10d821bec48 --- /dev/null +++ b/srcpkgs/sauerbraten/files/sauerbraten @@ -0,0 +1,7 @@ +#!/bin/sh +SAUER_DATA=/usr/share/sauerbraten +SAUER_BIN=/usr/bin/sauer_client +SAUER_OPTIONS="-q${HOME}/.sauerbraten" + +cd ${SAUER_DATA} +exec ${SAUER_BIN} ${SAUER_OPTIONS} "$@" diff --git a/srcpkgs/sauerbraten/files/sauerbraten-server b/srcpkgs/sauerbraten/files/sauerbraten-server new file mode 100644 index 00000000000..dbcc6d0df03 --- /dev/null +++ b/srcpkgs/sauerbraten/files/sauerbraten-server @@ -0,0 +1,6 @@ +#!/bin/sh +SAUER_DATA=/etc/sauerbraten/ +SAUER_SERV_BIN=/usr/bin/sauer_server + +cd ${SAUER_DATA} +exec ${SAUER_SERV_BIN} "$@" diff --git a/srcpkgs/sauerbraten/patches/flags.patch b/srcpkgs/sauerbraten/patches/flags.patch new file mode 100644 index 00000000000..be7bb4bd295 --- /dev/null +++ b/srcpkgs/sauerbraten/patches/flags.patch @@ -0,0 +1,35 @@ +--- src/Makefile.orig 2017-01-12 21:54:08.156276696 -0600 ++++ src/Makefile 2017-01-12 21:56:06.889752748 -0600 +@@ -1,4 +1,4 @@ +-CXXFLAGS= -O3 -fomit-frame-pointer ++CXXFLAGS= -O3 -fomit-frame-pointer $(CFLAGS) + override CXXFLAGS+= -Wall -fsigned-char -fno-exceptions -fno-rtti + + PLATFORM= $(shell uname -s) +@@ -137,7 +137,7 @@ + + enet/Makefile: + cd enet; ./configure --enable-shared=no --enable-static=yes +- ++ + libenet: enet/Makefile + $(MAKE) -C enet/ all + +@@ -177,13 +177,13 @@ + install: all + else + client: libenet $(CLIENT_OBJS) +- $(CXX) $(CXXFLAGS) -o sauer_client $(CLIENT_OBJS) $(CLIENT_LIBS) ++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o sauer_client $(CLIENT_OBJS) $(CLIENT_LIBS) + + server: libenet $(SERVER_OBJS) +- $(CXX) $(CXXFLAGS) -o sauer_server $(SERVER_OBJS) $(SERVER_LIBS) +- ++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o sauer_server $(SERVER_OBJS) $(SERVER_LIBS) ++ + master: libenet $(MASTER_OBJS) +- $(CXX) $(CXXFLAGS) -o sauer_master $(MASTER_OBJS) $(MASTER_LIBS) ++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o sauer_master $(MASTER_OBJS) $(MASTER_LIBS) + + shared/cube2font.o: shared/cube2font.c + $(CXX) $(CXXFLAGS) -c -o $@ $< `freetype-config --cflags` diff --git a/srcpkgs/sauerbraten/template b/srcpkgs/sauerbraten/template new file mode 100644 index 00000000000..dce56578976 --- /dev/null +++ b/srcpkgs/sauerbraten/template @@ -0,0 +1,51 @@ +# Template file for 'sauerbraten' +pkgname=sauerbraten +version=2013.02.03 +revision=1 +wrksrc=$pkgname +build_wrksrc=src +build_style=gnu-makefile +conf_files="/etc/sauerbraten/server-init.cfg" +makedepends="SDL_image-devel SDL_mixer-devel zlib-devel" +depends="${pkgname}-data-${version}_${revision}" +short_desc="3D game engine (more powerful redesign of the Cube engine) and FPS game" +maintainer="Michael Aldridge " +license="zlib" +homepage="http://sauerbraten.org" +distfiles="${SOURCEFORGE_SITE}/sauerbraten/sauerbraten_${version//./_}_collect_edition_linux.tar.bz2" +checksum=45c20521e3e56374490b2d9112a211538e801cf0161197f35476b30b7b58a78e + +# Too big to store on current mirror infrastructure, and not a high +# priority package +restricted=yes + +# Its only supported to build on i686 and x86_64, and enet doesn't +# cross compile +only_for_archs="x86_64" + + +post_install() { + vbin $wrksrc/bin_unix/native_client sauer_client + vbin ${FILESDIR}/sauerbraten +} + +sauerbraten-data_package() { + noarch=yes + pkg_install() { + vmkdir usr/share/$sourcepkg + vcopy $wrksrc/data usr/share/$sourcepkg/data + vcopy $wrksrc/packages usr/share/$sourcepkg/packages + } +} + +sauerbraten-server_package() { + pkg_install() { + vbin $wrksrc/bin_unix/native_server sauer_server + vmkdir etc/$sourcepkg + vcopy $wrksrc/server-init.cfg etc/$sourcepkg/server-init.cfg + vbin ${FILESDIR}/sauerbraten-server + + # No service directory because this server isn't really suited + # to running for long periods of time. + } +}