SHA256
1
0
forked from pool/bzflag

Accepting request 679282 from home:jmoellers:branches:games

OBS-URL: https://build.opensuse.org/request/show/679282
OBS-URL: https://build.opensuse.org/package/show/games/bzflag?expand=0&rev=24
This commit is contained in:
Dirk Stoecker 2019-03-25 15:33:56 +00:00 committed by Git OBS Bridge
parent ae474b5d1e
commit 55d55cd7d0
4 changed files with 54 additions and 16 deletions

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Tue Feb 26 15:02:29 UTC 2019 - josef.moellers@suse.com
- Replaced the sysv init script by a systemd unit file
Due to the complexity of the init script, the script is still
used to start/stop the server. Note that the init script
and the systemd unit file are not part of upstream!
[bsc#1115940, bzflagserver.service]
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Dec 21 15:38:17 UTC 2017 - bwiedemann@suse.com Thu Dec 21 15:38:17 UTC 2017 - bwiedemann@suse.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package bzflag # spec file for package bzflag
# #
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -28,13 +28,13 @@ Summary: 3D Networked Multiplayer Tank Battle Game
License: GPL-2.0+ License: GPL-2.0+
Group: Amusements/Games/3D/Shoot Group: Amusements/Games/3D/Shoot
Url: http://bzflag.org/ Url: http://bzflag.org/
#Source: https://github.com/BZFlag-Dev/bzflag/archive/v%{version}.tar.gz#/bzflag-%{version}.tar.gz
Source: https://download.bzflag.org/bzflag/source/%{version}/bzflag-%{version}.tar.gz Source: https://download.bzflag.org/bzflag/source/%{version}/bzflag-%{version}.tar.gz
Source2: rc.bzflagserver Source2: rc.bzflagserver
Source3: %{name}-maps.tar.bz2 Source3: %{name}-maps.tar.bz2
Source4: sysconfig.bzflagserver-bzflag Source4: sysconfig.bzflagserver-bzflag
Source5: %{name}.desktop Source5: %{name}.desktop
Source6: %{name}.png Source6: %{name}.png
Source7: bzflagserver.service
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines # PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch0: %{name}-1.10.4-ncursespollution.patch Patch0: %{name}-1.10.4-ncursespollution.patch
BuildRequires: bc BuildRequires: bc
@ -56,7 +56,6 @@ BuildRequires: pkgconfig(glew)
BuildRequires: zlib-devel BuildRequires: zlib-devel
%endif %endif
Requires(pre): %fillup_prereq Requires(pre): %fillup_prereq
Requires(pre): %insserv_prereq
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description %description
@ -71,6 +70,7 @@ Find server maps in /usr/share/bzflag/maps.
%setup -q -a 3 %setup -q -a 3
%patch0 -p1 %patch0 -p1
cp %{SOURCE2} . cp %{SOURCE2} .
cp %{SOURCE7} .
%build %build
%configure \ %configure \
@ -79,25 +79,28 @@ cp %{SOURCE2} .
--disable-static --disable-static
make %{?_smp_mflags} all make %{?_smp_mflags} all
%pre
%service_add_pre bzflagserver.service
%preun %preun
%stop_on_removal bzflagserver %service_del_preun bzflagserver.service
%post %post
%fillup_only -an bzflagserver %fillup_only -an bzflagserver
%service_add_post bzflagserver.service
%postun %postun
%restart_on_update bzflagserver %service_del_postun bzflagserver.service
%insserv_cleanup
%install %install
#Init script for the BZFlag server #Init script for the BZFlag server
install -D -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/init.d/bzflagserver mkdir -p %{buildroot}%{_datadir}/%{name}/scripts
mkdir -p %{buildroot}%{_sbindir} install -D -m 755 %{SOURCE2} %{buildroot}%{_datadir}/%{name}/scripts/rcbzflagserver
ln -s %{_sysconfdir}/init.d/bzflagserver %{buildroot}%{_sbindir}/rcbzflagserver install -D -m 644 %{SOURCE7} %{buildroot}%{_unitdir}/bzflagserver.service
make MKDIR_P="mkdir -p --" DESTDIR=%{buildroot} install make MKDIR_P="mkdir -p --" DESTDIR=%{buildroot} install
install -D -m 644 %{SOURCE4} %{buildroot}%{_fillupdir}/sysconfig.bzflagserver-bzflag install -D -m 644 %{SOURCE4} %{buildroot}%{_fillupdir}/sysconfig.bzflagserver-bzflag
mkdir -p %{buildroot}%{_datadir}/bzflag/maps mkdir -p %{buildroot}%{_datadir}/%{name}/maps
install -m 644 maps/*bzmap %{buildroot}%{_datadir}/bzflag/maps install -m 644 maps/*bzmap %{buildroot}%{_datadir}/%{name}/maps
install -D -m 644 %{SOURCE6} %{buildroot}%{_datadir}/pixmaps/bzflag.png install -D -m 644 %{SOURCE6} %{buildroot}%{_datadir}/pixmaps/bzflag.png
%suse_update_desktop_file -i %{name} %suse_update_desktop_file -i %{name}
%fdupes %{buildroot} %fdupes %{buildroot}
@ -106,10 +109,11 @@ install -D -m 644 %{SOURCE6} %{buildroot}%{_datadir}/pixmaps/bzflag.png
%defattr(-, root, root) %defattr(-, root, root)
%doc AUTHORS COPYING PORTING README DEVINFO %doc AUTHORS COPYING PORTING README DEVINFO
%doc README.Linux misc/bzfs.conf ChangeLog %doc README.Linux misc/bzfs.conf ChangeLog
%{_sysconfdir}/init.d/bzflagserver
%{_sbindir}/rcbzflagserver
%{_bindir}/*
%{_datadir}/%{name}/ %{_datadir}/%{name}/
%{_datadir}/%{name}/scripts/
%{_datadir}/bzflag/scripts/rcbzflagserver
%{_unitdir}/bzflagserver.service
%{_bindir}/*
%{_datadir}/applications/%{name}.desktop %{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png %{_datadir}/pixmaps/%{name}.png
%{_mandir}/man5/* %{_mandir}/man5/*

25
bzflagserver.service Normal file
View File

@ -0,0 +1,25 @@
# Automatically generated by systemd-sysv-generator
[Unit]
Documentation=http://bzflag.org/
SourcePath=/usr/share/bzflag/scripts/rcbzflagserver
Description=LSB: bzflag server daemon
After=remote-fs.target
Wants=remote-fs.target
Wants=syslog.socket
[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
SuccessExitStatus=5 6
ExecStart=/usr/share/bzflag/scripts/rcbzflagserver start
ExecStop=/usr/share/bzflag/scripts/rcbzflagserver stop
ExecReload=/usr/share/bzflag/scripts/rcbzflagserver reload
[Install]
WantedBy=multi-user.target

View File

@ -62,12 +62,12 @@ case "$1" in
if [ "$BZFLAGSERVER_SRVMSG" ] ; then if [ "$BZFLAGSERVER_SRVMSG" ] ; then
startproc -u nobody -g nobody $BZFLAGSERVER_BIN \ startproc -u nobody -g nobody $BZFLAGSERVER_BIN \
$BZFLAGSERVER_OPTS $PUBLIC -p "$BZFLAGSERVER_PORT" \ $BZFLAGSERVER_OPTS $PUBLIC -p "$BZFLAGSERVER_PORT" \
-world "/usr/share/games/bzflag/maps/$BZFLAGSERVER_WORLD" \ -world "/usr/share/bzflag/maps/$BZFLAGSERVER_WORLD" \
-srvmsg "$BZFLAGSERVER_SRVMSG" $HANDICAP -srvmsg "$BZFLAGSERVER_SRVMSG" $HANDICAP
else else
startproc -u nobody -g nobody $BZFLAGSERVER_BIN \ startproc -u nobody -g nobody $BZFLAGSERVER_BIN \
$BZFLAGSERVER_OPTS $PUBLIC -p "$BZFLAGSERVER_PORT" \ $BZFLAGSERVER_OPTS $PUBLIC -p "$BZFLAGSERVER_PORT" \
-world "/usr/share/games/bzflag/maps/$BZFLAGSERVER_WORLD" \ -world "/usr/share/bzflag/maps/$BZFLAGSERVER_WORLD" \
$HANDICAP $HANDICAP
fi fi
# Remember status and be verbose # Remember status and be verbose