Name: colossus
%define rev 4519
%define revdate 20090906
Version: 0.9.2
Release: 1.%{revdate}svn%{rev}%{?dist}
Summary: Allows people to play Titan against each other or AIs
Group: Amusements/Games
License: GPLv2
URL: http://colossus.sourceforge.net/
# The svn repo includes some prebuilt jar files that need to be removed
# The colossus-gen-tarball.sh can be used to fetch either the latest
# revision or a specified revision from the repo, strip the jar files
# and some artwork and then build a tar.gz archive.
# colossus-rev.xsl is used to extract the current revision of HEAD
# when grabbing the latest revision, using svn info.
# The repo is at:
# https://colossus.svn.sourceforge.net/svnroot/colossus/trunk/Colossus
Source0: colossus-%{revdate}-%{rev}.tar.gz
Source1: colossus-gen-tarball.sh
Source2: colossus-rev.xsl
%global with_gcj %{!?_without_gcj:1}%{?_without_gcj:0}
%if %{with_gcj}
BuildRequires: java-gcj-compat-devel >= 1.0.31
Requires(post): java-gcj-compat >= 1.0.31
Requires(postun): java-gcj-compat >= 1.0.31
%else
BuildArch: noarch
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# Note the intention is to eventually require only java 1.5 for both building
# and installing. But bug 510243 in gjdoc currently blocks this.
BuildRequires: java-devel >= 1.6
BuildRequires: jpackage-utils
BuildRequires: ant
BuildRequires: jdom
BuildRequires: desktop-file-utils
BuildRequires: zip
Requires: java >= 1.6
Requires: jpackage-utils
Requires: jdom
Requires(post): coreutils
Requires(postun): coreutils
%description
Colossus allows people to play Titan
(http://www.boardgamegeek.com/boardgame/103) and several Titan variants, hot
seat or via a network. Several different AIs are provided that can play instead
of humans.
%package javadoc
Summary: Javadocs for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
Requires: jpackage-utils
%description javadoc
This package contains the API documentation for %{name}.
%prep
%setup -q -n %{name}-%{revdate}-%{rev}
%build
# Tell colossus' build process where to look for needed jar files
echo "libs.dir=%{_javadir}" > local_build.properties
# Tell colossus some build info that the game will display
mkdir -p build/ant/classes/META-INF
cat <<EOF > build/ant/classes/META-INF/build.properties
release.version=%{version}
svn.revision.max-with-flags=%{rev}
build.timestamp=%{revdate}
username=rpmbuild
EOF
ant jar
# The supplied build.xml adds a classpath to the manifest that needs to
# be removed.
# First remove the existing manifest file
zip -d Colossus.jar META-INF/MANIFEST.MF
# Then put one back without a class path
cat <<EOF > fixup.xml
<?xml version="1.0"?>
<!-- Replace manifest with one without a classpath -->
<project name="Colossus" default="fixup" basedir=".">
<target name="fixup"
description="Remove classpath from manifest">
<jar jarfile="Colossus.jar" update="true">
<manifest>
<attribute name="Main-Class"
value="net.sf.colossus.appmain.Start" />
</manifest>
</jar>
</target>
</project>
EOF
ant -f fixup.xml
ant -lib %{_javadir}/jdom.jar javadoc
# Allow for simple command to run colossus
echo -e "#!/bin/sh\njava -cp %{_javadir}/jdom.jar:%{_javadir}/colossus.jar net.sf.colossus.appmain.Start" > %{name}
# Make a .desktop file
cat <<EOF > %{name}.desktop
[Desktop Entry]
Name=Colossus
GenericName=Strategy Game
Comment=Multiplayer turned based fantasy game with AIs available
Exec=%{name}
Icon=%{name}
Terminal=false
Type=Application
Categories=Game;StrategyGame;
EOF
%install
rm -rf $RPM_BUILD_ROOT
install -D -m 755 Colossus.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
install -D -m 755 %{name} $RPM_BUILD_ROOT%{_bindir}/%{name}
install -D -m 644 core/src/main/resource/icons/ColossusIcon.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications %{name}.desktop
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}
cp -rpv build/ant/javadoc $RPM_BUILD_ROOT%{_javadocdir}/%{name}
chmod -R og=u-w $RPM_BUILD_ROOT%{_javadocdir}
%if %{with_gcj}
%{_bindir}/aot-compile-rpm
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%post
%if %{with_gcj}
if [ -x %{_bindir}/rebuild-gcj-db ]
then
%{_bindir}/rebuild-gcj-db
fi
%endif
touch --no-create %{_datadir}/pixmaps || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/pixmaps || :
%postun
%if %{with_gcj}
if [ -x %{_bindir}/rebuild-gcj-db ]
then
%{_bindir}/rebuild-gcj-db
fi
%endif
touch --no-create %{_datadir}/pixmaps || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/pixmaps || :
%files
%defattr(-,root,root,-)
%{_javadir}/*
%{_bindir}/*
%{_datadir}/pixmaps/*
%{_datadir}/applications/*
%doc docs/*
%if %{with_gcj}
%attr(-,root,root) %{_libdir}/gcj/%{name}
%endif
%files javadoc
%defattr(-,root,root,-)
%{_javadocdir}/%{name}
%changelog
* Sun Sep 06 2009 Bruno Wolff III <bruno@wolff.to> - 0.9.2-1.20090906svn4519
- Rebase to 0.9.2
- See: http://colossus.sourceforge.net/docs/RecentChangesDetails.html
- Fixed: 2835558 WARNING: Could not find creature with name none
- Fixed: 2820231 Illegal rangestrike
- Fixed: 2848651 and 2828028: Legion flyouts
- Fixed: 2837746 Balrog variant: Caretaker counts not reset between games
- Fixed: 2839241 Faulty anchor tags (Crossreference links in docs worked for Inetnet Explorer but not for Netscape)
- Make loading and saving of Balrog games work
- Make Auto Done act properly when there is no Recruit action or undo possible
- Add in save game also a property that tells with which release / revision of Colossus that save game was created.
- Eliminated some race situations in game startup (thread interaction/notifications)
* Wed Aug 19 2009 Bruno Wolff III <bruno@wolff.to> - 0.9.1-2.20090817svn4489
- Fix for desert LOS bug
* Mon Aug 17 2009 Bruno Wolff III <bruno@wolff.to> - 0.9.1-1.20090817svn4489
- Rebase to new public release 0.9.1
- 2 additional bug fixes
- See http://colossus.sourceforge.net/public-build/docs/RecentChangesDetails.html
* Sun Aug 16 2009 Bruno Wolff III <bruno@wolff.to> - 0.9.0-2.20090810svn4482
- Patch 4485 Fix creature info popup
- Patch 4486 Fix Help problem when a logging property is not set
* Mon Aug 10 2009 Bruno Wolff III <bruno@wolff.to> - 0.9.0-1.20090810svn4482
- New public build.
- Upstream is now using real version numbers.
* Sun Jul 26 2009 Bruno Wolff III <bruno@wolff.to> - 0-0.5.20090726svn4462
- Just when I thought it would be safe to rebase, a new public test build was released
- Details at http://colossus.sourceforge.net/public-testing/docs/RecentChangesDetails.html
- Rebase to 4462
* Sat Jul 25 2009 Bruno Wolff III <bruno@wolff.to> - 0-0.4.20090725svn4454
- Fix for off by one roll, movement roll in master board header
- Rebase to 4454
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.3.20090710svn4432
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Sun Jul 12 2009 Bruno Wolff III <bruno@wolff.to> - 0-0.2.20090710svn4432
- A couple of final spec file tweaks based on comments from my sponsor
* Fri Jul 10 2009 Bruno Wolff III <bruno@wolff.to> - 0-0.1.20090710svn4432
- Prerelease snapshot with a public build expected in a week or two