Blob Blame History Raw
Name:           wesnoth
Version:        1.6.3
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.5.11-remove-ogg-test.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Requires:       wesnoth-data = %{version}
BuildRequires:	SDL_image-devel
BuildRequires:	SDL_mixer-devel
BuildRequires:  SDL_net-devel
BuildRequires:	SDL_ttf-devel
BuildRequires:	freetype-devel
BuildRequires:  libpng-devel
BuildRequires:	fribidi-devel
BuildRequires:	python-devel
BuildRequires:  desktop-file-utils
BuildRequires:	gettext
BuildRequires:	boost-devel
BuildRequires:	pango-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.

##%ifnarch noarch
%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.

##%else
%package data
Summary:	%{summary}
Group:		Amusements/Games
Requires:	%{name} = %{version}
BuildArch:	noarch

%description data
This package contains the data files for Wesnoth.
##%endif

%prep
%setup -qn wesnoth-%{version}
%patch0 -p1 -b .gcc43
%patch1 -p0
autoreconf


%build
# Cannot use configure macro because noarch-redhat-linux is not recognized by the auto tools in the tarball
export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS"
./configure --prefix=%{_prefix} --exec-prefix=%{_prefix} --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir}  --mandir=%{_mandir} --infodir=%{_infodir} \
    --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) \
    --disable-strict-compilation
#%ifnarch noarch
make %{?_smp_mflags}
#%endif


%install
rm -rf $RPM_BUILD_ROOT
#%ifarch noarch
### Data Files and Desktop Files
make install-data DESTDIR=${RPM_BUILD_ROOT}
rm -rf $RPM_BUILD_ROOT%{_datadir}/applications

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

# add icon for menus
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/pixmaps
ln -sf ../wesnoth/icons/%{name}-icon.png $RPM_BUILD_ROOT/%{_datadir}/pixmaps
ln -sf ../wesnoth/icons/%{name}_editor-icon.png $RPM_BUILD_ROOT/%{_datadir}/pixmaps

# Wesnoth ships its own fonts, replace with Fedora packaged versions
rm -f $RPM_BUILD_ROOT/%{_datadir}/%{name}/fonts/*
# dejavu-fonts
ln -s /usr/share/fonts/dejavu/DejaVuSans.ttf $RPM_BUILD_ROOT/%{_datadir}/%{name}/fonts/DejaVuSans.ttf
# sazanami-fonts-gothic
ln -s /usr/share/fonts/sazanami-fonts-gothic/sazanami-gothic.ttf $RPM_BUILD_ROOT/%{_datadir}/%{name}/fonts/sazanami-gothic.ttf
# wqy-zenhei-fonts
ln -s /usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc $RPM_BUILD_ROOT/%{_datadir}/%{name}/fonts/wqy-zenhei-gb2312.ttf

%find_lang %{name}.\*


#%else
### Binaries and Config Files
make install-exec DESTDIR=${RPM_BUILD_ROOT}

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

# 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

#%endif

### Cleanup Stuff
rm -f $RPM_BUILD_ROOT/usr/share/applications/wesnoth*
rm -f $RPM_BUILD_ROOT/usr/share/wesnoth/icons/*.desktop

find $RPM_BUILD_ROOT -name ".cvs*" | xargs rm -f
find $RPM_BUILD_ROOT -name "CVS" | xargs rm -rf
find $RPM_BUILD_ROOT/ -name 'Makefile*' |xargs rm -f

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/fedora-wesnoth_editor.desktop

%clean
rm -rf $RPM_BUILD_ROOT

#%ifarch noarch
%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
#%endif

#%ifnarch noarch
%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
#%endif

#%ifnarch noarch
%files
%doc COPYING changelog README copyright doc/manual/
%defattr(-,root,root,-)
%{_bindir}/%{name}

%files tools
%defattr(-,root,root,-)
#%{_bindir}/wesnoth_editor
%{_bindir}/wesnoth_addon_manager
%{_bindir}/exploder
%{_bindir}/cutter
%{_bindir}/wmlindent
%{_bindir}/wmllint
%{_bindir}/wmlscope
#%{_datadir}/applications/fedora-wesnoth_editor.desktop

%files server
%defattr(-,root,root,-)
%config %{_initrddir}/wesnothd
%config(noreplace) %{_sysconfdir}/sysconfig/wesnoth
%{_sbindir}/wesnothd
%attr(0700,wesnothd,wesnothd) %dir /var/run/wesnothd/
%ghost /var/run/wesnothd/socket
#%endif

#%ifarch noarch
%files data -f %{name}.\*.lang
%defattr(-,root,root,-)
%{_datadir}/%{name}
%{_datadir}/applications/fedora-wesnoth.desktop
%{_datadir}/pixmaps/*
%{_mandir}/man6/wesnoth.6*
%{_mandir}/*/man6/wesnoth.6*
#%{_mandir}/man6/wesnoth_editor.6*
#%{_mandir}/*/man6/wesnoth_editor.6*
%{_mandir}/man6/wesnothd.*
%{_mandir}/*/man6/wesnothd.*

#%endif

%changelog
* Sun Jun 28 2009 Warren Togami <wtogami@redhat.com> - 1.6.3-1
- 1.6.3 maintenance release

* Tue May 12 2009 Jon Ciesla <limb@jcomserv.net> - 1.6.2-1
- 1.6.2 maintenance release.

* Tue Apr 21 2009 Debarshi Ray <rishi@fedoraproject.org> - 1.6.1-2
- Respect $RPM_OPT_FLAGS, BZ 496897.

* Mon Apr 20 2009 Jon Ciesla <limb@jcomserv.net> - 1.6.1-1
- 1.6.1 maintenance release.

* Mon Mar 23 2009 Jon Ciesla <limb@jcomserv.net> - 1.6-1
- Update to 1.6 stable.

* Tue Mar 17 2009 Jon Ciesla <limb@jcomserv.net> - 1.5.14-1
- Update to 1.5.14.

* Wed Mar 11 2009 Jon Ciesla <limb@jcomserv.net> - 1.5.13-1
- Update to 1.5.13.

* Wed Mar 04 2009 Jon Ciesla <limb@jcomserv.net> - 1.5.12-1
- Update to 1.5.12.

* Wed Feb 25 2009 Jon Ciesla <limb@jcomserv.net> - 1.5.11-5
- Drop -Werror.

* Wed Feb 25 2009 Jon Ciesla <limb@jcomserv.net> - 1.5.11-4
- Add pango BR.

* Wed Feb 25 2009 Jon Ciesla <limb@jcomserv.net> - 1.5.11-3
- Add SDL_ttf BR.

* Wed Feb 25 2009 Jon Ciesla <limb@jcomserv.net> - 1.5.11-2
- Rename rediffed ogg test patch.

* Wed Feb 25 2009 Jon Ciesla <limb@jcomserv.net> - 1.5.11-1
- Update to dev version 1.5.11.

* Tue Feb 24 2009 Jon Ciesla <limb@jcomserv.net> - 1.5.10-1
- Update to dev version 1.5.10.
- Move data to noarch.

* Wed Feb 04 2009 Jon Ciesla <limb@jcomserv.net> - 1.5.9-1
- Update to dev version 1.5.9.

* Mon Feb 02 2009 Jon Ciesla <limb@jcomserv.net> - 1.5.8-1
- Update to dev version 1.5.8.
- Rediffed remove-ogg-test patch.

* Sun Dec 28 2008 Warren Togami <wtogami@redhat.com> - 1.4.7-1
- 1.4.7
- Remove font requirement

* Wed Dec 17 2008 Benjamin Kosnik  <bkoz@redhat.com> - 1.4.6-6
- Rebuild for boost-1.37.0.

* Sun Dec 14 2008 Warren Togami <wtogami@redhat.com> - 1.4.6-5
- No longer ship Wesnoth's redundant copy of fonts.
  We now symlink to the Fedora packaged fonts that wesnoth expects.
  dejavu-fonts (Latin)
  sazanami-fonts-gothic (Japanese)
  wqy-zenhei-fonts (Chinese)
  We do not explicitly require these fonts.  Normally these fonts would be 
  already installed by your system to use that language.

* Wed Dec 10 2008 Jon Ciesla <limb@jcomserv.net> - 1.4.6-4
- Rediffed fuzzy gcc43 patch.

* Tue Nov 18 2008 Warren Togami <wtogami@redhat.com> 1.4.6-3
- split into -data noarch subpackage to save mirror space

* Mon Nov 17 2008 Jon Ciesla <limb@jcomserv.net> - 1.4.6-1
- New upstream release.

* Tue Sep 09 2008 Jon Ciesla <limb@jcomserv.net> - 1.4.5-1
- New upstream release.

* Tue Aug 12 2008 Jon Ciesla <limb@jcomserv.net> - 1.4.4-1
- New upstream release.
- Introduced patch fuzz workaround, will fix.

* Thu May 08 2008 Jon Ciesla <limb@jcomserv.net> - 1.4.2-1
- New upstream maintenance release.

* Fri Apr 18 2008 Jon Ciesla <limb@jcomserv.net> - 1.4.1-1
- New upstream bugfix release.

* Wed Apr 09 2008 Jon Ciesla <limb@jcomserv.net> - 1.4-2
- LSB initscript fix, BZ 247094.

* Tue Mar 11 2008 Jon Ciesla <limb@jcomserv.net> - 1.4-1
- Update to 1.4 stable.

* 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.