summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO65
-rw-r--r--.gitignore1
-rw-r--r--PKGBUILD128
-rw-r--r--actionfps6
-rw-r--r--actionfps-gcc6-1.patch270
-rw-r--r--actionfps-server6
-rw-r--r--actionfps.desktop4
-rw-r--r--systemd-actionfps-server.service18
-rw-r--r--systemd-actionfps-sysuser.conf2
9 files changed, 166 insertions, 334 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3832037ea235..515abd3a53c1 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = actionfps
pkgdesc = A game based on the open-source AssaultCube first-person shooter (FPS)
- pkgver = 1000
+ pkgver = 1.2.0.2.r896.g80dcc7b
pkgrel = 1
url = https://actionfps.com
arch = i686
@@ -9,28 +9,59 @@ pkgbase = actionfps
license = custom
makedepends = mesa
makedepends = clang
+ makedepends = sdl
+ makedepends = sdl_mixer
+ makedepends = sdl_image
+ makedepends = openal
+ makedepends = libgl
+ makedepends = glu
+ makedepends = libogg
+ makedepends = libvorbis
+ makedepends = curl
+ makedepends = git
+ depends = zlib
+ depends = gcc-libs
+ source = assaultcube-actionfps::git+https://github.com/ActionFPS/AC.git#commit=80dcc7b4281bfcf02439e93275b20ae58971b6dc
+ source = actionfps
+ source = actionfps-server
+ source = actionfps.desktop
+ source = actionfps.png
+ source = systemd-actionfps-sysuser.conf
+ source = systemd-actionfps-server.service
+ sha512sums = 3c2d75c8d445b44afbfba1844a187fcedceb6d300869d6d7b449bd7ae36126fff8fca6f9246873b23a68d8f5d7dc7c64909837c8393da5ef6b70b89cc0964a8c
+ sha512sums = c99ae5698749d3c5f3003b2d8403c93ee1964b971a621e48c3013dff1f230a06819bdda5d250cf576186c45154875d900eb546dc71e4fb820299c5d0c12e9705
+ sha512sums = ba4f9cb222e9440dea9c44ca7f492e26a012c850b96adc866b76a30ed93b0b9b38c0b67c63b03e310769801c1be41c604606ddd819af8bce3a6acbb6b91c30f4
+ sha512sums = cb6d8a09aba2136aa3450979bcc577830db7b83791101decc819711357c887479e7f03b0515be18f3d0f781845e83a62e19c83a7b910f7059db550237c6b9a4f
+ sha512sums = 30b0e533939831f90695641632b70dbdd3adbab09fb89af24d8eb1fed7056942124775c1f8b2bb22b852800eb6d9749ed54b5fb6661c283ea590b519acbd1975
+ sha512sums = e14b9dd96b57d5f10981197d01de90007d5366330bd853d38eeaa4e866cebcd5d5567e3f6c538b0eff60e6dee9359d248e1c82db9b50b7f1482da0c6cc93e14c
+ sha512sums = eecba69c8a9630152514b04bd7588fa23f0d0f43c31bed4e58bb872fc30738094e01b7613543d04033ac2b4eb88d1010ab610a88ea69afac24a1d2f9733215d1
+
+pkgname = actionfps-client
+ depends = zlib
+ depends = gcc-libs
+ depends = actionfps-common
+ depends = mesa
depends = sdl
depends = sdl_mixer
depends = sdl_image
depends = openal
- depends = zlib
- depends = gcc-libs
depends = libgl
depends = glu
+ depends = libogg
+ depends = libvorbis
depends = curl
- provides = actionfps
- source = https://github.com/ActionFPS/ActionFPS-Game/archive/version_1000.tar.gz
- source = actionfps-gcc6-1.patch
- source = actionfps
- source = actionfps-server
- source = actionfps.desktop
- source = actionfps.png
- md5sums = 32dad06e74202dea378efff732c0c249
- md5sums = ac0b864edc62900fecaa547fd456645e
- md5sums = 3273bc8220f2e50e39e8076f06d8144d
- md5sums = d00249969554bd600f5a39187a10c5d4
- md5sums = 22aaf111f2bce517000baaa375ba9321
- md5sums = f7da6cb5df462439693b4c2560223a97
+ conflicts = actionfps
+ replaces = actionfps
-pkgname = actionfps
+pkgname = actionfps-server
+ depends = zlib
+ depends = gcc-libs
+ depends = actionfps-common
+ depends = systemd
+ conflicts = actionfps
+ replaces = actionfps
+ backup = etc/actionfps/servercmdline.txt
+pkgname = actionfps-common
+ conflicts = actionfps
+ replaces = actionfps
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..72e8ffc0db8a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*
diff --git a/PKGBUILD b/PKGBUILD
index 068f9a3e5b7e..04323b3e6c25 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,56 +1,110 @@
-# $Id$
-# Maintainer: Tejuswi Vaghjee <tejvghj at gmail dot com>
+# Maintainer: Patrick Northon <northon_patrick3@yahoo.ca>
+# Contributor: Tucker Boniface <tucker@boniface.tech>
+# Contributor: Tejuswi Vaghjee <tejvghj at gmail dot com>
# Contributor: Sven-Hendrik Haase <sh at lutzhaase dot com>
# Contributor: Jaroslaw Swierczynski <swiergot at aur dot archlinux dot org>
# Contributor: Roman Kyrylych <Roman dot Kyrylych at gmail dot com>
# Contributor: Rabyte <rabyte at gmail dot com>
-pkgname=actionfps
-gitname=ActionFPS-Game-version_1000
-pkgver=1000
+pkgbase=actionfps
+pkgname=(${pkgbase}-client ${pkgbase}-server ${pkgbase}-common)
+pkgver=1.2.0.2.r896.g80dcc7b
pkgrel=1
-pkgdesc="A game based on the open-source AssaultCube first-person shooter (FPS)"
+pkgdesc='A game based on the open-source AssaultCube first-person shooter (FPS)'
arch=('i686' 'x86_64')
-url="https://actionfps.com"
+url='https://actionfps.com'
license=('ZLIB' 'custom')
-depends=('sdl' 'sdl_mixer' 'sdl_image' 'openal' 'zlib' 'gcc-libs' 'libgl' 'glu' 'curl')
-makedepends=('mesa' 'clang')
-provides=('actionfps')
-source=("https://github.com/ActionFPS/ActionFPS-Game/archive/version_1000.tar.gz"
- 'actionfps-gcc6-1.patch'
+depends=('zlib' 'gcc-libs')
+makedepends=('mesa' 'clang' 'sdl' 'sdl_mixer' 'sdl_image' 'openal' 'libgl' 'glu' 'libogg' 'libvorbis' 'curl' 'git')
+_commit='80dcc7b4281bfcf02439e93275b20ae58971b6dc'
+source=("assaultcube-$pkgbase::git+https://github.com/ActionFPS/AC.git#commit=${_commit}"
'actionfps'
'actionfps-server'
'actionfps.desktop'
- 'actionfps.png')
-md5sums=('32dad06e74202dea378efff732c0c249'
- 'ac0b864edc62900fecaa547fd456645e'
- '3273bc8220f2e50e39e8076f06d8144d'
- 'd00249969554bd600f5a39187a10c5d4'
- '22aaf111f2bce517000baaa375ba9321'
- 'f7da6cb5df462439693b4c2560223a97')
+ 'actionfps.png'
+ "systemd-${pkgbase}-sysuser.conf"
+ "systemd-${pkgbase}-server.service")
+sha512sums=('3c2d75c8d445b44afbfba1844a187fcedceb6d300869d6d7b449bd7ae36126fff8fca6f9246873b23a68d8f5d7dc7c64909837c8393da5ef6b70b89cc0964a8c'
+ 'c99ae5698749d3c5f3003b2d8403c93ee1964b971a621e48c3013dff1f230a06819bdda5d250cf576186c45154875d900eb546dc71e4fb820299c5d0c12e9705'
+ 'ba4f9cb222e9440dea9c44ca7f492e26a012c850b96adc866b76a30ed93b0b9b38c0b67c63b03e310769801c1be41c604606ddd819af8bce3a6acbb6b91c30f4'
+ 'cb6d8a09aba2136aa3450979bcc577830db7b83791101decc819711357c887479e7f03b0515be18f3d0f781845e83a62e19c83a7b910f7059db550237c6b9a4f'
+ '30b0e533939831f90695641632b70dbdd3adbab09fb89af24d8eb1fed7056942124775c1f8b2bb22b852800eb6d9749ed54b5fb6661c283ea590b519acbd1975'
+ 'e14b9dd96b57d5f10981197d01de90007d5366330bd853d38eeaa4e866cebcd5d5567e3f6c538b0eff60e6dee9359d248e1c82db9b50b7f1482da0c6cc93e14c'
+ 'eecba69c8a9630152514b04bd7588fa23f0d0f43c31bed4e58bb872fc30738094e01b7613543d04033ac2b4eb88d1010ab610a88ea69afac24a1d2f9733215d1')
+
+_srcdir="assaultcube-$pkgbase"
+
+_cflags=${CLANG_CFLAGS:-$CFLAGS}
+check_option 'lto' 'y' && _cflags+=' -flto=auto'
+_cxxflags=${CLANG_CXXFLAGS:-$CXXFLAGS}
+check_option 'lto' 'y' && _cxxflags+=' -flto=auto'
+
+pkgver() {
+ cd "${_srcdir}"
+ ( set -o pipefail
+ git describe --tags --abbrev=7 --long 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' ||
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
+ )
+}
prepare() {
- cd ${gitname}
- # Fix build with GCC 6
- patch -p1 -i ../actionfps-gcc6-1.patch
+ cd "${_srcdir}"
+ rm -rf 'source/lib'
+ sed -i 's|CUBE_DIR=./|CUBE_DIR=$(dirname "$(readlink -f "${0}")")|' 'server.sh'
+ sed -i 's|CUBE_OPTIONFILE=-Cconfig/servercmdline.txt|CUBE_OPTIONFILE=-C/etc/actionfps/servercmdline.txt|' 'server.sh'
+ cd 'source/src'
+ sed -i 's|static inline float round|//static inline float round|' 'tools.h'
+ sed -i "s/CXXFLAGS= -O3/CXXFLAGS= ${_cxxflags}/" 'Makefile'
}
build() {
- cd "${gitname}/source/src"
- make
+ cd "${_srcdir}/source/src"
+ CC=clang CXX=clang++ CFLAGS="${_cflags}" CXXFLAGS="${_cxxflags}" make
}
-package() {
- cd "${gitname}/source/src"
- install -Dm755 ac_client ${pkgdir}/usr/bin/actionfps_client
- install -Dm755 ac_server ${pkgdir}/usr/bin/actionfps_server
-
- cd ${srcdir}/${gitname}
- mkdir -p ${pkgdir}/usr/share/actionfps
- cp -rf config packages docs ${pkgdir}/usr/share/actionfps
- install -Dm644 ${srcdir}/actionfps.png ${pkgdir}/usr/share/pixmaps/actionfps.png
- install -Dm644 ${srcdir}/actionfps.desktop ${pkgdir}/usr/share/applications/actionfps.desktop
- install -Dm644 docs/package_copyrights.txt ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
- install -Dm755 ${srcdir}/actionfps ${pkgdir}/usr/bin/actionfps
- install -Dm755 ${srcdir}/actionfps-server ${pkgdir}/usr/bin/actionfps-server
+package_actionfps-common() {
+ install -dm755 "${pkgdir}/usr/share/games/${pkgbase}"
+ conflicts=('actionfps')
+ replaces=('actionfps')
+
+ cp -r "${_srcdir}"/{bot,docs,config} \
+ "${pkgdir}/usr/share/games/${pkgbase}"
+
+ rm "${pkgdir}/usr/share/games/${pkgbase}/config/servercmdline.txt"
+ find "${pkgdir}/usr/share/games/${pkgbase}/docs" -type f -exec chmod -R 0644 '{}' \;
+ find "${pkgdir}/usr/share/games/${pkgbase}/docs" -type d -exec chmod -R 0755 '{}' \;
+
+ install -Dm644 "${_srcdir}"/{README.html,changelog.txt} -t "${pkgdir}/usr/share/games/${pkgbase}"
+ install -Dm644 "${_srcdir}/docs/package_copyrights.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
+
+package_actionfps-client() {
+ depends+=('actionfps-common' 'mesa' 'sdl' 'sdl_mixer' 'sdl_image' 'openal' 'libgl' 'glu' 'libogg' 'libvorbis' 'curl')
+ conflicts=('actionfps')
+ replaces=('actionfps')
+
+ install -dm755 "${pkgdir}/usr/share/games/${pkgbase}"
+ install -Dm755 "${_srcdir}/assaultcube.sh" -t "${pkgdir}/usr/share/games/${pkgbase}"
+ install -Dm755 "${_srcdir}/source/src/ac_client" "${pkgdir}/usr/share/games/${pkgbase}/bin_unix/native_client"
+ cp -r "${_srcdir}"/{mods,packages} "${pkgdir}/usr/share/games/${pkgbase}"
+ install -Dm644 "${pkgbase}.png" -t "${pkgdir}/usr/share/pixmaps"
+ install -Dm644 "${pkgbase}.desktop" -t "${pkgdir}/usr/share/applications"
+ install -Dm755 "${pkgbase}" "${pkgdir}/usr/bin/${pkgbase}"
+}
+
+package_actionfps-server() {
+ depends+=('actionfps-common' 'systemd')
+ backup=('etc/actionfps/servercmdline.txt')
+ conflicts=('actionfps')
+ replaces=('actionfps')
+
+ install -Dm755 "${pkgbase}-server" -t "${pkgdir}/usr/bin"
+ install -Dm644 "${_srcdir}/config/servercmdline.txt" -t "${pkgdir}/etc/${pkgbase}"
+
+ install -Dm755 "${_srcdir}/source/src/ac_server" "${pkgdir}/usr/share/games/actionfps/bin_unix/native_server"
+ install -Dm755 "${_srcdir}"/{server.sh,server_wizard.sh} -t "${pkgdir}/usr/share/games/${pkgbase}"
+
+ install -Dm644 "systemd-${pkgbase}-sysuser.conf" "${pkgdir}/usr/lib/sysusers.d/${pkgbase}.conf"
+ install -Dm644 "systemd-${pkgbase}-server.service" "${pkgdir}/usr/lib/systemd/system/${pkgbase}-server.service"
+}
+
diff --git a/actionfps b/actionfps
index 7f46160f33b1..f5b00dea1936 100644
--- a/actionfps
+++ b/actionfps
@@ -1,4 +1,2 @@
-#!/bin/bash
-
-cd /usr/share/actionfps
-actionfps_client "--home=${HOME}/.actionfps/v1.2next" "--init=${HOME}/.actionfps/v1.2next/config/init.cfg" "$@"
+#!/usr/bin/env sh
+/usr/share/games/actionfps/assaultcube.sh "$@"
diff --git a/actionfps-gcc6-1.patch b/actionfps-gcc6-1.patch
deleted file mode 100644
index c2dc62b19344..000000000000
--- a/actionfps-gcc6-1.patch
+++ /dev/null
@@ -1,270 +0,0 @@
-diff -Naur a/source/src/bot/bot_waypoint.cpp b/source/src/bot/bot_waypoint.cpp
---- a/source/src/bot/bot_waypoint.cpp 2017-01-28 18:36:39.304498305 +0400
-+++ b/source/src/bot/bot_waypoint.cpp 2017-01-28 18:50:44.804515824 +0400
-@@ -1202,7 +1202,7 @@
- flCost += (1.0f-flFraction)*0.5f;
- }
-
-- if ((abs(a) > 4) || (abs(b) > 4)) continue;
-+ if ((iabs(a) > 4) || (iabs(b) > 4)) continue;
-
- vec from = to;
- to.z -= (JUMP_HEIGHT - 1.0f);
-@@ -1230,7 +1230,7 @@
- flCost += (1.0f-flFraction)*0.5f;
- }
-
-- if ((abs(a) > 4) || (abs(b) > 4)) continue;
-+ if ((iabs(a) > 4) || (iabs(b) > 4)) continue;
-
- vec from = to;
- to.z -= (JUMP_HEIGHT - 1.0f);
-@@ -1650,12 +1650,12 @@
- void CWaypointClass::GetNodeIndexes(const vec &v_origin, short *i, short *j)
- {
- // Function code by cheesy and PMB
-- //*i = abs((int)((int)(v_origin.x + (2*ssize)) / SECTOR_SIZE));
-- //*j = abs((int)((int)(v_origin.y + (2*ssize)) / SECTOR_SIZE));
-+ //*i = iabs((int)((int)(v_origin.x + (2*ssize)) / SECTOR_SIZE));
-+ //*j = iabs((int)((int)(v_origin.y + (2*ssize)) / SECTOR_SIZE));
- //*i = (int)((v_origin.x) / ssize * MAX_MAP_GRIDS);
- //*j = (int)((v_origin.y) / ssize * MAX_MAP_GRIDS);
-- *i = abs((int)((v_origin.x) / MAX_MAP_GRIDS));
-- *j = abs((int)((v_origin.y) / MAX_MAP_GRIDS));
-+ *i = iabs((int)((v_origin.x) / MAX_MAP_GRIDS));
-+ *j = iabs((int)((v_origin.y) / MAX_MAP_GRIDS));
-
- if (*i > MAX_MAP_GRIDS - 1)
- *i = MAX_MAP_GRIDS - 1;
-diff -Naur a/source/src/command.cpp b/source/src/command.cpp
---- a/source/src/command.cpp 2017-01-28 18:36:39.307831652 +0400
-+++ b/source/src/command.cpp 2017-01-28 18:52:31.451604564 +0400
-@@ -560,7 +560,7 @@
- if(lc<=seer_t1.length())
- {
- int dt = seer_t1[seer_index] - seer_t1[lc];
-- if(abs(dt)<2)
-+ if(iabs(dt)<2)
- {
- conoutf("SCRIPT EXECUTION warning [%d:%s]", &p, p);
- seer_t2.add(seer_t1[seer_index]);
-@@ -1876,4 +1876,4 @@
- printf("\n");
- }
-
--COMMAND(debugargs, "v");
-\ No newline at end of file
-+COMMAND(debugargs, "v");
-diff -Naur a/source/src/command.h b/source/src/command.h
---- a/source/src/command.h 2017-01-28 18:36:39.307831652 +0400
-+++ b/source/src/command.h 2017-01-28 18:55:14.932251334 +0400
-@@ -92,6 +92,7 @@
- #define VARNP(name, global, min, cur, max) int global = variable(#name, min, cur, max, &global, NULL, true)
- #define VARF(name, min, cur, max, body) extern int name; void var_##name() { body; } int name = variable(#name, min, cur, max, &name, var_##name, false)
- #define VARFP(name, min, cur, max, body) extern int name; void var_##name() { body; } int name = variable(#name, min, cur, max, &name, var_##name, true)
-+#define VARNFP(name, global, min, cur, max, body) extern int global; void var_##name() { body; } int global = variable(#name, min, cur, max, &global, var_##name, true)
-
- #define FVARP(name, min, cur, max) float name = fvariable(#name, min, cur, max, &name, NULL, true)
- #define FVAR(name, min, cur, max) float name = fvariable(#name, min, cur, max, &name, NULL, false)
-diff -Naur a/source/src/crypto.cpp b/source/src/crypto.cpp
---- a/source/src/crypto.cpp 2017-01-28 18:36:39.307831652 +0400
-+++ b/source/src/crypto.cpp 2017-01-28 19:00:46.546895794 +0400
-@@ -760,7 +760,7 @@
- const char *genpwdhash(const char *name, const char *pwd, int salt)
- {
- static string temp;
-- formatstring(temp)("%s %d %s %s %d", pwd, salt, name, pwd, abs(PROTOCOL_VERSION));
-+ formatstring(temp)("%s %d %s %s %d", pwd, salt, name, pwd, iabs(PROTOCOL_VERSION));
- tiger::hashval hash;
- tiger::hash((uchar *)temp, (int)strlen(temp), hash);
- formatstring(temp)("%s %s %s", hashchunktoa(hash.chunks[0]), hashchunktoa(hash.chunks[1]), hashchunktoa(hash.chunks[2]));
-@@ -914,4 +914,4 @@
- }
-
- return ret;
--}
-\ No newline at end of file
-+}
-diff -Naur a/source/src/editing.cpp b/source/src/editing.cpp
---- a/source/src/editing.cpp 2017-01-28 18:36:39.307831652 +0400
-+++ b/source/src/editing.cpp 2017-01-28 19:03:14.050897839 +0400
-@@ -165,12 +165,12 @@
- // update current selection, or add a new one
- void makesel(bool isnew)
- {
-- if(isnew || sels.length() == 0) addselection(min(lastx, cx), min(lasty, cy), abs(lastx-cx)+1, abs(lasty-cy)+1, max(lasth, ch));
-+ if(isnew || sels.length() == 0) addselection(min(lastx, cx), min(lasty, cy), iabs(lastx-cx)+1, iabs(lasty-cy)+1, max(lasth, ch));
- else
- {
- block &cursel = sels.last();
- cursel.x = min(lastx, cx); cursel.y = min(lasty, cy);
-- cursel.xs = abs(lastx-cx)+1; cursel.ys = abs(lasty-cy)+1;
-+ cursel.xs = iabs(lastx-cx)+1; cursel.ys = iabs(lasty-cy)+1;
- cursel.h = max(lasth, ch);
- correctsel(cursel);
- }
-@@ -991,7 +991,7 @@
- }
- if(xo || yo)
- {
-- block b = { max(-xo, 0), max(-yo, 0), ssize - abs(xo), ssize - abs(yo) }, *cp = blockcopy(b);
-+ block b = { max(-xo, 0), max(-yo, 0), ssize - iabs(xo), ssize - iabs(yo) }, *cp = blockcopy(b);
- cp->x = max(xo, 0);
- cp->y = max(yo, 0);
- blockpaste(*cp);
-diff -Naur a/source/src/entity.h b/source/src/entity.h
---- a/source/src/entity.h 2017-01-28 18:36:39.307831652 +0400
-+++ b/source/src/entity.h 2017-01-28 19:04:03.171122415 +0400
-@@ -561,7 +561,7 @@
- {
- const int maxskin[2] = { 4, 6 };
- t = team_base(t < 0 ? team : t);
-- nextskin[t] = abs(s) % maxskin[t];
-+ nextskin[t] = iabs(s) % maxskin[t];
- }
- };
-
-diff -Naur a/source/src/main.cpp b/source/src/main.cpp
---- a/source/src/main.cpp 2017-01-28 18:36:39.307831652 +0400
-+++ b/source/src/main.cpp 2017-01-28 19:08:03.538884468 +0400
-@@ -526,11 +526,11 @@
- COMMANDF(screenres, "ii", (int *w, int *h) { screenres(*w, *h); });
-
- static int curgamma = 100;
--VARFP(gamma, 30, 100, 300,
-+VARNFP(gamma, vgamma, 30, 100, 300,
- {
-- if(gamma == curgamma) return;
-- curgamma = gamma;
-- float f = gamma/100.0f;
-+ if(vgamma == curgamma) return;
-+ curgamma = vgamma;
-+ float f = vgamma/100.0f;
- if(SDL_SetGamma(f,f,f)==-1) conoutf("Could not set gamma: %s", SDL_GetError());
- });
-
-diff -Naur a/source/src/platform.h b/source/src/platform.h
---- a/source/src/platform.h 2017-01-28 18:36:39.311164998 +0400
-+++ b/source/src/platform.h 2017-01-28 19:12:19.610248054 +0400
-@@ -3,13 +3,6 @@
- #undef _FORTIFY_SOURCE
- #endif
-
-- #define gamma __gamma
--#endif
--
--#include <math.h>
--
--#ifdef __GNUC__
-- #undef gamma
- #endif
-
- #include <string.h>
-@@ -22,6 +15,7 @@
- #include <vector>
- #include <algorithm>
- #include <string>
-+#include <math.h>
-
- #ifdef __MINGW32__
- #include <stdint.h>
-diff -Naur a/source/src/protos.h b/source/src/protos.h
---- a/source/src/protos.h 2017-01-28 18:36:39.311164998 +0400
-+++ b/source/src/protos.h 2017-01-28 19:14:56.971094022 +0400
-@@ -1109,7 +1109,8 @@
- {
- demo_interm = true;
- }
-- else if(ai > 0) maxdemos = ai; break;
-+ else if(ai > 0) maxdemos = ai;
-+ break;
- }
- case 'W': demopath = a; break;
- case 'r': maprot = a; break;
-diff -Naur a/source/src/rendercubes.cpp b/source/src/rendercubes.cpp
---- a/source/src/rendercubes.cpp 2017-01-28 18:36:39.311164998 +0400
-+++ b/source/src/rendercubes.cpp 2017-01-28 19:20:09.016083692 +0400
-@@ -216,9 +216,9 @@
- else // continue strip
- {
- int lighterr = lighterror*2;
-- if((abs(ol1r-l3->r)<lighterr && abs(ol2r-l4->r)<lighterr // skip vertices if light values are close enough
-- && abs(ol1g-l3->g)<lighterr && abs(ol2g-l4->g)<lighterr
-- && abs(ol1b-l3->b)<lighterr && abs(ol2b-l4->b)<lighterr) || !wtex)
-+ if((iabs(ol1r-l3->r)<lighterr && iabs(ol2r-l4->r)<lighterr // skip vertices if light values are close enough
-+ && iabs(ol1g-l3->g)<lighterr && iabs(ol2g-l4->g)<lighterr
-+ && iabs(ol1b-l3->b)<lighterr && iabs(ol2b-l4->b)<lighterr) || !wtex)
- {
- verts.setsize(verts.length()-2);
- nquads--;
-@@ -375,7 +375,7 @@
- {
- int lighterr = lighterror*2;
- if((!hf && !ohf)
-- && ((abs(ol1r-l2->r)<lighterr && abs(ol1g-l2->g)<lighterr && abs(ol1b-l2->b)<lighterr) || !wtex)) // skip vertices if light values are close enough
-+ && ((iabs(ol1r-l2->r)<lighterr && iabs(ol1g-l2->g)<lighterr && abs(ol1b-l2->b)<lighterr) || !wtex)) // skip vertices if light values are close enough
- {
- verts.setsize(verts.length()-2);
- nquads--;
-diff -Naur a/source/src/rendertext.cpp b/source/src/rendertext.cpp
---- a/source/src/rendertext.cpp 2017-01-28 18:36:39.311164998 +0400
-+++ b/source/src/rendertext.cpp 2017-01-28 19:21:03.273035596 +0400
-@@ -154,7 +154,7 @@
- if(c=='r') c = stack[(sp > 0) ? --sp : sp]; // restore color
- else if(c == 'b') { if(allowblinkingtext && !ignoreblinkingbit) stack[sp] *= -1; } // blinking text - only if allowed
- else stack[sp] = c;
-- switch(abs(stack[sp]))
-+ switch(iabs(stack[sp]))
- {
- case '0': color = bvec( 2, 255, 128 ); break; // green: player talk
- case '1': color = bvec( 96, 160, 255 ); break; // blue: team chat
-@@ -204,7 +204,7 @@
- //default: color = bvec( 255, 255, 255 ); break;
- }
- int b = (int) (sinf(lastmillis / 200.0f) * 115.0f);
-- b = stack[sp] > 0 ? 100 : min(abs(b), 100);
-+ b = stack[sp] > 0 ? 100 : min(iabs(b), 100);
- glColor4ub(color.x, color.y, color.z, (a * b) / 100);
- }
- }
-diff -Naur a/source/src/tools.h b/source/src/tools.h
---- a/source/src/tools.h 2017-01-28 18:36:39.314498345 +0400
-+++ b/source/src/tools.h 2017-01-28 19:24:31.250788417 +0400
-@@ -56,6 +56,7 @@
- }
-
- template <typename T> inline T pow2(T x) { return x*x; }
-+inline int iabs(int n) { return labs(n); }
-
- #define clamp(x,minval,maxval) (max(minval, min(x, maxval)))
- #define rnd(x) ((int)(randomMT()&0xFFFFFF)%(x))
-diff -Naur a/source/src/world.cpp b/source/src/world.cpp
---- a/source/src/world.cpp 2017-01-28 18:36:39.314498345 +0400
-+++ b/source/src/world.cpp 2017-01-28 19:25:19.394371587 +0400
-@@ -79,8 +79,8 @@
- || abs(q->b - o[0]->b) > lighterr
- || q->ftex != o[0]->ftex
- || q->ctex != o[0]->ctex
-- || abs(q->r - o[0]->r) > lighterr // perfect mip even if light is not exactly equal
-- || abs(q->g - o[0]->g) > lighterr
-+ || iabs(q->r - o[0]->r) > lighterr // perfect mip even if light is not exactly equal
-+ || iabs(q->g - o[0]->g) > lighterr
- || q->utex != o[0]->utex) goto c;
- }
- if(r->type==CHF || r->type==FHF) // can make a perfect mip out of a hf if slopes lie on one line
-diff -Naur a/source/src/worldrender.cpp b/source/src/worldrender.cpp
---- a/source/src/worldrender.cpp 2017-01-28 18:36:39.314498345 +0400
-+++ b/source/src/worldrender.cpp 2017-01-28 19:26:36.448103569 +0400
-@@ -297,10 +297,10 @@
- void render_world(float vx, float vy, float vh, float changelod, int yaw, int pitch, float fov, float fovy, int w, int h)
- {
- loopi(LARGEST_FACTOR) stats[i] = 0;
-- min_lod = minimap || (player1->isspectating() && player1->spectatemode == SM_OVERVIEW) ? MAX_LOD : MIN_LOD+abs(pitch)/12;
-+ min_lod = minimap || (player1->isspectating() && player1->spectatemode == SM_OVERVIEW) ? MAX_LOD : MIN_LOD+iabs(pitch)/12;
- yaw = 360-yaw;
- float widef = fov/75.0f;
-- int cdist = abs(yaw%90-45);
-+ int cdist = iabs(yaw%90-45);
- if(cdist<7) // hack to avoid popup at high fovs at 45 yaw
- {
- min_lod = max(min_lod, (int)(MIN_LOD+(10-cdist)/1.0f*widef)); // less if lod worked better
diff --git a/actionfps-server b/actionfps-server
index 8aa24bba6c65..f9fadb6fd96e 100644
--- a/actionfps-server
+++ b/actionfps-server
@@ -1,4 +1,2 @@
-#!/bin/bash
-
-cd /usr/share/actionfps
-actionfps_server "$@"
+#!/usr/bin/env sh
+/usr/share/games/actionfps/server.sh "$@"
diff --git a/actionfps.desktop b/actionfps.desktop
index 0d9ce937de8b..9e408041273d 100644
--- a/actionfps.desktop
+++ b/actionfps.desktop
@@ -5,10 +5,10 @@ Icon=actionfps
Type=Application
Terminal=false
MultipleArgs=false
-Name=Actionfps
+Name=ActionFPS
GenericName=Realistic Multiplayer FPS
MimeType=text/html
StartupNotify=false
-Categories=Game;ActionGame;
+Categories=Game;ActionGame;Shooter;
Comment=A multiplayer, first-person shooter game, based on the CUBE engine. Fast, arcade gameplay.
MimeType=x-scheme-handler/actionfps
diff --git a/systemd-actionfps-server.service b/systemd-actionfps-server.service
new file mode 100644
index 000000000000..334ef83defa7
--- /dev/null
+++ b/systemd-actionfps-server.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=ActionFPS server.
+Requires=network-online.target
+After=network-online.target
+
+[Service]
+Type=simple
+User=actionfps
+
+ExecStart=actionfps-server
+
+ProtectHostname=true
+ProtectClock=true
+NoNewPrivileges=yes
+ProtectSystem=full
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd-actionfps-sysuser.conf b/systemd-actionfps-sysuser.conf
new file mode 100644
index 000000000000..79edc4e7da2d
--- /dev/null
+++ b/systemd-actionfps-sysuser.conf
@@ -0,0 +1,2 @@
+g actionfps - -
+u actionfps - "ActionFPS server user" /usr/bin/nologin