cvsextras b7899e1
Name:           wesnoth
0aa6c68
Version:        0.9.2
0aa6c68
Release:        1%{?dist}
c15e74b
Summary:        Battle for Wesnoth, a fantasy turn-based strategy game
cvsextras b7899e1
c15e74b
Group:          Amusements/Games
cvsextras b7899e1
License:        GPL
cvsextras b7899e1
URL:            http://www.wesnoth.org
0aa6c68
Source0:        http://www.wesnoth.org/files/wesnoth-%{version}.tar.gz
0aa6c68
Source1:        wesnothd.init
0aa6c68
Source2:        wesnoth.sysconfig
0aa6c68
Source3:        README.fedora
cvsextras b7899e1
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
cvsextras b7899e1
cvsextras b7899e1
BuildRequires:  SDL-devel, SDL_image-devel, SDL_mixer-devel
c15e74b
BuildRequires:  SDL_ttf-devel, SDL_net-devel, freetype-devel
0aa6c68
BuildRequires:  libpng-devel
0aa6c68
BuildRequires:  desktop-file-utils, gettext
0aa6c68
0aa6c68
Requires:       /sbin/chkconfig
cvsextras b7899e1
cvsextras b7899e1
%description
c15e74b
%{summary}.
cvsextras b7899e1
c15e74b
Battle for control of villages, using variety of units which have advantages
c15e74b
and disadvantages in different types of terrains and against different types
c15e74b
of attacks. Units gain experience and advance levels, and are carried over
cvsextras b7899e1
from one scenario to the next campaign.
cvsextras b7899e1
0aa6c68
0aa6c68
%package server
0aa6c68
Summary:	%{summary}
0aa6c68
Group:		Amusements/Games
0aa6c68
Requires:   %{name} = %{version}-%{release}
0aa6c68
0aa6c68
%description server
0aa6c68
%{description}
0aa6c68
0aa6c68
This package contains the binaries for running a Wesnoth server
0aa6c68
for multi-player games.
0aa6c68
0aa6c68
0aa6c68
%package tools
0aa6c68
Summary:	%{summary}
0aa6c68
Group:		Amusements/Games
0aa6c68
Requires:   %{name} = %{version}-%{release}
0aa6c68
0aa6c68
%description tools
0aa6c68
%{description}
0aa6c68
0aa6c68
This package contains the game editor and development tools.
0aa6c68
0aa6c68
cvsextras b7899e1
%prep
cvsextras b7899e1
%setup -q
0aa6c68
cp %{SOURCE3} .
0aa6c68
# in 0.9.2: the translations are not built
0aa6c68
find po -name stamp-po | xargs rm -f
cvsextras b7899e1
cvsextras b7899e1
cvsextras b7899e1
%build
cvsextras b7899e1
%configure --disable-dependency-tracking \
0aa6c68
    --with-localedir=%{_datadir}/locale \
0aa6c68
    --enable-editor \
0aa6c68
    --enable-tools \
0aa6c68
    --enable-server \
0aa6c68
    --with-fifodir=/var/run/wesnothd \
0aa6c68
    --with-server-uid=$(id -u) \
0aa6c68
    --with-server-gid=$(id -g) 
c15e74b
make %{?_smp_mflags}
cvsextras b7899e1
cvsextras b7899e1
cvsextras b7899e1
%install
cvsextras b7899e1
rm -rf $RPM_BUILD_ROOT
0aa6c68
make install DESTDIR=${RPM_BUILD_ROOT}
cvsextras b7899e1
cvsextras b7899e1
desktop-file-install --dir $RPM_BUILD_ROOT/%{_datadir}/applications \
c15e74b
                     --mode="0644" --vendor fedora \
c15e74b
                     --add-category="X-Fedora" icons/%{name}.desktop
c15e74b
# add icon for menus
cvsextras b7899e1
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/pixmaps
cvsextras 5d43533
install -m 644 images/%{name}-icon.png $RPM_BUILD_ROOT/%{_datadir}/pixmaps
cvsextras b7899e1
0aa6c68
# arrange server package files
0aa6c68
mkdir -p ${RPM_BUILD_ROOT}%{_sbindir}
0aa6c68
mv ${RPM_BUILD_ROOT}%{_bindir}/wesnothd ${RPM_BUILD_ROOT}%{_sbindir}
0aa6c68
mkdir -p ${RPM_BUILD_ROOT}/var/run/wesnothd
0aa6c68
touch ${RPM_BUILD_ROOT}/var/run/wesnothd/socket
0aa6c68
install -Dpm 755 %{SOURCE1} \
0aa6c68
    $RPM_BUILD_ROOT%{_initrddir}/wesnothd
0aa6c68
install -Dpm 644 %{SOURCE2} \
0aa6c68
    $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/wesnoth
0aa6c68
0aa6c68
/usr/lib/rpm/find-lang.sh $RPM_BUILD_ROOT %name --all-name
0aa6c68
cvsextras b7899e1
find $RPM_BUILD_ROOT -name ".cvs*" | xargs rm -f
cvsextras b7899e1
find $RPM_BUILD_ROOT -name "CVS" | xargs rm -rf
cvsextras b7899e1
0aa6c68
cvsextras b7899e1
%clean
cvsextras b7899e1
rm -rf $RPM_BUILD_ROOT
cvsextras b7899e1
0aa6c68
0aa6c68
%pre server
0aa6c68
/usr/sbin/useradd -c "Wesnoth server" -s /sbin/nologin \
0aa6c68
	-r -d /var/run/wesnothd wesnothd 2> /dev/null || :
0aa6c68
0aa6c68
0aa6c68
%post server
0aa6c68
/sbin/chkconfig --add wesnothd
0aa6c68
if [ $1 -gt 1 ]; then
0aa6c68
    %{_initrddir}/wesnothd try-restart >/dev/null || :
0aa6c68
fi
0aa6c68
0aa6c68
0aa6c68
%preun server
0aa6c68
if [ $1 -eq 0 ]; then
0aa6c68
    %{_initrddir}/wesnothd stop >/dev/null 2>&1 || :
0aa6c68
    /sbin/chkconfig --del wesnothd
0aa6c68
fi
0aa6c68
0aa6c68
0aa6c68
%files -f %{name}.lang
cvsextras b7899e1
%defattr(-,root,root,-)
0aa6c68
%doc COPYING changelog README copyright MANUAL* README.fedora
0aa6c68
%{_bindir}/wesnoth
cvsextras b7899e1
%{_datadir}/%{name}
cvsextras b7899e1
%{_datadir}/applications/*
cvsextras b7899e1
%{_datadir}/pixmaps/*
0aa6c68
%{_mandir}/man6/wesnoth.6*
0aa6c68
%{_mandir}/*/man6/wesnoth.6*
0aa6c68
0aa6c68
%files tools
0aa6c68
%defattr(-,root,root,-)
0aa6c68
%{_bindir}/wesnoth_editor
0aa6c68
%{_bindir}/exploder
0aa6c68
%{_bindir}/cutter
0aa6c68
%{_bindir}/wmlxgettext
0aa6c68
%{_mandir}/man6/wesnoth_editor.6*
0aa6c68
%{_mandir}/*/man6/wesnoth_editor.6*
0aa6c68
0aa6c68
%files server
0aa6c68
%defattr(-,root,root,-)
0aa6c68
%config %{_initrddir}/wesnothd
0aa6c68
%config(noreplace) %{_sysconfdir}/sysconfig/wesnoth
0aa6c68
%{_sbindir}/wesnothd
0aa6c68
%{_mandir}/man6/wesnothd.*
0aa6c68
%{_mandir}/*/man6/wesnothd.*
0aa6c68
%attr(0700,wesnothd,wesnothd) %dir /var/run/wesnothd/
0aa6c68
%ghost /var/run/wesnothd/socket
cvsextras b7899e1
cvsextras b7899e1
%changelog
0aa6c68
* Mon Jun 13 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 0.9.2-1
0aa6c68
- update to 0.9.2
0aa6c68
- BR libpng-devel is needed
0aa6c68
- add initscript and scriptlets for -server package
0aa6c68
- don't build campaign server (upstream suggestion)
0aa6c68
- split off editor+tools into -tool sub-package
0aa6c68
- install translations into system's locale directories
0aa6c68
- merge Panu's changes:
0aa6c68
  Sat Apr 16 2005 Panu Matilainen <pmatilai@welho.com> 0.9.0-1
0aa6c68
- enable campaign server and tools
0aa6c68
- split server to separate package
0aa6c68
- add wesnothd user in server %%pre
0aa6c68
- buildrequire gettext
0aa6c68
72cc8e1
* Thu May 26 2005 Jeremy Katz <katzj@redhat.com> - 0.8-5
72cc8e1
- fix build on x86_64
72cc8e1
71befc3
* Sun May 22 2005 Jeremy Katz <katzj@redhat.com> - 0.8-4
71befc3
- rebuild on all arches
71befc3
8cb0c9b
* Fri Apr  7 2005 Michael Schwendt <mschwendt[AT]users.sf.net>
8cb0c9b
- rebuilt
8cb0c9b
cvsextras 5d43533
* Fri Jul 09 2004 Panu Matilainen <pmatilai@welho.com> 0:0.8-0.fdr.2
cvsextras 5d43533
- use upstream desktop file and icon
cvsextras 5d43533
cvsextras 5d43533
* Sat Jul 03 2004 Panu Matilainen <pmatilai@welho.com> 0:0.8-0.fdr.1
cvsextras 5d43533
- update to 0.8
cvsextras 5d43533
cvsextras b7899e1
* Tue Mar 30 2004 Panu Matilainen <pmatilai@welho.com> 0:0.7-0.fdr.1
cvsextras b7899e1
- update to 0.7
cvsextras b7899e1
cvsextras b7899e1
* Wed Dec 17 2003 Panu Matilainen <pmatilai@welho.com> 0:0.6.1-0.fdr.1
cvsextras b7899e1
- update to 0.6.1
cvsextras b7899e1
cvsextras b7899e1
* Mon Dec 15 2003 Panu Matilainen <pmatilai@welho.com> 0:0.6-0.fdr.2
cvsextras b7899e1
- update to bugfixed tarball of 0.6
cvsextras b7899e1
cvsextras b7899e1
* Fri Dec 12 2003 Panu Matilainen <pmatilai@welho.com> 0:0.6-0.fdr.1
cvsextras b7899e1
- update to 0.6
cvsextras b7899e1
- adapt to the new autoconf make system
cvsextras b7899e1
- enable editor and server
cvsextras b7899e1
cvsextras b7899e1
* Tue Nov 11 2003 Panu Matilainen <pmatilai@welho.com> 0:0.5.1-0.fdr.1
cvsextras b7899e1
- update to 0.5.1
cvsextras b7899e1
- Fedora -> fedora in desktop file vendor
cvsextras b7899e1
cvsextras b7899e1
* Tue Nov 04 2003 Panu Matilainen <pmatilai@welho.com> 0:0.5-0.fdr.1
cvsextras b7899e1
- Initial Fedora packaging.