[xpilot-ng] Fix a crash in the welcome screen (rhbz#830640)

Hans de Goede jwrdegoede at fedoraproject.org
Sun Jul 29 14:47:29 UTC 2012


commit 5d18481d413cfaee22767ace51f52eb386e0851a
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Sun Jul 29 16:52:37 2012 +0200

    Fix a crash in the welcome screen (rhbz#830640)
    
    - Upgrade to latest upstream 4.7.3
    - Drop selinux module, it no longer compiles and selinux support belongs
      in selinux-policy*, not in the apps themselves
    - Replace sysv init script by a systemd unit file

 .gitignore                       |    1 +
 sources                          |    2 +-
 xpilot-ng-4.7.2-getline.patch    |   84 -------------------
 xpilot-ng-4.7.2-rhbz830640.patch |   12 +++
 xpilot-ng-server.init            |  102 -----------------------
 xpilot-ng-server.service         |   11 +++
 xpilot-ng.spec                   |  164 ++++++++++---------------------------
 xpilot-ng.sysconfig              |    5 +-
 xpilotd.fc                       |    7 --
 xpilotd.if                       |   24 ------
 xpilotd.te                       |   75 -----------------
 11 files changed, 71 insertions(+), 416 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 1e4820a..d1733ec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 xpilot-ng-4.7.2.tar.gz
+/xpilot-ng-4.7.3.tar.gz
diff --git a/sources b/sources
index f37f679..b7dcfda 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-b922251ab9c69f87567c9606304ee589  xpilot-ng-4.7.2.tar.gz
+89a360747f7811a33c4821eec5583b7d  xpilot-ng-4.7.3.tar.gz
diff --git a/xpilot-ng-4.7.2-rhbz830640.patch b/xpilot-ng-4.7.2-rhbz830640.patch
new file mode 100644
index 0000000..9c2ba3d
--- /dev/null
+++ b/xpilot-ng-4.7.2-rhbz830640.patch
@@ -0,0 +1,12 @@
+diff -up xpilot-ng-4.7.2/src/client/meta.h~ xpilot-ng-4.7.2/src/client/meta.h
+--- xpilot-ng-4.7.2/src/client/meta.h~	2005-01-04 22:38:12.000000000 +0100
++++ xpilot-ng-4.7.2/src/client/meta.h	2012-07-29 15:50:53.137403386 +0200
+@@ -72,7 +72,7 @@ struct ServerInfo {
+ 	*playlist,
+ 	*sound,
+ 	*teambases_str,
+-	*timing, *ip_str, *freebases, *queue_str, *domain, pingtime_str[5];
++	*timing, *ip_str, *freebases, *queue_str, *domain, pingtime_str[11];
+     unsigned port,
+ 	ip, users, bases, fps, uptime, teambases, queue, pingtime;
+     struct timeval start;
diff --git a/xpilot-ng-server.service b/xpilot-ng-server.service
new file mode 100644
index 0000000..cbc973a
--- /dev/null
+++ b/xpilot-ng-server.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=xpilot-ng-server supports playing networked multi-player games
+After=network.target
+
+[Service]
+Type=simple
+EnvironmentFile=/etc/sysconfig/xpilot-ng-server.conf
+ExecStart=/usr/bin/xpilot-ng-server $XPILOTD_OPTIONS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/xpilot-ng.spec b/xpilot-ng.spec
index 7af44b8..990f5d4 100644
--- a/xpilot-ng.spec
+++ b/xpilot-ng.spec
@@ -1,13 +1,10 @@
-%define selinux_variants targeted
-%define selinux_policyver %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp)
-
 %define logwatch_root %{_datadir}/logwatch
 %define logwatch_conf %{logwatch_root}/dist.conf
 %define logwatch_scripts %{logwatch_root}/scripts
 
 Name:           xpilot-ng
-Version:        4.7.2
-Release:        22%{?dist}
+Version:        4.7.3
+Release:        1%{?dist}
 Summary:        Multiplayer space arcade game
 
 Group:          Amusements/Games
@@ -17,24 +14,19 @@ Source0:        http://downloads.sourceforge.net/sourceforge/xpilot/xpilot-ng-%{
 Source1:        xpilot-ng.png
 Source2:        xpilot-ng-x11.desktop
 Source3:        xpilot-ng-sdl.desktop
-Source4:        xpilot-ng-server.init
+Source4:        xpilot-ng-server.service
 Source5:        xpilot-ng.sysconfig
 Source6:        xpilot-ng.logrotate
-Source7:        xpilotd.te
-Source8:        xpilotd.fc
-Source9:        xpilotd.if
 Source10:       logwatch.logconf.xpilot
 Source11:       logwatch.script.xpilot
 Source12:       logwatch.serviceconf.xpilot
 Source13:       logwatch.shared.applyxpilotdate
 Patch0:         xpilot-ng-4.7.2-scoreassert.patch
-Patch1:         xpilot-ng-4.7.2-getline.patch
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Patch1:         xpilot-ng-4.7.2-rhbz830640.patch
 
 BuildRequires:  desktop-file-utils
 BuildRequires:  expat-devel SDL_ttf-devel SDL_image-devel zlib-devel
 BuildRequires:  libXt-devel libGLU-devel libXxf86misc-devel
-BuildRequires:  selinux-policy-devel hardlink checkpolicy
 Requires:       dejavu-sans-fonts
 
 %description
@@ -43,33 +35,23 @@ arcade game.  You pilot a spaceship around space, dodging
 obstacles, shooting players and bots, collecting power-ups, and
 causing general mayhem.
 
+
 %package server
 Summary: Server for hosting xpilot games
 Group: Amusements/Games
 Requires(pre): shadow-utils
-Requires(post): /sbin/chkconfig
-Requires(post): /sbin/service
-Requires(preun): /sbin/chkconfig
-Requires(preun): /sbin/service
-Requires(postun): /sbin/service
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+# Make sure the old no longer supported selinux policy from 4.7.2 gets removed
+Obsoletes: %{name}-selinux < %{version}
+
 %description server
 The xpilot server.  This allows you to host xpilot games on your
 computer and develop new xpilot maps.  This is required if you
 are playing alone, but not required if you are joining one of the
 public xpilot games hosted on the internet.
 
-%package selinux
-Summary: SELinux policy files for the xpilot-ng game server
-Group: Amusements/Games
-Requires: %{name}-server = %{version}-%{release}
-%if "%{selinux_policyver}" != ""
-Requires:       selinux-policy >= %{selinux_policyver}
-%endif
-Requires(post):         /usr/sbin/semodule /usr/sbin/semanage /sbin/fixfiles
-Requires(preun):        /sbin/service /usr/sbin/semodule /usr/sbin/semanage /sbin/fixfiles /usr/sbin/setsebool
-Requires(postun):       /usr/sbin/semodule
-%description selinux
-SELinux policy files for the xpilot-ng game server
 
 %package logwatch
 Summary: logwatch scripts for the xpilot game server
@@ -78,6 +60,7 @@ Requires: %{name}-server = %{version}-%{release} logwatch
 %description logwatch
 logwatch scripts for the Xpilot game server
 
+
 %prep
 %setup -q
 %patch0
@@ -89,44 +72,30 @@ iconv --from=ISO-8859-1 --to=UTF-8 xpilot-ng-x11.man > xpilot-ng-x11.man.new
 mv xpilot-ng-x11.man.new xpilot-ng-x11.man
 popd
 
-mkdir SELinux
-cp  %{SOURCE7} %{SOURCE8} %{SOURCE9} SELinux/
 
 %build
-CFLAGS="$RPM_OPT_FLAGS" %configure
+%configure
 make %{?_smp_mflags}
 
-# Build the selinux policy file
-pushd SELinux
-for variant in %{selinux_variants}
-do
-    make NAME=${variant} -f %{_datadir}/selinux/devel/Makefile
-    mv xpilotd.pp xpilotd.pp.${variant}
-    make NAME=${variant} -f %{_datadir}/selinux/devel/Makefile clean
-done
-popd
 
 %install
-rm -rf $RPM_BUILD_ROOT
 make install DESTDIR=$RPM_BUILD_ROOT
 
 chmod a+x $RPM_BUILD_ROOT/%{_datadir}/%{name}/mapconvert.py
 
 desktop-file-install --vendor fedora                            \
         --dir ${RPM_BUILD_ROOT}%{_datadir}/applications         \
-        --add-category X-Fedora                                 \
         %{SOURCE2}
 desktop-file-install --vendor fedora                            \
         --dir ${RPM_BUILD_ROOT}%{_datadir}/applications         \
-        --add-category X-Fedora                                 \
         %{SOURCE3}
 mkdir -p $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/48x48/apps/
 install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/48x48/apps/
 
-install -p -D -m 755 %{SOURCE4} $RPM_BUILD_ROOT/%{_initrddir}/%{name}-server
+install -p -D -m 644 %{SOURCE4} $RPM_BUILD_ROOT/lib/systemd/system/%{name}-server.service
 
 install -p -D -m 644 %{SOURCE5} \
-    $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/%{name}-server
+    $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/%{name}-server.conf
 
 install -p -D -m 644 %{SOURCE6} \
     $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/%{name}-server
@@ -150,30 +119,20 @@ install -pD -m 0755 %{SOURCE11} $RPM_BUILD_ROOT%{logwatch_scripts}/services/%{na
 install -pD -m 0644 %{SOURCE12} $RPM_BUILD_ROOT%{logwatch_conf}/services/%{name}.conf
 install -pD -m 0755 %{SOURCE13} $RPM_BUILD_ROOT%{logwatch_scripts}/shared/applyxpilotdate
 
-# Install selinux policies
-pushd SELinux
-for variant in %{selinux_variants}
-do
-    install -d $RPM_BUILD_ROOT%{_datadir}/selinux/${variant}
-    install -p -m 644 xpilotd.pp.${variant} \
-           $RPM_BUILD_ROOT%{_datadir}/selinux/${variant}/xpilotd.pp
-done
-popd
-# Hardlink identical policy module packages together
-/usr/sbin/hardlink -cv $RPM_BUILD_ROOT%{_datadir}/selinux
 
 %post
-touch --no-create %{_datadir}/icons/hicolor || :
-if [ -x %{_bindir}/gtk-update-icon-cache ]; then
-   %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
-fi
+touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
 
 %postun
-touch --no-create %{_datadir}/icons/hicolor || :
-if [ -x %{_bindir}/gtk-update-icon-cache ]; then
-   %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
+if [ $1 -eq 0 ] ; then
+    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
+    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 fi
 
+%posttrans
+gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+
+
 %pre server
 getent group xpilot >/dev/null || groupadd -r xpilot
 getent passwd xpilot >/dev/null || \
@@ -182,61 +141,27 @@ useradd -r -g xpilot -d %{_datadir}/%{name} -s /sbin/nologin \
 exit 0
 
 %post server
-/sbin/chkconfig --add xpilot-ng-server
+if [ $1 -eq 1 ] ; then 
+    # Initial installation 
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
 
 %preun server
-if [ "$1" -le "0" ]; then
-    /sbin/service xpilot-ng-server stop > /dev/null 2>&1
-    /sbin/chkconfig --del xpilot-ng-server
+if [ $1 -eq 0 ] ; then
+    # Package removal, not upgrade
+    /bin/systemctl --no-reload disable xpilot-ng-server.service > /dev/null 2>&1 || :
+    /bin/systemctl stop xpilot-ng-server.service > /dev/null 2>&1 || :
 fi
 
 %postun server
-if [ "$1" -ge "1" ]; then
-    /sbin/service xpilot-ng-server condrestart > /dev/null 2>&1
-fi
-
-%post selinux
-# Install SELinux policy modules
-for selinuxvariant in %{selinux_variants}
-do
-  /usr/sbin/semodule -s ${selinuxvariant} -i \
-    %{_datadir}/selinux/${selinuxvariant}/xpilotd.pp &> /dev/null || :
-done
-/usr/sbin/semanage port -a -t xpilotd_port_t -p udp 15345 &> /dev/null || :
-/usr/sbin/semanage port -a -t xpilotd_port_t -p udp 32200-32299 &> /dev/null || :
-/sbin/fixfiles -R %{name}-server restore || :
-/sbin/service %{name}-server condrestart > /dev/null 2>&1 || :
-
-%preun selinux
-if [ "$1" -lt "1" ] ; then
-    # Disable the policy and restart the daemon
-    /usr/sbin/setsebool xpilotd_disable_trans 1 &> /dev/null || :
-    /sbin/service %{name}-server condrestart > /dev/null 2>&1 || :
-    # Unload the module
-    /usr/sbin/semanage port -d -t xpilotd_port_t -p udp 15345 &> /dev/null || :
-    /usr/sbin/semanage port -d -t xpilotd_port_t -p udp 32200-32299 &> /dev/null || :
-    for variant in %{selinux_variants} ; do
-        /usr/sbin/semodule -s ${variant} -r xpilotd &> /dev/null || :
-    done
-    # Set the context back
-    /sbin/fixfiles -R %{name}-server restore || :
-fi
-
-%postun selinux
-if [ "$1" -ge "1" ] ; then
-    # Replace the module if it is already loaded. semodule -u also
-    # checks the module version
-    for variant in %{selinux_variants} ; do
-        /usr/sbin/semodule -u %{_datadir}/selinux/${variant}/xpilotd.pp || :
-    done
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
+    /bin/systemctl try-restart xpilot-ng-server.service >/dev/null 2>&1 || :
 fi
 
-%clean
-rm -rf $RPM_BUILD_ROOT
-
 
 %files
-%defattr(-,root,root,-)
 %{_bindir}/xpilot-ng-replay
 %{_bindir}/xpilot-ng-sdl
 %{_bindir}/xpilot-ng-x11
@@ -251,11 +176,10 @@ rm -rf $RPM_BUILD_ROOT
 %doc README COPYING
 
 %files server
-%defattr(-,root,root,-)
 %{_bindir}/xpilot-ng-xp-mapedit
 %{_bindir}/xpilot-ng-server
-%{_initrddir}/xpilot-ng-server
-%config(noreplace) %{_sysconfdir}/sysconfig/%{name}-server
+/lib/systemd/system/xpilot-ng-server.service
+%config(noreplace) %{_sysconfdir}/sysconfig/%{name}-server.conf
 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}-server
 %{_datadir}/%{name}
 %dir %{_sysconfdir}/%{name}
@@ -265,19 +189,21 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man6/xpilot-ng-xp-mapedit.6.gz
 %doc README COPYING
 
-%files selinux
-%defattr(-,root,root,-)
-%doc SELinux/*.??
-%{_datadir}/selinux/*/xpilotd.pp
-
 %files logwatch
-%defattr(-,root,root,-)
 %{logwatch_conf}/logfiles/%{name}.conf
 %{logwatch_conf}/services/%{name}.conf
 %{logwatch_scripts}/services/%{name}
 %{logwatch_scripts}/shared/applyxpilotdate
 
+
 %changelog
+* Sun Jul 27 2012 Hans de Goede <hdegoede at redhat.com> - 4.7.3-1
+- Fix a crash in the welcome screen (rhbz#830640)
+- Upgrade to latest upstream 4.7.3
+- Drop selinux module, it no longer compiles and selinux support belongs
+  in selinux-policy*, not in the apps themselves
+- Replace sysv init script by a systemd unit file
+
 * Sun Jul 22 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 4.7.2-22
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 
diff --git a/xpilot-ng.sysconfig b/xpilot-ng.sysconfig
index c294b06..3d2c50f 100644
--- a/xpilot-ng.sysconfig
+++ b/xpilot-ng.sysconfig
@@ -22,7 +22,4 @@
 # of defaults.
 # Also, explicitly disable reporting to the metaserver.  Use
 # -expand PublicSettings or -reportToMetaserver to enable.
-XPILOTD_OPTIONS="-noQuit \
-        +reportToMetaServer \
-        -defaultsFileName /etc/xpilot-ng/defaults.txt \
-        -passwordFileName /etc/xpilot-ng/password.txt"
+XPILOTD_OPTIONS="-noQuit +reportToMetaServer -defaultsFileName /etc/xpilot-ng/defaults.txt -passwordFileName /etc/xpilot-ng/password.txt"


More information about the scm-commits mailing list