From 1720a8375bbcbf504cb94b26905a2a3b2347e5c3 Mon Sep 17 00:00:00 2001 From: Jon Ciesla Date: Jun 28 2016 15:30:45 +0000 Subject: Add unit file. --- diff --git a/bzflag.service b/bzflag.service new file mode 100644 index 0000000..0e83211 --- /dev/null +++ b/bzflag.service @@ -0,0 +1,10 @@ +[Unit] +Description=BZFlag multi-player tank battle game server + +[Service] +Type=simple +EnvironmentFile=-/etc/sysconfig/bzflag +ExecStart=/usr/bin/bzfs $BZFLAG_OPTIONS + +[Install] +WantedBy=multi-user.target diff --git a/bzflag.spec b/bzflag.spec index 229d87b..62d8128 100644 --- a/bzflag.spec +++ b/bzflag.spec @@ -1,13 +1,14 @@ - Summary: 3D multi-player tank battle game Name: bzflag Version: 2.4.6 -Release: 1%{?dist} +Release: 2%{?dist} License: LGPLv2 Group: Amusements/Games URL: http://bzflag.org Source0: https://download.bzflag.org/bzflag/source/%{version}/bzflag-%{version}.tar.bz2 Source1: bzflag.desktop +Source2: bzflag.sysconfig +Source3: bzflag.service Patch0: bzflag-2.0.12-findresolutions.patch BuildRequires: libXxf86vm-devel BuildRequires: libXext-devel @@ -24,6 +25,7 @@ BuildRequires: libcurl-devel BuildRequires: c-ares-devel BuildRequires: zlib-devel BuildRequires: sed +BuildRequires: systemd Requires: opengl-games-utils %description @@ -106,6 +108,18 @@ SentUpstream: 2014-09-24 EOF +install -Dp -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/bzflag +install -Dp -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/bzflag.service + +%post +%systemd_post bzflag.service + +%preun +%systemd_preun bzflag.service + +%postun +%systemd_postun_with_restart bzflag.service + %files %defattr(-, root, root, 0755) %doc AUTHORS COPYING ChangeLog README README.Linux @@ -122,12 +136,17 @@ EOF %{_datadir}/pixmaps/bzflag.xpm %{_datadir}/pixmaps/bzflag.svg %{_mandir}/man*/* +%{_sysconfdir}/sysconfig/bzflag +%{_unitdir}/bzflag.service %files maps-sample %defattr(-, root, root, 0755) %{_datadir}/bzflag/maps/* %changelog +* Tue Jun 28 2016 Jon Ciesla - 2.4.6-2 +- Add unit file, BZ 198929. + * Tue Jun 28 2016 Jon Ciesla - 2.4.6-1 - 2.4.6. - Use SDL2. diff --git a/bzflag.sysconfig b/bzflag.sysconfig new file mode 100644 index 0000000..d3dab3f --- /dev/null +++ b/bzflag.sysconfig @@ -0,0 +1,8 @@ +# Configuration file for the BZFlag game server. + +# Be sure to open up port 5154 for both tcp and udp if you want +# to host internet games. + +# Command line options for the game server. See the bzfs(6) man page +# for a description of the valid options. +BZFLAG_OPTIONS="-a 50 38"