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