From 0aa6c68fa35e84d10c7a6f5d6dbcdc30266f8838 Mon Sep 17 00:00:00 2001 From: Michael Schwendt Date: Jun 17 2005 01:17:20 +0000 Subject: For Fedora Extras Development only. No plan on updating the old 0.8 version for FC4 and FC3 [yet], because the SDL thread based networking code since release 0.8.6 crashes badly in FC4. GCC 4.0.0 could be the culprit and so could be some weird race (or miscompiled SDL code) which only turns up when compiling with GCC 4.0.0. Mon Jun 13 2005 Michael Schwendt - 0.9.2-1 - update to 0.9.2 - BR libpng-devel is needed - add initscript and scriptlets for -server package - don't build campaign server (upstream suggestion) - split off editor+tools into -tool sub-package - install translations into system's locale directories - merge Panu's changes: Sat Apr 16 2005 Panu Matilainen 0.9.0-1 - enable campaign server and tools - split server to separate package - add wesnothd user in server %pre - buildrequire gettext --- diff --git a/.cvsignore b/.cvsignore index 8ec315c..8875bed 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -wesnoth-0.8.tar.gz +wesnoth-0.9.2.tar.gz diff --git a/README.fedora b/README.fedora new file mode 100644 index 0000000..798d33e --- /dev/null +++ b/README.fedora @@ -0,0 +1,12 @@ +This is a DEVELOPMENT release of "Battle for Wesnoth. Be careful when to +upgrade this game package, since it may affect your [or your users'] saved +games or result in unexpected incompatibilities or changes. + +With development release 0.8.8 the developers switched to a different +release model and discontinued their stable branch. There won't be another +stable release until 1.0 is ready. Version 0.8, which was the last stable +release from June/July 2004, is quite old, unsupported, and is also +incompatible with the official game server at wesnoth.org. The game server +will run always the most recent version of the software shortly after its +release. + diff --git a/sources b/sources index 2260a7c..8ee31e6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c6258d08645a97c311c9538128f5af6e wesnoth-0.8.tar.gz +0158b7733373b1a25ed1da6bf1d32899 wesnoth-0.9.2.tar.gz diff --git a/wesnoth.spec b/wesnoth.spec index 49cbd4f..f259b49 100644 --- a/wesnoth.spec +++ b/wesnoth.spec @@ -1,19 +1,23 @@ Name: wesnoth -Version: 0.8 -Release: 5 - +Version: 0.9.2 +Release: 1%{?dist} Summary: Battle for Wesnoth, a fantasy turn-based strategy game Group: Amusements/Games License: GPL URL: http://www.wesnoth.org -Source0: http://www.wesnoth.org/files/wesnoth-0.8.tar.gz -Patch0: wesnoth-64bit.patch +Source0: http://www.wesnoth.org/files/wesnoth-%{version}.tar.gz +Source1: wesnothd.init +Source2: wesnoth.sysconfig +Source3: README.fedora BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: SDL-devel, SDL_image-devel, SDL_mixer-devel BuildRequires: SDL_ttf-devel, SDL_net-devel, freetype-devel -BuildRequires: desktop-file-utils +BuildRequires: libpng-devel +BuildRequires: desktop-file-utils, gettext + +Requires: /sbin/chkconfig %description %{summary}. @@ -23,22 +27,52 @@ and disadvantages in different types of terrains and against different types of attacks. Units gain experience and advance levels, and are carried over from one scenario to the next campaign. + +%package server +Summary: %{summary} +Group: Amusements/Games +Requires: %{name} = %{version}-%{release} + +%description server +%{description} + +This package contains the binaries for running a Wesnoth server +for multi-player games. + + +%package tools +Summary: %{summary} +Group: Amusements/Games +Requires: %{name} = %{version}-%{release} + +%description tools +%{description} + +This package contains the game editor and development tools. + + %prep %setup -q -%patch0 -p1 -b .64bit +cp %{SOURCE3} . +# in 0.9.2: the translations are not built +find po -name stamp-po | xargs rm -f %build %configure --disable-dependency-tracking \ - --enable-server \ - --enable-editor - + --with-localedir=%{_datadir}/locale \ + --enable-editor \ + --enable-tools \ + --enable-server \ + --with-fifodir=/var/run/wesnothd \ + --with-server-uid=$(id -u) \ + --with-server-gid=$(id -g) make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT -%makeinstall +make install DESTDIR=${RPM_BUILD_ROOT} desktop-file-install --dir $RPM_BUILD_ROOT/%{_datadir}/applications \ --mode="0644" --vendor fedora \ @@ -47,22 +81,89 @@ desktop-file-install --dir $RPM_BUILD_ROOT/%{_datadir}/applications \ mkdir -p $RPM_BUILD_ROOT/%{_datadir}/pixmaps install -m 644 images/%{name}-icon.png $RPM_BUILD_ROOT/%{_datadir}/pixmaps +# arrange server package files +mkdir -p ${RPM_BUILD_ROOT}%{_sbindir} +mv ${RPM_BUILD_ROOT}%{_bindir}/wesnothd ${RPM_BUILD_ROOT}%{_sbindir} +mkdir -p ${RPM_BUILD_ROOT}/var/run/wesnothd +touch ${RPM_BUILD_ROOT}/var/run/wesnothd/socket +install -Dpm 755 %{SOURCE1} \ + $RPM_BUILD_ROOT%{_initrddir}/wesnothd +install -Dpm 644 %{SOURCE2} \ + $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/wesnoth + +/usr/lib/rpm/find-lang.sh $RPM_BUILD_ROOT %name --all-name + find $RPM_BUILD_ROOT -name ".cvs*" | xargs rm -f find $RPM_BUILD_ROOT -name "CVS" | xargs rm -rf + %clean rm -rf $RPM_BUILD_ROOT -%files + +%pre server +/usr/sbin/useradd -c "Wesnoth server" -s /sbin/nologin \ + -r -d /var/run/wesnothd wesnothd 2> /dev/null || : + + +%post server +/sbin/chkconfig --add wesnothd +if [ $1 -gt 1 ]; then + %{_initrddir}/wesnothd try-restart >/dev/null || : +fi + + +%preun server +if [ $1 -eq 0 ]; then + %{_initrddir}/wesnothd stop >/dev/null 2>&1 || : + /sbin/chkconfig --del wesnothd +fi + + +%files -f %{name}.lang %defattr(-,root,root,-) -%doc COPYING changelog README copyright MANUAL* -%{_bindir}/* +%doc COPYING changelog README copyright MANUAL* README.fedora +%{_bindir}/wesnoth %{_datadir}/%{name} %{_datadir}/applications/* %{_datadir}/pixmaps/* -%{_mandir}/man6/* +%{_mandir}/man6/wesnoth.6* +%{_mandir}/*/man6/wesnoth.6* + +%files tools +%defattr(-,root,root,-) +%{_bindir}/wesnoth_editor +%{_bindir}/exploder +%{_bindir}/cutter +%{_bindir}/wmlxgettext +%{_mandir}/man6/wesnoth_editor.6* +%{_mandir}/*/man6/wesnoth_editor.6* + +%files server +%defattr(-,root,root,-) +%config %{_initrddir}/wesnothd +%config(noreplace) %{_sysconfdir}/sysconfig/wesnoth +%{_sbindir}/wesnothd +%{_mandir}/man6/wesnothd.* +%{_mandir}/*/man6/wesnothd.* +%attr(0700,wesnothd,wesnothd) %dir /var/run/wesnothd/ +%ghost /var/run/wesnothd/socket %changelog +* Mon Jun 13 2005 Michael Schwendt - 0.9.2-1 +- update to 0.9.2 +- BR libpng-devel is needed +- add initscript and scriptlets for -server package +- don't build campaign server (upstream suggestion) +- split off editor+tools into -tool sub-package +- install translations into system's locale directories +- merge Panu's changes: + Sat Apr 16 2005 Panu Matilainen 0.9.0-1 +- enable campaign server and tools +- split server to separate package +- add wesnothd user in server %%pre +- buildrequire gettext + * Thu May 26 2005 Jeremy Katz - 0.8-5 - fix build on x86_64 diff --git a/wesnoth.sysconfig b/wesnoth.sysconfig new file mode 100644 index 0000000..973c02e --- /dev/null +++ b/wesnoth.sysconfig @@ -0,0 +1,4 @@ +# +# wesnothd(6) options. Pick a custom port here if needed, for example. +# +WESNOTHD_OPTIONS="" diff --git a/wesnothd.init b/wesnothd.init new file mode 100755 index 0000000..d3f6afe --- /dev/null +++ b/wesnothd.init @@ -0,0 +1,95 @@ +#!/bin/sh +# +# wesnothd This shell script takes care of starting and stopping +# the Wesnoth game server. +# +# chkconfig: - 15 85 +# description: The Wesnoth server supports playing networked \ +# multi-player games. +# processname: wesnothd +# config: /etc/sysconfig/wesnothd +# pidfile: /var/run/wesnothd.pid + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +# Check that networking is up. +[ "$NETWORKING" = "no" ] && exit 0 + +exec="/usr/sbin/wesnothd" +prog=$(basename $exec) +pidfile=/var/run/$prog.pid +socketfile=/var/run/wesnothd/socket + +[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog + +lockfile=/var/lock/subsys/$prog + +start() { + echo -n $"Starting Wesnoth game server: " + if [ -n "`/sbin/pidof $prog`" ]; then + echo -n $"$prog already running" + failure + echo + return 1 + fi + [ -p $socketfile ] && rm -f $socketfile + daemon --user wesnothd $exec --daemon $WESNOTHD_OPTIONS >/dev/null 2>&1 + retval=$? + if [ $retval -eq 0 ]; then + success + touch $lockfile + pidofproc $prog > $pidfile + else + failure + fi + echo + return $retval +} + +stop() { + echo -n $"Stopping Wesnoth game server: " + killproc $prog + retval=$? + echo + [ $retval -eq 0 ] && rm -f $lockfile + return $retval +} + +restart() { + stop + start +} + +reload() { + restart +} + +force_reload() { + restart +} + +fdr_status() { + status $prog +} + +case "$1" in + start|stop|restart|reload) + $1 + ;; + force-reload) + force_reload + ;; + status) + fdr_status + ;; + condrestart|try-restart) + [ ! -f $lockfile ] || restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}" + exit 2 +esac