Advanced building
- makefiles; - customizable PREFIX; - tests; - other useful stuff.
This commit is contained in:
parent
5f2b6075ba
commit
75d79078e2
12
Makefile
12
Makefile
@ -29,20 +29,24 @@ RPMSDIR := $(WORKDIR)/RPMS
|
|||||||
SOURCESDIR := $(WORKDIR)/SOURCES
|
SOURCESDIR := $(WORKDIR)/SOURCES
|
||||||
SPECSDIR := $(WORKDIR)/SPECS
|
SPECSDIR := $(WORKDIR)/SPECS
|
||||||
SRPMSDIR := $(WORKDIR)/SRPMS
|
SRPMSDIR := $(WORKDIR)/SRPMS
|
||||||
SCRIPTSDIR := $(SOURCESDIR)/scripts
|
|
||||||
|
|
||||||
SPEC := $(SPECSDIR)/$(NAME).spec
|
SPEC := $(SPECSDIR)/$(NAME).spec
|
||||||
VERSION := $(shell grep -Fi 'Version:' $(SPEC) | awk '{ print $$2 }')
|
VERSION := $(shell grep -Fi 'Version:' $(SPEC) | awk '{ print $$2 }')
|
||||||
SOURCETARBALL := $(SOURCESDIR)/$(NAME)-$(VERSION).tar.gz
|
SOURCETARBALL := $(SOURCESDIR)/$(NAME)-$(VERSION).tar.gz
|
||||||
|
|
||||||
.PHONY: all prep rpm srpm activate check-activate clean-tmp clean-pkg clean
|
.PHONY: all prep rpm srpm activate active check-activate clean-tmp clean-pkg clean
|
||||||
|
|
||||||
all: check-activate prep
|
all: check-activate prep
|
||||||
rpmbuild -ba $(SPEC)
|
rpmbuild -ba $(SPEC)
|
||||||
$(MAKE) clean-tmp
|
$(MAKE) clean-tmp
|
||||||
|
|
||||||
prep: clean-tmp
|
prep: clean-tmp
|
||||||
tar czf $(SOURCETARBALL) -C $(SCRIPTSDIR) .
|
cd $(SOURCESDIR) && tar czf $(SOURCETARBALL) \
|
||||||
|
config \
|
||||||
|
force-attr \
|
||||||
|
main \
|
||||||
|
COPYING \
|
||||||
|
Makefile
|
||||||
|
|
||||||
rpm: check-activate prep
|
rpm: check-activate prep
|
||||||
rpmbuild -bb $(SPEC)
|
rpmbuild -bb $(SPEC)
|
||||||
@ -52,6 +56,8 @@ srpm: check-activate prep
|
|||||||
rpmbuild -bs $(SPEC)
|
rpmbuild -bs $(SPEC)
|
||||||
$(MAKE) clean-tmp
|
$(MAKE) clean-tmp
|
||||||
|
|
||||||
|
active: activate
|
||||||
|
|
||||||
activate:
|
activate:
|
||||||
ifeq ($(shell test -d $(RPMBUILDDIR); echo $$?), 0)
|
ifeq ($(shell test -d $(RPMBUILDDIR); echo $$?), 0)
|
||||||
mv -f $(RPMBUILDDIR) $(RPMBUILDDIR).old
|
mv -f $(RPMBUILDDIR) $(RPMBUILDDIR).old
|
||||||
|
145
SOURCES/Makefile
145
SOURCES/Makefile
@ -17,38 +17,56 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
BASH := /bin/bash
|
NAME := kf2-srv
|
||||||
|
|
||||||
NAME := kf2-srv
|
SOURCEDIR := .
|
||||||
|
RELEASEDIR := $(SOURCEDIR)/release
|
||||||
|
BUILDROOT =
|
||||||
|
PREFIX = /usr/local
|
||||||
|
|
||||||
SOURCEDIR := .
|
MAINLOGDIR = $(BUILDROOT)/var/log/$(NAME)
|
||||||
|
BETALOGDIR = $(BUILDROOT)/var/log/$(NAME)-beta
|
||||||
|
CONFDIR = $(BUILDROOT)/etc/$(NAME)
|
||||||
|
INSTMAINDIR = $(CONFDIR)/instances
|
||||||
|
INSTBETADIR = $(CONFDIR)/instances-beta
|
||||||
|
MAPCYCLEDIR = $(CONFDIR)/mapcycles
|
||||||
|
CACHEDIR = $(BUILDROOT)/var/cache/$(NAME)
|
||||||
|
LOGROTATEDIR = $(BUILDROOT)/etc/logrotate.d
|
||||||
|
RSYSLOGDIR = $(BUILDROOT)/etc/rsyslog.d
|
||||||
|
UNITDIR = $(if $(BUILDROOT),$(BUILDROOT)/usr/lib/systemd/system,/etc/systemd/system)
|
||||||
|
FIREWALLDDIR = $(if $(BUILDROOT),$(BUILDROOT)/usr/lib/firewalld/services,/etc/firewalld/services)
|
||||||
|
BINDIR = $(BUILDROOT)$(PREFIX)/bin
|
||||||
|
SBINDIR = $(BUILDROOT)$(PREFIX)/sbin
|
||||||
|
GAMEDIR = $(BUILDROOT)$(PREFIX)/games
|
||||||
|
DATADIR = $(BUILDROOT)$(PREFIX)/share
|
||||||
|
LICENSEDIR = $(DATADIR)/licenses/$(NAME)
|
||||||
|
KF2MAINDIR = $(GAMEDIR)/$(NAME)
|
||||||
|
KF2BETADIR = $(GAMEDIR)/$(NAME)-beta
|
||||||
|
|
||||||
MAINLOGDIR := /var/log/$(NAME)
|
BASHCHECK := bash -n
|
||||||
BETALOGDIR := /var/log/$(NAME)-beta
|
SYSTEMDCHECK := systemd-analyze verify
|
||||||
CONFDIR := /etc/$(NAME)
|
LOGROTATECHECK := logrotate -d
|
||||||
INSTMAINDIR := $(CONFDIR)/instances
|
XMLCHECK := xmllint --noout
|
||||||
INSTBETADIR := $(CONFDIR)/instances-beta
|
|
||||||
MAPCYCLEDIR := $(CONFDIR)/mapcycles
|
|
||||||
CACHEDIR := /var/cache/$(NAME)
|
|
||||||
LOGROTATEDIR := /etc/logrotate.d
|
|
||||||
RSYSLOGDIR := /etc/rsyslog.d
|
|
||||||
SERVICEDIR = $(if $(BUILDROOT),/lib/systemd/system,/etc/systemd/system)
|
|
||||||
FIREWALLDDIR = $(if $(BUILDROOT),/lib/firewalld/services,/etc/firewalld/services)
|
|
||||||
|
|
||||||
BUILDROOT =
|
.PHONY: build fake-systemd-build install uninstall filesystem test clean all
|
||||||
PREFIX = /usr/local
|
|
||||||
BINDIR = $(BUILDROOT)$(PREFIX)/bin
|
|
||||||
SBINDIR = $(BUILDROOT)$(PREFIX)/sbin
|
|
||||||
GAMEDIR = $(BUILDROOT)$(PREFIX)/games
|
|
||||||
DATADIR = $(BUILDROOT)$(PREFIX)/share
|
|
||||||
LICENSEDIR = $(DATADIR)/licenses/$(NAME)
|
|
||||||
KF2MAINDIR = $(GAMEDIR)/$(NAME)
|
|
||||||
KF2BETADIR = $(GAMEDIR)/$(NAME)-beta
|
|
||||||
|
|
||||||
.PHONY: all install uninstall filesystem
|
|
||||||
|
|
||||||
all: install
|
all: install
|
||||||
|
|
||||||
|
build:
|
||||||
|
mkdir $(RELEASEDIR)
|
||||||
|
|
||||||
|
cp -r $(SOURCEDIR)/main $(RELEASEDIR)
|
||||||
|
cp -r $(SOURCEDIR)/config $(RELEASEDIR)
|
||||||
|
cp -r $(SOURCEDIR)/force-attr $(RELEASEDIR)
|
||||||
|
|
||||||
|
find $(RELEASEDIR) -type f -exec sed -i 's|:DEFINE_PREFIX:|$(PREFIX)|g;' {} \;
|
||||||
|
|
||||||
|
fake-systemd-build:
|
||||||
|
find $(SOURCEDIR)/main -type f -name '*.service' -exec cp -f {} $(RELEASEDIR)/{} \;
|
||||||
|
find $(SOURCEDIR)/force-attr -type f -name '*.service' -exec cp -f {} $(RELEASEDIR)/{} \;
|
||||||
|
find $(RELEASEDIR) -type f -exec sed -i 's|:DEFINE_PREFIX:|$(BUILDROOT)$(PREFIX)|g;' {} \;
|
||||||
|
find $(RELEASEDIR) -type f -exec sed -i -r 's|ExecStart=.+KFGameSteamServer.bin.x86_64|ExecStart=/bin/bash|g;' {} \;
|
||||||
|
|
||||||
filesystem:
|
filesystem:
|
||||||
test -d '$(CONFDIR)' || install -m 775 -d '$(CONFDIR)'
|
test -d '$(CONFDIR)' || install -m 775 -d '$(CONFDIR)'
|
||||||
test -d '$(INSTMAINDIR)' || install -m 775 -d '$(INSTMAINDIR)'
|
test -d '$(INSTMAINDIR)' || install -m 775 -d '$(INSTMAINDIR)'
|
||||||
@ -62,60 +80,77 @@ filesystem:
|
|||||||
test -d '$(LICENSEDIR)' || install -m 755 -d '$(LICENSEDIR)'
|
test -d '$(LICENSEDIR)' || install -m 755 -d '$(LICENSEDIR)'
|
||||||
test -d '$(MAINLOGDIR)' || install -m 770 -d '$(MAINLOGDIR)'
|
test -d '$(MAINLOGDIR)' || install -m 770 -d '$(MAINLOGDIR)'
|
||||||
test -d '$(BETALOGDIR)' || install -m 770 -d '$(BETALOGDIR)'
|
test -d '$(BETALOGDIR)' || install -m 770 -d '$(BETALOGDIR)'
|
||||||
test -d '$(SERVICEDIR)' || install -m 755 -d '$(SERVICEDIR)'
|
test -d '$(UNITDIR)' || install -m 755 -d '$(UNITDIR)'
|
||||||
test -d '$(FIREWALLDDIR)' || install -m 755 -d '$(FIREWALLDDIR)'
|
test -d '$(FIREWALLDDIR)' || install -m 755 -d '$(FIREWALLDDIR)'
|
||||||
test -d '$(LOGROTATEDIR)' || install -m 755 -d '$(LOGROTATEDIR)'
|
test -d '$(LOGROTATEDIR)' || install -m 755 -d '$(LOGROTATEDIR)'
|
||||||
test -d '$(RSYSLOGDIR)' || install -m 755 -d '$(RSYSLOGDIR)'
|
test -d '$(RSYSLOGDIR)' || install -m 755 -d '$(RSYSLOGDIR)'
|
||||||
|
|
||||||
install: filesystem
|
install: filesystem build
|
||||||
install -m 755 $(SOURCEDIR)/main/$(NAME) $(BINDIR)
|
install -m 755 $(RELEASEDIR)/main/$(NAME) $(BINDIR)
|
||||||
install -m 755 $(SOURCEDIR)/main/$(NAME)-beta $(BINDIR)
|
install -m 755 $(RELEASEDIR)/main/$(NAME)-beta $(BINDIR)
|
||||||
|
|
||||||
install -m 644 $(SOURCEDIR)/main/systemd/$(NAME)@.service $(SERVICEDIR)
|
install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)@.service $(UNITDIR)
|
||||||
install -m 644 $(SOURCEDIR)/main/systemd/$(NAME)-beta@.service $(SERVICEDIR)
|
install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)-beta@.service $(UNITDIR)
|
||||||
install -m 644 $(SOURCEDIR)/main/systemd/$(NAME)-beta-update.service $(SERVICEDIR)
|
install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)-beta-update.service $(UNITDIR)
|
||||||
install -m 644 $(SOURCEDIR)/main/systemd/$(NAME)-beta-update.timer $(SERVICEDIR)
|
install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)-beta-update.timer $(UNITDIR)
|
||||||
install -m 644 $(SOURCEDIR)/main/systemd/$(NAME)-update.service $(SERVICEDIR)
|
install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)-update.service $(UNITDIR)
|
||||||
install -m 644 $(SOURCEDIR)/main/systemd/$(NAME)-update.timer $(SERVICEDIR)
|
install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)-update.timer $(UNITDIR)
|
||||||
|
|
||||||
install -m 644 $(SOURCESIR)/main/firewalld/$(NAME).xml $(FIREWALLDDIR)
|
install -m 644 $(RELEASEDIR)/main/firewalld/$(NAME).xml $(FIREWALLDDIR)
|
||||||
install -m 644 $(SOURCESIR)/main/logrotate/$(NAME) $(LOGROTATEDIR)
|
install -m 644 $(RELEASEDIR)/main/logrotate/$(NAME) $(LOGROTATEDIR)
|
||||||
install -m 644 $(SOURCESIR)/main/rsyslog/$(NAME).conf $(RSYSLOGDIR)
|
install -m 644 $(RELEASEDIR)/main/rsyslog/$(NAME).conf $(RSYSLOGDIR)
|
||||||
|
|
||||||
install -m 755 $(SOURCEDIR)/force-attr/$(NAME)-force-attr $(SBINDIR)
|
install -m 755 $(RELEASEDIR)/force-attr/$(NAME)-force-attr $(SBINDIR)
|
||||||
install -m 755 $(SOURCEDIR)/force-attr/systemd/$(NAME)-force-attr.service $(SERVICEDIR)
|
install -m 644 $(RELEASEDIR)/force-attr/systemd/$(NAME)-force-attr.service $(UNITDIR)
|
||||||
|
|
||||||
install -m 644 $(SOURCEDIR)/conf/bot.conf $(CONFDIR)
|
install -m 640 $(RELEASEDIR)/config/bot.conf $(CONFDIR)
|
||||||
install -m 644 $(SOURCEDIR)/conf/instance.conf.template $(CONFDIR)
|
install -m 644 $(RELEASEDIR)/config/instance.conf.template $(CONFDIR)
|
||||||
install -m 644 $(SOURCEDIR)/conf/$(NAME).conf $(CONFDIR)
|
install -m 644 $(RELEASEDIR)/config/$(NAME).conf $(CONFDIR)
|
||||||
|
|
||||||
install -m 644 $(SOURCEDIR)/COPYING $(LICENSEDIR)
|
install -m 644 $(SOURCEDIR)/COPYING $(LICENSEDIR)
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f $(BINDIR)/$(NAME)
|
rm -f $(BINDIR)/$(NAME)
|
||||||
rm -f $(BINDIR)/$(NAME)-beta
|
rm -f $(BINDIR)/$(NAME)-beta
|
||||||
|
|
||||||
rm -f $(SERVICEDIR)/$(NAME)@.service
|
rm -f $(UNITDIR)/$(NAME)@.service
|
||||||
rm -f $(SERVICEDIR)/$(NAME)-beta@.service
|
rm -f $(UNITDIR)/$(NAME)-beta@.service
|
||||||
rm -f $(SERVICEDIR)/$(NAME)-beta-update.service
|
rm -f $(UNITDIR)/$(NAME)-beta-update.service
|
||||||
rm -f $(SERVICEDIR)/$(NAME)-beta-update.timer
|
rm -f $(UNITDIR)/$(NAME)-beta-update.timer
|
||||||
rm -f $(SERVICEDIR)/$(NAME)-update.service
|
rm -f $(UNITDIR)/$(NAME)-update.service
|
||||||
rm -f $(SERVICEDIR)/$(NAME)-update.timer
|
rm -f $(UNITDIR)/$(NAME)-update.timer
|
||||||
|
|
||||||
rm -f $(FIREWALLDDIR)/$(NAME).xml
|
rm -f $(FIREWALLDDIR)/$(NAME).xml
|
||||||
rm -f $(LOGROTATEDIR)/$(NAME)
|
rm -f $(LOGROTATEDIR)/$(NAME)
|
||||||
rm -f $(RSYSLOGDIR)/$(NAME).conf
|
rm -f $(RSYSLOGDIR)/$(NAME).conf
|
||||||
|
|
||||||
rm -f $(SBINDIR)/$(NAME)-force-attr
|
rm -f $(SBINDIR)/$(NAME)-force-attr
|
||||||
rm -f $(SERVICEDIR)/$(NAME)-force-attr.service
|
rm -f $(UNITDIR)/$(NAME)-force-attr.service
|
||||||
|
|
||||||
rm -rf $(LICENSEDIR)
|
rm -rf $(LICENSEDIR)
|
||||||
rm -rf $(KF2MAINDIR)
|
rm -rf $(KF2MAINDIR)
|
||||||
rm -rf $(KF2BETADIR)
|
rm -rf $(KF2BETADIR)
|
||||||
rm -rf $(CACHEDIR)
|
rm -rf $(CACHEDIR)
|
||||||
|
|
||||||
test:
|
test: fake-systemd-build
|
||||||
$(BASH) -n $(BINDIR)/$(NAME)
|
ifeq ($(shell $(LOGROTATECHECK) $(RELEASEDIR)/main/logrotate/$(NAME) 2>&1 | grep -qi 'error'; echo $$?), 0)
|
||||||
$(BASH) -n $(BINDIR)/$(NAME)-beta
|
$(LOGROTATECHECK) $(RELEASEDIR)/main/logrotate/$(NAME)
|
||||||
$(BASH) -n $(SBINDIR)/$(NAME)-force-attr
|
endif
|
||||||
|
|
||||||
|
$(XMLCHECK) $(RELEASEDIR)/main/firewalld/$(NAME).xml
|
||||||
|
|
||||||
|
$(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)@.service
|
||||||
|
$(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)-beta@.service
|
||||||
|
$(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)-beta-update.service
|
||||||
|
$(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)-beta-update.timer
|
||||||
|
$(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)-update.service
|
||||||
|
$(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)-update.timer
|
||||||
|
$(SYSTEMDCHECK) $(RELEASEDIR)/force-attr/systemd/$(NAME)-force-attr.service
|
||||||
|
|
||||||
|
$(BASHCHECK) $(RELEASEDIR)/main/$(NAME)
|
||||||
|
$(BASHCHECK) $(RELEASEDIR)/main/$(NAME)-beta
|
||||||
|
$(BASHCHECK) $(RELEASEDIR)/force-attr/$(NAME)-force-attr
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(RELEASEDIR)
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
declare -A ModeNames MutNames
|
declare -A ModeNames MutNames
|
||||||
|
|
||||||
source /etc/kf2-srv/kf2-srv.conf
|
source "/etc/kf2-srv/kf2-srv.conf"
|
||||||
|
|
||||||
DirLog="/var/log/kf2-srv"
|
DirLog="/var/log/kf2-srv"
|
||||||
DirLogBeta="/var/log/kf2-srv-beta"
|
DirLogBeta="/var/log/kf2-srv-beta"
|
||||||
|
@ -5,7 +5,7 @@ Description=kf2-srv force attr service
|
|||||||
Type=simple
|
Type=simple
|
||||||
StandardOutput=null
|
StandardOutput=null
|
||||||
StandardError=null
|
StandardError=null
|
||||||
ExecStart=/usr/sbin/kf2-srv-force-attr
|
ExecStart=:DEFINE_PREFIX:/sbin/kf2-srv-force-attr
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
||||||
NoNewPrivileges=yes
|
NoNewPrivileges=yes
|
||||||
|
@ -446,9 +446,9 @@ function fix_steamclient_so ()
|
|||||||
rm -f "$InstallDir/linux64/steamclient.so"
|
rm -f "$InstallDir/linux64/steamclient.so"
|
||||||
rm -f "$InstallDir/steamclient.so"
|
rm -f "$InstallDir/steamclient.so"
|
||||||
rm -f "$InstallDir/Binaries/Win64/lib64/steamclient.so"
|
rm -f "$InstallDir/Binaries/Win64/lib64/steamclient.so"
|
||||||
ln -s "/usr/share/steamcmd/linux64/steamclient.so" "$InstallDir/linux64/steamclient.so"
|
ln -s "/usr/games/steamcmd/linux64/steamclient.so" "$InstallDir/linux64/steamclient.so"
|
||||||
ln -s "/usr/share/steamcmd/linux64/steamclient.so" "$InstallDir/steamclient.so"
|
ln -s "/usr/games/steamcmd/linux64/steamclient.so" "$InstallDir/steamclient.so"
|
||||||
ln -s "/usr/share/steamcmd/linux64/steamclient.so" "$InstallDir/Binaries/Win64/lib64/steamclient.so"
|
ln -s "/usr/games/steamcmd/linux64/steamclient.so" "$InstallDir/Binaries/Win64/lib64/steamclient.so"
|
||||||
}
|
}
|
||||||
|
|
||||||
function create_cache ()
|
function create_cache ()
|
||||||
@ -1234,7 +1234,7 @@ if [[ "$1" == "beta" ]]; then
|
|||||||
BetaPostfix="-beta"; shift
|
BetaPostfix="-beta"; shift
|
||||||
fi
|
fi
|
||||||
|
|
||||||
InstallDir="/usr/games/kf2-srv$BetaPostfix"
|
InstallDir=":DEFINE_PREFIX:/games/kf2-srv$BetaPostfix"
|
||||||
AppBin="$InstallDir/Binaries/Win64/KFGameSteamServer.bin.x86_64"
|
AppBin="$InstallDir/Binaries/Win64/KFGameSteamServer.bin.x86_64"
|
||||||
|
|
||||||
DefaultConfigDir="$InstallDir/KFGame/Config"
|
DefaultConfigDir="$InstallDir/KFGame/Config"
|
||||||
|
@ -19,4 +19,4 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
/usr/bin/kf2-srv beta $*
|
":DEFINE_PREFIX:/bin/kf2-srv" beta $*
|
||||||
|
@ -6,20 +6,20 @@ Requires=network-online.target
|
|||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
|
||||||
ExecStart=/usr/bin/kf2-srv-beta --chat 'Scheduled server restart at 4:00 (MSK)'
|
ExecStart=:DEFINE_PREFIX:/bin/kf2-srv-beta --chat '.'
|
||||||
ExecStart=/usr/bin/kf2-srv-beta --chat 'Server will restart after 30 minutes'
|
ExecStart=:DEFINE_PREFIX:/bin/kf2-srv-beta --chat 'Server will restart after 30 minutes'
|
||||||
ExecStart=/bin/sleep 15m
|
ExecStart=/bin/sleep 15m
|
||||||
|
|
||||||
ExecStart=/usr/bin/kf2-srv-beta --chat 'Server will restart after 15 minutes'
|
ExecStart=:DEFINE_PREFIX:/bin/kf2-srv-beta --chat 'Server will restart after 15 minutes'
|
||||||
ExecStart=/bin/sleep 10m
|
ExecStart=/bin/sleep 10m
|
||||||
|
|
||||||
ExecStart=/usr/bin/kf2-srv-beta --chat 'Server will restart after 5 minutes'
|
ExecStart=:DEFINE_PREFIX:/bin/kf2-srv-beta --chat 'Server will restart after 5 minutes'
|
||||||
ExecStart=/bin/sleep 5m
|
ExecStart=/bin/sleep 5m
|
||||||
|
|
||||||
ExecStart=/usr/bin/kf2-srv-beta --chat 'Server shutting down...'
|
ExecStart=:DEFINE_PREFIX:/bin/kf2-srv-beta --chat 'Server shutting down...'
|
||||||
ExecStart=/bin/sleep 5s
|
ExecStart=/bin/sleep 5s
|
||||||
|
|
||||||
ExecStart=/usr/bin/kf2-srv-beta --update
|
ExecStart=:DEFINE_PREFIX:/bin/kf2-srv-beta --update
|
||||||
|
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
PrivateDevices=true
|
PrivateDevices=true
|
||||||
|
@ -12,7 +12,7 @@ StandardOutput=syslog
|
|||||||
StandardError=syslog
|
StandardError=syslog
|
||||||
SyslogIdentifier=kf2-srv-beta/%i
|
SyslogIdentifier=kf2-srv-beta/%i
|
||||||
EnvironmentFile=/etc/kf2-srv/instances-beta/%i/instance.conf
|
EnvironmentFile=/etc/kf2-srv/instances-beta/%i/instance.conf
|
||||||
ExecStart=/usr/games/kf2-srv-beta/Binaries/Win64/KFGameSteamServer.bin.x86_64 ${Map}?Difficulty=${Difficulty}?GameLength=${Length}?Game=${Game}?Mutator=${Mutators}?${Args} configsubdir=instances/%i -webadminport=${PortWeb} -queryport=${PortQuery} -port=${PortGame}
|
ExecStart=:DEFINE_PREFIX:/games/kf2-srv-beta/Binaries/Win64/KFGameSteamServer.bin.x86_64 ${Map}?Difficulty=${Difficulty}?GameLength=${Length}?Game=${Game}?Mutator=${Mutators}?${Args} configsubdir=instances/%i -webadminport=${PortWeb} -queryport=${PortQuery} -port=${PortGame}
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
||||||
NoNewPrivileges=yes
|
NoNewPrivileges=yes
|
||||||
|
@ -6,20 +6,20 @@ Requires=network-online.target
|
|||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
|
||||||
ExecStart=/usr/bin/kf2-srv --chat 'Scheduled server restart at 4:00 (MSK)'
|
ExecStart=:DEFINE_PREFIX:/bin/kf2-srv --chat '.'
|
||||||
ExecStart=/usr/bin/kf2-srv --chat 'Server will restart after 30 minutes'
|
ExecStart=:DEFINE_PREFIX:/bin/kf2-srv --chat 'Server will restart after 30 minutes'
|
||||||
ExecStart=/bin/sleep 15m
|
ExecStart=/bin/sleep 15m
|
||||||
|
|
||||||
ExecStart=/usr/bin/kf2-srv --chat 'Server will restart after 15 minutes'
|
ExecStart=:DEFINE_PREFIX:/bin/kf2-srv --chat 'Server will restart after 15 minutes'
|
||||||
ExecStart=/bin/sleep 10m
|
ExecStart=/bin/sleep 10m
|
||||||
|
|
||||||
ExecStart=/usr/bin/kf2-srv --chat 'Server will restart after 5 minutes'
|
ExecStart=:DEFINE_PREFIX:/bin/kf2-srv --chat 'Server will restart after 5 minutes'
|
||||||
ExecStart=/bin/sleep 5m
|
ExecStart=/bin/sleep 5m
|
||||||
|
|
||||||
ExecStart=/usr/bin/kf2-srv --chat 'Server shutting down...'
|
ExecStart=:DEFINE_PREFIX:/bin/kf2-srv --chat 'Server shutting down...'
|
||||||
ExecStart=/bin/sleep 5s
|
ExecStart=/bin/sleep 5s
|
||||||
|
|
||||||
ExecStart=/usr/bin/kf2-srv --update
|
ExecStart=:DEFINE_PREFIX:/bin/kf2-srv --update
|
||||||
|
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
PrivateDevices=true
|
PrivateDevices=true
|
||||||
|
@ -12,7 +12,7 @@ StandardOutput=syslog
|
|||||||
StandardError=syslog
|
StandardError=syslog
|
||||||
SyslogIdentifier=kf2-srv/%i
|
SyslogIdentifier=kf2-srv/%i
|
||||||
EnvironmentFile=/etc/kf2-srv/instances/%i/instance.conf
|
EnvironmentFile=/etc/kf2-srv/instances/%i/instance.conf
|
||||||
ExecStart=/usr/games/kf2-srv/Binaries/Win64/KFGameSteamServer.bin.x86_64 ${Map}?Difficulty=${Difficulty}?GameLength=${Length}?Game=${Game}?Mutator=${Mutators}?${Args} configsubdir=instances/%i -webadminport=${PortWeb} -queryport=${PortQuery} -port=${PortGame}
|
ExecStart=:DEFINE_PREFIX:/games/kf2-srv/Binaries/Win64/KFGameSteamServer.bin.x86_64 ${Map}?Difficulty=${Difficulty}?GameLength=${Length}?Game=${Game}?Mutator=${Mutators}?${Args} configsubdir=instances/%i -webadminport=${PortWeb} -queryport=${PortQuery} -port=${PortGame}
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
||||||
NoNewPrivileges=yes
|
NoNewPrivileges=yes
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
%global steamuser steam
|
%global steamuser steam
|
||||||
|
|
||||||
Name: kf2-srv
|
Name: kf2-srv
|
||||||
Version: 0.13.0
|
Version: 0.14.0
|
||||||
Release: 1%{dist}
|
Release: 1%{dist}
|
||||||
Summary: Killing Floor 2 server
|
Summary: Killing Floor 2 server
|
||||||
Group: Amusements/Games
|
Group: Amusements/Games
|
||||||
@ -11,7 +11,7 @@ BuildArch: noarch
|
|||||||
Source0: %{name}-%{version}.tar.gz
|
Source0: %{name}-%{version}.tar.gz
|
||||||
|
|
||||||
Requires: systemd >= 219
|
Requires: systemd >= 219
|
||||||
Requires: steamcmd
|
Requires: steamcmd >= 2018.01.05-5
|
||||||
Requires: libxml2
|
Requires: libxml2
|
||||||
Requires: dos2unix
|
Requires: dos2unix
|
||||||
Requires: curl
|
Requires: curl
|
||||||
@ -40,10 +40,10 @@ Command line tool for managing a set of Killing Floor 2 servers.
|
|||||||
%install
|
%install
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
make install PREFIX=%{buildroot}/%{_prefix}
|
make install BUILDROOT=%{buildroot} PREFIX=%{_prefix}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
make test PREFIX=%{buildroot}/%{_prefix}
|
make test BUILDROOT=%{buildroot} PREFIX=%{_prefix}
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
@ -65,7 +65,7 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%attr(0755,root,root) %{_bindir}/%{name}
|
%attr(0755,root,root) %{_bindir}/%{name}
|
||||||
%attr(0755,root,root) %{_bindir}/%{name}-beta
|
%attr(0755,root,root) %{_bindir}/%{name}-beta
|
||||||
%attr(0755,root,root) %{_sbindir}/%{name}-force-attr
|
%attr(0755,root,root) %{_sbindir}/%{name}-force-attr
|
||||||
%attr(0644,root,root) %{_prefix}/lib/systemd/system/*
|
%attr(0644,root,root) %{_unitdir}/*
|
||||||
%attr(0644,root,root) %doc %{_datadir}/licenses/%{name}/*
|
%attr(0644,root,root) %doc %{_datadir}/licenses/%{name}/*
|
||||||
%attr(0644,root,root) %{_sysconfdir}/rsyslog.d/%{name}.conf
|
%attr(0644,root,root) %{_sysconfdir}/rsyslog.d/%{name}.conf
|
||||||
%attr(0644,root,root) %{_sysconfdir}/logrotate.d/%{name}
|
%attr(0644,root,root) %{_sysconfdir}/logrotate.d/%{name}
|
||||||
|
Loading…
Reference in New Issue
Block a user