Blob Blame History Raw
Name:		alienarena
Summary: 	Multiplayer retro sci-fi deathmatch game
Version:	7.32
Release:	1%{?dist}
License:	GPLv2+
Group:		Amusements/Games
# Subversion:  https://svn.icculus.org/alienarena/trunk/?sortby=date
# Upstream seems too inept to provide a simple source only tarball, so we use svn.
# Trunk contains the huge data also, so for the exe just get the source dir.
#   mkdir alienarena-7.32 && cd alienarena-7.32/
#   svn co svn://svn.icculus.org/alienarena/tags/7.32/source
#   svn co svn://svn.icculus.org/alienarena/tags/7.32/docs
#   cd ../
#   find alienarena-7.32 -depth -name .svn -type d -exec rm -rf {} \;
#   tar -cvjf alienarena-7.32.tar.bz2 alienarena-7.32
Source0:	alienarena-%{version}.tar.bz2
Source1:	alienarena.desktop
Source2:	GPL.acebot.txt
Source3:	alienarena.png
Patch0:		alienarena-7.20-currentdir-option.patch
Patch1:		alienarena-7.10-dont-search-dll-in-data-path.patch
Patch3:		alienarena-7.21-show-search-paths.patch
URL:		http://red.planetarena.org/
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:	libX11-devel, libXext-devel, libXxf86dga-devel, libXxf86vm-devel, libjpeg-devel
BuildRequires:	mesa-libGL-devel, mesa-libGLU-devel, curl-devel, libpng-devel
BuildRequires:	libvorbis-devel, openal-soft-devel
BuildRequires:	desktop-file-utils
Requires:	alienarena-data = 20091102
Requires:	desktop-file-utils >= 0.9, opengl-games-utils

%description
Alien Arena 2009 is an online deathmatch game with over 30 levels, seven modes 
of play, loads of mutators, built-in bots, multiple player characters and weapons
(with alt-fire modes).


%package server
Group:      Amusements/Games
Summary:    Dedicated server for alienarena, the FPS game
Requires:   alienarena-data = 20091102


%description server
Alien Arena 2009 is an online deathmatch game with over 30 levels, seven modes
of play, loads of mutators, built-in bots, multiple player characters and weapons
(with alt-fire modes).

This is the dedicated server.


%prep
%setup -q

# WITH_CURRENTDIR helps a little bit, but is not a proper fix
%patch0 -p0
%patch1 -p1
%patch3 -p1

# Copy license clarification for acebot
cp -p %{SOURCE2} .

# clean up prebuilt binary files
[[ -e crx ]] && rm crded crx crx.sdl {arena,data1}/game.so

# clean up end-line encoding
[[ -e docs/README.txt ]] && %{__sed} -i 's/\r//' docs/README.txt

# So, AlienArena now "uses" openal by dlopening the library, which is hardcoded to 
# "libopenal.so". That file only lives in openal-devel, so we need to adjust the hardcoding.
LIBOPENAL=`ls %{_libdir}/libopenal.so.*.* | cut -d "/" -f 4`
sed -i "s|\"libopenal.so\"|\"$LIBOPENAL\"|g" source/unix/qal_unix.c

%build
cd source/
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" PREFIX="%{_prefix}" \
	WITH_DATADIR=yes WITH_LIBDIR=yes WITH_CURRENTDIR=no  \
	DATADIR=%{_datadir}/%{name} LIBDIR="%{_libdir}/%{name}" OPTIMIZED_CFLAGS=no


%install
rm -rf %{buildroot}
%{__mkdir_p} %{buildroot}%{_libexecdir}/

cd source
install -D -m 755 release/crded %{buildroot}%{_libexecdir}/%{name}-server
%{__install} -D -m 755 release/crx %{buildroot}/%{_libexecdir}/%{name}
%{__install} -D -m 755 release/game.so %{buildroot}/%{_libdir}/%{name}/arena/game.so

# Create the alienarena startup script.
# Changes dir first, due to use of relative dir searches:
# http://corent.proboards42.com/index.cgi?board=bugreport&action=display&thread=3124
%{__cat} > %{name}.sh << EOF
#!/bin/bash
export LD_LIBRARY_PATH="%{_libdir}/alienarena/arena"
cd %{_datadir}/%{name} && exec %{_libexecdir}/%{name} "\$@"
EOF
%{__install} -D -m 755 %{name}.sh %{buildroot}/%{_bindir}/%{name}

# Create the alienarena-server startup script.
%{__cat} > %{name}-server.sh << EOF
#!/bin/bash
export LD_LIBRARY_PATH="%{_libdir}/alienarena/arena"
cd %{_datadir}/%{name} && exec %{_libexecdir}/%{name}-server "\$@"
EOF
%{__install} -D -m 755 %{name}-server.sh %{buildroot}/%{_bindir}/%{name}-server

%{__mkdir_p} %{buildroot}%{_datadir}/applications
desktop-file-install --vendor "fedora"			\
	--dir %{buildroot}%{_datadir}/applications	\
	%{SOURCE1}

mkdir -p %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/
install -m 644 %{SOURCE3} %{buildroot}/%{_datadir}/icons/hicolor/32x32/apps/%{name}.png

# Fedora's little opengl checker
ln -s opengl-game-wrapper.sh %{buildroot}/%{_bindir}/%{name}-wrapper


%clean
rm -rf $RPM_BUILD_ROOT


%post
update-desktop-database %{_datadir}/applications 2>/dev/null || :
gtk-update-icon-cache -qf %{_datadir}/icons/hicolor 2>/dev/null || :


%postun
update-desktop-database %{_datadir}/applications 2>/dev/null || :
gtk-update-icon-cache -qf %{_datadir}/icons/hicolor 2>/dev/null || :


%files
%defattr(-,root,root,-)
%doc GPL.acebot.txt
%{_bindir}/%{name}
%{_bindir}/%{name}-wrapper
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
%{_libdir}/%{name}/
%{_libexecdir}/%{name}
%doc docs/*


%files server
%defattr(-,root,root,-)
%{_bindir}/%{name}-server
%{_libexecdir}/%{name}-server
%doc docs/*


%changelog
* Mon Nov  2 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 7.32-1
- update to 7.32
- fix CVE-2009-3637 (bugzilla 530514)

* Wed Aug 12 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 7.30-2
- fix dlopen code to find proper openal library
- use openal-soft instead of old openal

* Thu Jul 30 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 7.30-1
- update to 7.30

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.21-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.21-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Fri Jan 30 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 7.21-1
- update to 7.21
- apply Paul's patch to print the search paths

* Wed Oct 29 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 7.20-5
- use /bin/bash for the scripts due to the export LD_LIBRARY_PATH

* Sun Oct 26 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 7.20-4
- re-enable "don't search data path" patch

* Sun Oct 26 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 7.20-3
- use LD_LIBRARY_PATH in scripts

* Sat Oct 25 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 7.20-2 
- drop old "don't search data path" patch
- call alienarena-wrapper in .desktop file

* Mon Oct 20 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 7.20-1
- sync up with Paul Bredbury's spec file
- update to 7.20

* Fri Sep 26 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 7.10-2
- drop fhs patch, use Makefile DATADIR options instead

* Wed Jul  2 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 7.10-1
- update to 7.10 (2008)

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 6.10-6
- Autorebuild for GCC 4.3

* Wed Nov 28 2007 Tom "spot" Callaway <tcallawa@redhat.com> 6.10-5
- generic optflags only

* Tue Nov 27 2007 Tom "spot" Callaway <tcallawa@redhat.com> 6.10-4
- lots of cleanups from review

* Fri Nov 16 2007 Tom "spot" Callaway <tcallawa@redhat.com> 6.10-3
- include legal clarification text for ace bot code
- simplify description

* Thu Nov 8 2007 Tom "spot" Callaway <tcallawa@redhat.com> 6.10-2
- make shell script launcher to get game working
  (run alienarena, not crx.sdl directly)

* Thu Nov 1 2007 Tom "spot" Callaway <tcallawa@redhat.com> 6.10-1
- Initial package for Fedora