File enemy-territory.spec of Package enemy-territory
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: enemy-territory
BuildRequires: curl-devel
BuildRequires: nasm
BuildRequires: unzip
BuildRequires: scons
BuildRequires: gcc-c++
BuildRequires: dos2unix
%if 0%{?fedora_version}
BuildRequires: libXxf86vm-devel
BuildRequires: libXxf86dga-devel
BuildRequires: mesa-libGL-devel
BuildRequires: mesa-libGLU-devel
BuildRequires: libstdc++-static
%endif
%if 0%{?mandriva_version}
BuildRequires: mesagl-devel
BuildRequires: mesaglu-devel
BuildRequires: libstdc++-devel
BuildRequires: libxxf86dga-devel
%endif
%if 0%{?suse_version}
BuildRequires: Mesa-devel
%endif
%if 0%{?suse_version} > 1210
BuildRequires: libXxf86dga-devel
BuildRequires: libXxf86vm-devel
BuildRequires: Mesa-libGL-devel
BuildRequires: Mesa-libGLU-devel
%endif
License: GPL-3.0
Url: http://iowolfet.org/
Group: Amusements/Games/3D/Shoot
Version: 2.60d
Release: 1
Summary: Wolfenstein: Enemy Territory
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: ET-GPL.zip
Patch0: 0001-don-t-link-X-libs-statically.diff
Patch1: 0002-disable-buffered-output-hack.-doesn-t-seem-to-work-wi.diff
Patch2: 0003-enable-64bit-build.diff
Patch4: 0005-build-with-system-curl.diff
Patch5: 0006-use-libsupc-instead-of-hack-for-static-libstdc.diff
Patch6: 0007-prepare-for-64bit-support.diff
Patch7: 0008-set-version-string-for-x86_64.diff
Requires: enemy-territory-data
%description
This package only includes the binary files, you still need the data files.
Please keep in mind that this is unmaintained software with security problems.
You might want to install the community patched etlegacy instead.
%prep
%setup -q -n ET-GPL
%patch0 -p1
%patch1 -p1
%patch2 -p1
rm -rf src/curl-7.12.2
#patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
dos2unix COPYING.txt
%build
cat > dobuild <<'EOF'
#!/bin/sh
cd src
scons %{?jobs:JOBS=%jobs} \
BUILD=release \
"$@"
EOF
chmod 755 dobuild
#
./dobuild
#
%install
cd src
arch=`uname -m`
case $arch in
i?86) arch=x86 ;;
esac
etdir=%{buildroot}%{_prefix}/lib/%name
install -d -m 755 $etdir
install -d -m 755 $etdir/etmain/vm
install -m 755 et.$arch $etdir/
install -m 755 etded.$arch $etdir/
install -m 644 *.so $etdir/etmain
mkdir -p %{buildroot}%{_bindir}
cat >> %{buildroot}%{_bindir}/enemy-territory.sh <<EOF
#!/bin/sh
cd %{_prefix}/lib/enemy-territory
exec %{_prefix}/lib/enemy-territory/et.$arch \
+set fs_libpath "%{_prefix}/lib/enemy-territory" \
+set fs_basepath "%{_prefix}/lib/enemy-territory" \
"$@"
EOF
chmod +x %{buildroot}%{_bindir}/enemy-territory.sh
cat >> %{buildroot}%{_bindir}/enemy-territory-server.sh <<EOF
#!/bin/sh
cd %{_prefix}/lib/enemy-territory
exec %{_prefix}/lib/enemy-territory/etded.$arch \
+set fs_libpath "%{_prefix}/lib/enemy-territory" \
+set fs_basepath "%{_prefix}/lib/enemy-territory" \
"$@"
EOF
chmod +x %{buildroot}%{_bindir}/enemy-territory-server.sh
%files
%defattr(-,root,root)
%doc COPYING.txt README.txt
%{_bindir}/*
%dir %{_prefix}/lib/%name
%{_prefix}/lib/%name
%dir %{_prefix}/lib/%name/etmain
%{_prefix}/lib/%name/etmain
%dir %{_prefix}/lib/%name/etmain/vm
%changelog