Blob Blame History Raw
Name:           wesnoth
Version:        1.3.16
Release:        1%{?dist}
Summary:        Turn-based strategy game with a fantasy theme

Group:          Amusements/Games
License:        GPLv2+
URL:            http://www.wesnoth.org
Source0:        http://www.%{name}.org/files/%{name}-%{version}.tar.bz2
Source1:        wesnothd.init
Source2:        %{name}.sysconfig
Patch0:         %{name}-1.2.8-gcc43.patch
Patch1:		wesnoth-1.3.16-remove-ogg-test.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:	SDL_image-devel
BuildRequires:	SDL_mixer-devel
BuildRequires:  SDL_net-devel
BuildRequires:	freetype-devel
BuildRequires:  libpng-devel
BuildRequires:	fribidi-devel
BuildRequires:	python-devel
BuildRequires:  desktop-file-utils
BuildRequires:	gettext
BuildRequires:	boost-devel
# Drop these when ogg test patch is removed.
BuildRequires:  autoconf
BuildRequires:  automake

%description
The Battle for Wesnoth is a turn-based strategy game with a fantasy theme.

Build up a great army, gradually turning raw recruits into hardened
veterans. In later games, recall your toughest warriors and form a deadly
host against whom none can stand. Choose units from a large pool of
specialists, and hand-pick a force with the right strengths to fight well
on different terrains against all manner of opposition.

Fight to regain the throne of Wesnoth, of which you are the legitimate
heir, or use your dread power over the Undead to dominate the land of
mortals, or lead your glorious Orcish tribe to victory against the humans
who dared despoil your lands. Wesnoth has many different sagas waiting to
be played out. You can create your own custom units, and write your own
scenarios--or even full-blown campaigns. You can also challenge your
friends--or strangers--and fight multi-player epic fantasy battles.


%package server
Summary:	%{summary}
Group:		Amusements/Games
Requires:	%{name} = %{version}-%{release}
Requires(post): /sbin/chkconfig
Requires(preun):/sbin/chkconfig
Requires(pre):	/usr/sbin/useradd


%description server
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
This package contains the game editor and development tools.


%prep
%setup -q
%patch0 -p1 -b .gcc43
%patch1 -p0
autoreconf
#chmod -x MANUAL*


%build
%configure --disable-dependency-tracking \
    --with-localedir=%{_datadir}/locale \
    --enable-editor \
    --enable-tools \
    --enable-server \
    --enable-python \
    --with-fifodir=/var/run/wesnothd \
    --with-server-uid=$(id -u) \
    --with-server-gid=$(id -g) 
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=${RPM_BUILD_ROOT}

desktop-file-install --dir $RPM_BUILD_ROOT/%{_datadir}/applications \
                     --mode="0644" --vendor fedora \
                     icons/%{name}.desktop

desktop-file-install --dir $RPM_BUILD_ROOT/%{_datadir}/applications \
                     --mode="0644" --vendor fedora \
                     icons/%{name}_editor.desktop

#clean up extraneous .desktop files.
rm -f $RPM_BUILD_ROOT/usr/share/applications/wesnoth*
rm -f $RPM_BUILD_ROOT/usr/share/wesnoth/icons/*.desktop

# add icon for menus
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/pixmaps
install -m 644 images/%{name}-icon.png $RPM_BUILD_ROOT/%{_datadir}/pixmaps

install -m 644 icons/%{name}_editor-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

%find_lang %{name}.\*
#/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

rm -rf $RPM_BUILD_ROOT/usr/share/doc/wesnoth/
rm -f $RPM_BUILD_ROOT/usr/share/icons/wesnoth-icon.png
rm -f $RPM_BUILD_ROOT/usr/share/icons/wesnoth_editor-icon.png
rm -f $RPM_BUILD_ROOT/usr/share/applications/wesnoth*

%clean
rm -rf $RPM_BUILD_ROOT

%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

%postun
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi

%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 doc/manual/
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/applications/fedora-wesnoth.desktop
%{_datadir}/pixmaps/*
%{_mandir}/man6/wesnoth.6*
%{_mandir}/*/man6/wesnoth.6*

%files tools
%defattr(-,root,root,-)
%{_bindir}/wesnoth_editor
%{_bindir}/exploder
%{_bindir}/cutter
%{_bindir}/wmlindent
%{_bindir}/wmllint
%{_bindir}/wmlscope
%{_datadir}/applications/fedora-wesnoth_editor.desktop
%{_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
* Fri Feb 15 2008 Jon Ciesla <limb@jcomserv.net> - 1.3.16-1
- Update to 1.3.16.
- Updated ogg test patch.
- Corrected license tag.
- Added boost-devel BR.
- Corrected .desktop/icon handling for subpackage.

* Mon Feb 11 2008 Warren Togami <wtogami@redhat.com> - 1.2.8-5
- Patch to fix build with gcc-4.3.

* Fri Feb  8 2008 Brian Pepple <bpepple@fedoraproject.org> - 1.2.8-4
- Rebuild for gcc-4.3.

* Fri Nov 30 2007 Brian Pepple <bpepple@fedoraproject.org> - 1.2.8-3
- Re-add the server-gid that accidently got removed.

* Fri Nov 30 2007 Brian Pepple <bpepple@fedoraproject.org> - 1.2.8-2
- Add patch to drop ogg test from configure script, until better workaround.
- Enable python support.

* Thu Nov 29 2007 Brian Pepple <bpepple@fedoraproject.org> - 1.2.8-1
- Update to 1.2.8.

* Tue Oct  9 2007 Brian Pepple <bpepple@fedoraproject.org> - 1.2.7-1
- Update to 1.2.7. Fixes #324841 (CVE-2007-3917)

* Tue Aug 21 2007 Warren Togami <wtogami@redhat.com> - 1.2.6-2
- rebuild

* Sat Jul 28 2007 Brian Pepple <bpepple@fedoraproject.org> - 1.2.6-1
- Update to 1.2.6.

* Sat Jun 16 2007 Brian Pepple <bpepple@fedoraproject.org> - 1.2.5-2
- Drop wmlxgettext.

* Sat Jun 16 2007 Brian Pepple <bpepple@fedoraproject.org> - 1.2.5-1
- Update to 1.2.5.

* Sat Apr 21 2007 Warren Togami <wtogami@redhat.com> - 1.2.4-1
- 1.2.4

* Fri Mar 16 2007 Brian Pepple <bpepple@fedoraproject.org> - 1.2.3-1
- Update to 1.2.3.

* Sat Feb 24 2007 Brian Pepple <bpepple@fedoraproject.org> - 1.2.2-2
- Bump.

* Sat Feb 24 2007 Warren Togami <wtogami@redhat.com> - 1.2.2-1
- 1.2.2

* Mon Jan 15 2007 Brian Pepple <bpepple@fedoraproject.org> - 1.2.1-1
- Update to 1.2.1.

* Sun Dec 24 2006 Brian Pepple <bpepple@fedoraproject.org> - 1.2-1
- Update to 1.2.

* Sat Dec 23 2006 Brian Pepple <bpepple@fedoraproject.org> - 1.1.14-1
- Update to 1.1.14.
- Add BR on fribidi-devel.
- Drop X-Fedora category from desktop file.
- Drop help speedup patch, fixed upstream.
- Drop ttf patch, fixed upstream.

* Thu Sep  7 2006 Brian Pepple <bpepple@fedoraproject.org> - 1.0.2-4
- Rebuild for FC6.
- Remove unnecessary BR on SDL-devel.

* Tue Jul 18 2006 Michael Schwendt <mschwendt[AT]users.sf.net> - 1.0.2-3
- fix #199079, so loading some help pages like the "License" doesn't
  take ages
- remove BR SDL_ttf-devel, an included/patched copy is used since 0.8.7
- patch included SDL_ttf to build with freetype 2.x and not access
  an old freetype 1.x internal

* Wed Feb 15 2006 Michael Schwendt <mschwendt[AT]users.sf.net> - 1.0.2-2
- rebuilt for FC5

* Wed Dec 21 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 1.0.2-1
- update to 1.0.2

* Sat Oct 22 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 1.0.1-1
- update to 1.0.1

* Tue Oct  4 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 1.0-1
- update to 1.0
- remove README.fedora warning about game development status

* Wed Sep 21 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 1.0-0.1.rc1
- update to 1.0rc1
- remove exe bit from Turkish manual

* Wed Sep 14 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 0.9.7-1
- update to 0.9.7

* Wed Aug 31 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 0.9.6-2
- update summary and description
- move and specify server package scriptlet requirements

* Sun Aug 28 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 0.9.6-1
- update to 0.9.6

* Sat Aug 13 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 0.9.5-1
- update to 0.9.5

* Wed Jul 27 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 0.9.4-1
- update to 0.9.4

* Fri Jul  8 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 0.9.3-1
- update to 0.9.3

* Mon Jun 13 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 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 -tools sub-package
- install translations into system's locale directories
- merge Panu's changes:
  Sat Apr 16 2005 Panu Matilainen <pmatilai@welho.com> 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 <katzj@redhat.com> - 0.8-5
- fix build on x86_64

* Sun May 22 2005 Jeremy Katz <katzj@redhat.com> - 0.8-4
- rebuild on all arches

* Fri Apr  7 2005 Michael Schwendt <mschwendt[AT]users.sf.net>
- rebuilt

* Fri Jul 09 2004 Panu Matilainen <pmatilai@welho.com> 0:0.8-0.fdr.2
- use upstream desktop file and icon

* Sat Jul 03 2004 Panu Matilainen <pmatilai@welho.com> 0:0.8-0.fdr.1
- update to 0.8

* Tue Mar 30 2004 Panu Matilainen <pmatilai@welho.com> 0:0.7-0.fdr.1
- update to 0.7

* Wed Dec 17 2003 Panu Matilainen <pmatilai@welho.com> 0:0.6.1-0.fdr.1
- update to 0.6.1

* Mon Dec 15 2003 Panu Matilainen <pmatilai@welho.com> 0:0.6-0.fdr.2
- update to bugfixed tarball of 0.6

* Fri Dec 12 2003 Panu Matilainen <pmatilai@welho.com> 0:0.6-0.fdr.1
- update to 0.6
- adapt to the new autoconf make system
- enable editor and server

* Tue Nov 11 2003 Panu Matilainen <pmatilai@welho.com> 0:0.5.1-0.fdr.1
- update to 0.5.1
- Fedora -> fedora in desktop file vendor

* Tue Nov 04 2003 Panu Matilainen <pmatilai@welho.com> 0:0.5-0.fdr.1
- Initial Fedora packaging.