Sophie

Sophie

distrib > Mageia > cauldron > i586 > media > core-release-src > by-pkgid > 8c98aa6fa0a996cbae83eaa4adf6d117 > files > 12

btanks-0.9.8083-18.mga9.src.rpm

Name:		btanks
Version:	0.9.8083
Release:	%mkrel 18
Summary:	Funny battle on your desk
Group:		Games/Arcade
# Libraries clunk, mrt and sdlx are under LGPLv2+, all other sources are GPLv2+
License:	GPLv2+ with exceptions and LGPLv2+
URL:		http://btanks.sourceforge.net/
Source0:	https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
# Remove RPath from binaries
Patch0:		%{name}-remove-rpath.patch
# Disable video previews of map levels (we don't distribute video anyway)
Patch1:		%{name}-disable-smpeg.patch
# Avoid problem with lib checks using c++ instead of c.
Patch2:		%{name}-libcheck.patch
# Don't override Fedora's options
Patch3:		%{name}-excessopts.patch
# gcc is now more picky about casting
Patch4:		%{name}-gcc.patch
# bted doesn't explicitly link to clunl
Patch5:		%{name}-dso.patch
Patch6:		%{name}-gcc4.7.patch
# fix build against lua 5.2
Patch7:		%{name}-0.9.8083-lua-5.2.patch
# fix build against scons >= 3.0.3
Patch8:		%{name}-scons-3.0.3.patch
# fix build with py3 scons
Patch9:		btanks-py3-scons.patch

BuildRequires:	pkgconfig(glu)
BuildRequires:	pkgconfig(sdl)
BuildRequires:	pkgconfig(SDL_image)
BuildRequires:	pkgconfig(expat)
BuildRequires:	pkgconfig(vorbis)
BuildRequires:	pkgconfig(lua)
BuildRequires:	pkgconfig(zlib)
BuildRequires:	scons
BuildRequires:	zip
BuildRequires:	dos2unix
# Disabled video previews of map levels
BuildRequires:	smpeg-devel

Requires:	%{name}-data = %{version}-%{release}

%description
Battle Tanks is a funny battle on your desk, where you can choose one of three
vehicles and eliminate your enemy using the whole arsenal of weapons. has
original cartoon-like graphics and cool music, it is fun and dynamic, it has
several network modes for deathmatch and cooperative.
What else is needed to have fun with your friends?

And all is packed and ready for you in Battle Tanks.

%package	data
Summary:	Data files for %{name}
Group:		Games/Arcade
Requires:	%{name} >= %{version}-%{release}
BuildArch:	noarch

%description	data
The %{name}-data package contains data files that are needed for
running %{name}.

%prep
%setup -q
%patch0 -b .remove-rpath
%patch1 -b .disable-smpeg
%patch2 -b .libcheck
%patch3 -b .excessopts
%patch4 -b .gcc
%patch5 -b .dso
%patch6 -p1 -b .gcc47
%patch7 -p1 -b .lua-52
%patch8 -p1 -b .scons
%patch9 -p1 -b .py3

dos2unix -k *.txt ChangeLog *.url LICENSE LICENSE.EXCEPTION

iconv -f latin1 -t utf-8 LICENSE.EXCEPTION > LICENSE.EXCEPTION.new
touch -r LICENSE.EXCEPTION{,.new}
mv -f LICENSE.EXCEPTION{.new,}

iconv -f latin1 -t utf-8 README-fr.txt > README-fr.txt.new
touch -r README-fr.txt{,.new}
mv -f README-fr.txt{.new,}

iconv -f cp1251 -t utf-8 README-ru.txt > README-ru.txt.new
touch -r README-ru.txt{,.new}
mv -f README-ru.txt{.new,}

# fix build with glibc >= 2.27
sed -i -e 's,pow10f,exp10f,g' clunk/source.cpp

%build
# flags need to be passed via environment or they get treated as a single
# word rather than as multiple arguments. CXXFLAGS is only needed if
# there are c++ only flags that need to get added.
%set_build_flags
%scons \
        prefix=%{_prefix} \
        lib_dir=%{_libdir} \
        plugins_dir=%{_libdir}/%{name} \
        resources_dir=%{_gamesdatadir}/%{name} \
        mode=release \
        enable_lua=true

%install
# binaries
install -dm 755 %{buildroot}%{_gamesbindir}
install -m 755 build/release/engine/%{name} %{buildroot}%{_gamesbindir}
install -m 755 build/release/editor/bted %{buildroot}%{_gamesbindir}

# libs
install -dm 755 %{buildroot}%{_libdir}/%{name}
install -m 755 build/release/engine/libbtanks_engine.so %{buildroot}%{_libdir}
install -m 755 build/release/mrt/libmrt.so %{buildroot}%{_libdir}
install -m 755 build/release/sdlx/libsdlx.so %{buildroot}%{_libdir}
install -m 755 build/release/clunk/libclunk.so %{buildroot}%{_libdir}

# plugins
install -m 755 build/release/objects/libbt_objects.so %{buildroot}%{_libdir}/%{name}

# data-files (see pack-resources.sh)
install -dm 755 %{buildroot}%{_gamesdatadir}/%{name}
install -dm 755 %{buildroot}%{_gamesdatadir}/%{name}/data
pushd data
find . \( -wholename \*.svn\* -or -name \*.wav \) -exec rm -rf {} \;
cp -pR * %{buildroot}%{_gamesdatadir}/%{name}/data
#zip -q -0 -r ../resources.dat * -x \*.svn\* -x \*.wav
popd

# icon
install -dm 755 %{buildroot}%{_datadir}/pixmaps
install -D data/tiles/icon.png %{buildroot}%{_iconsdir}/%{name}.png

# menu-entries
install -d %{buildroot}%{_datadir}/applications
cat > %{buildroot}%{_datadir}/applications/%{name}.desktop << EOF
[Desktop Entry]
Name=Battle Tanks
Comment=Battle Tanks is a funny battle on your desk
Exec=%{_gamesbindir}/%{name}
Icon=%{gname}
Terminal=false
Type=Application
StartupNotify=true
Categories=Game;ArcadeGame;
EOF

cat > %{buildroot}%{_datadir}/applications/bted.desktop << EOF
[Desktop Entry]
Name=Battle Tanks map editor
Comment=Battle Tanks map editor
Exec=%{_gamesbindir}/bted
Icon=%{name}
Terminal=false
Type=Application
StartupNotify=true
Categories=Game;ArcadeGame;
EOF

%files
%doc README-{editor,en,fr,ru}.txt ChangeLog *.url LICENSE LICENSE.EXCEPTION
%{_gamesbindir}/%{name}
%{_gamesbindir}/bted
%{_libdir}/*.so
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/*.so
%{_iconsdir}/%{name}.png
%{_datadir}/applications/%{name}.desktop
%{_datadir}/applications/bted.desktop

%files data
%dir %{_gamesdatadir}/%{name}
%{_gamesdatadir}/%{name}/data


%changelog
* Wed Mar 16 2022 danf <danf> 0.9.8083-18.mga9
+ Revision: 1794309
- Extend the python3 patch to fix building

* Sat Apr 10 2021 wally <wally> 0.9.8083-17.mga9
+ Revision: 1714568
- rebuild for lua 5.4

* Tue Feb 18 2020 umeabot <umeabot> 0.9.8083-16.mga8
+ Revision: 1541139
- Mageia 8 Mass Rebuild
+ wally <wally>
- replace deprecated %%setup_compile_flags

* Sat Dec 21 2019 wally <wally> 0.9.8083-15.mga8
+ Revision: 1469330
- fix build with py3 scons

* Fri Apr 05 2019 daviddavid <daviddavid> 0.9.8083-14.mga7
+ Revision: 1385973
- switch to Python2 scons support

* Fri Feb 08 2019 daviddavid <daviddavid> 0.9.8083-13.mga7
+ Revision: 1364233
- add patch to fix build with scons >= 3.0.3
  * Remove long deprecated SCons.Options replaced by *Variable() many years ago

* Sat Sep 22 2018 umeabot <umeabot> 0.9.8083-12.mga7
+ Revision: 1295687
- Mageia 7 Mass Rebuild

* Mon Jun 18 2018 wally <wally> 0.9.8083-11.mga7
+ Revision: 1237894
- fix build with glibc >= 2.27

* Thu Sep 28 2017 daviddavid <daviddavid> 0.9.8083-10.mga7
+ Revision: 1161151
- patch7: fix build with lua 5.2
- patch8: fix build with scons 3.0

* Sat Feb 06 2016 umeabot <umeabot> 0.9.8083-9.mga6
+ Revision: 941551
- Mageia 6 Mass Rebuild

* Wed Oct 15 2014 umeabot <umeabot> 0.9.8083-8.mga5
+ Revision: 744890
- Second Mageia 5 Mass Rebuild

* Thu Sep 18 2014 umeabot <umeabot> 0.9.8083-7.mga5
+ Revision: 693517
- Rebuild to fix library dependencies

* Tue Sep 16 2014 umeabot <umeabot> 0.9.8083-6.mga5
+ Revision: 678234
- Mageia 5 Mass Rebuild

* Fri Oct 18 2013 umeabot <umeabot> 0.9.8083-5.mga4
+ Revision: 503167
- Mageia 4 Mass Rebuild

* Fri Jan 11 2013 umeabot <umeabot> 0.9.8083-4.mga3
+ Revision: 347209
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Tue Jan 08 2013 sander85 <sander85> 0.9.8083-3.mga3
+ Revision: 343066
- Switch BR to lua5.1
- Fix build with GCC 4.7

* Mon Nov 14 2011 zezinho <zezinho> 0.9.8083-2.mga2
+ Revision: 167610
- imported package btanks