0ad/0ad.spec

185 lines
5.7 KiB
RPMSpec
Raw Normal View History

2012-02-02 00:12:10 +04:00
# http://trac.wildfiregames.com/wiki/BuildInstructions#Linux
2014-06-21 13:44:42 +11:00
# enable special maintainer debug build ?
%define with_debug 0
%if %{with_debug}
%define config debug
%define dbg _dbg
2012-02-02 00:12:10 +04:00
%else
2014-06-21 13:44:42 +11:00
%define config release
%define dbg %{nil}
2012-02-02 00:12:10 +04:00
%endif
2012-02-01 20:26:48 +04:00
2014-06-21 13:44:42 +11:00
%global with_system_nvtt 0
%global without_nvtt 1
Summary: Cross-Platform RTS Game of Ancient Warfare
Name: 0ad
2018-05-19 20:01:51 +03:00
Version: 0.0.23
2017-09-25 00:07:00 +03:00
Release: 1
2012-02-02 00:12:10 +04:00
Epoch: 1
License: GPLv2+ and BSD and MIT and IBM
Group: Games/Strategy
2014-06-21 13:44:42 +11:00
Url: http://play0ad.com
2016-04-05 01:52:18 +10:00
Source0: http://releases.wildfiregames.com/%{name}-%{version}-alpha-unix-build.tar.xz
# adapted from binaries/system/readme.txt
# It is advisable to review this file at on newer versions, to update the
# version field and check for extra options. Note that windows specific,
# and disabled options were not added to the manual page.
Source1: %{name}.6
2014-06-21 13:44:42 +11:00
# http://trac.wildfiregames.com/ticket/1421
Patch0: 0ad-rpath.patch
2014-06-21 13:44:42 +11:00
# Only do fcollada debug build with enabling debug maintainer mode
# It also prevents assumption there that it is building in x86
Patch1: 0ad-0.0.19-debug.patch
Patch2: 0ad-mozjs-incompatible.patch
2014-06-21 13:44:42 +11:00
# After some trial&error this corrects a %%check failure with gcc 4.9 on i686
Patch3: 0ad-check.patch
2014-06-21 13:44:42 +11:00
BuildRequires: cmake
BuildRequires: desktop-file-utils
2014-06-21 13:44:42 +11:00
BuildRequires: nasm
BuildRequires: subversion
BuildRequires: boost-devel
2012-02-02 00:12:10 +04:00
BuildRequires: jpeg-devel
BuildRequires: libdnet-devel
2014-06-21 13:44:42 +11:00
BuildRequires: miniupnpc-devel
%if %{with_system_nvtt}
2014-06-21 13:44:42 +11:00
BuildRequires: nvidia-texture-tools-devel
%endif
BuildRequires: wxgtku3.0-devel
2014-06-21 13:44:42 +11:00
BuildRequires: pkgconfig(gloox)
BuildRequires: pkgconfig(icu-i18n)
BuildRequires: pkgconfig(IL)
2012-02-02 00:12:10 +04:00
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(libenet)
BuildRequires: pkgconfig(libpng)
2018-05-19 20:01:51 +03:00
BuildRequires: pkgconfig(libsodium)
2014-06-21 13:44:42 +11:00
BuildRequires: pkgconfig(libxml-2.0)
2012-02-02 00:12:10 +04:00
BuildRequires: pkgconfig(libzip)
BuildRequires: pkgconfig(mozjs-38)
2015-11-30 02:55:58 +10:00
BuildRequires: pkgconfig(nspr)
2012-02-02 00:12:10 +04:00
BuildRequires: pkgconfig(openal)
2016-04-05 01:52:18 +10:00
BuildRequires: pkgconfig(sdl2)
2014-06-21 13:44:42 +11:00
BuildRequires: pkgconfig(vorbis)
Requires: %{name}-data
ExclusiveArch: %{ix86} x86_64
2012-02-01 20:26:48 +04:00
%description
0 A.D. (pronounced "zero ey-dee") is a free, open-source, cross-platform
real-time strategy (RTS) game of ancient warfare. In short, it is a
historically-based war/economy game that allows players to relive or rewrite
the history of Western civilizations, focusing on the years between 500 B.C.
and 500 A.D. The project is highly ambitious, involving state-of-the-art 3D
graphics, detailed artwork, sound, and a flexible and powerful custom-built
game engine.
The game has been in development by Wildfire Games (WFG), a group of volunteer,
hobbyist game developers, since 2001.
2013-09-12 16:26:19 +11:00
%files
%doc README.txt LICENSE.txt
2014-06-21 13:44:42 +11:00
%doc license_gpl-2.0.txt license_lgpl-2.1.txt
2013-09-12 16:26:19 +11:00
%{_gamesbindir}/0ad
%{_gamesbindir}/pyrogenesis%{dbg}
%{_libdir}/%{name}
%{_datadir}/pixmaps/%{name}.png
2014-06-21 13:44:42 +11:00
%{_datadir}/appdata/0ad.appdata.xml
2013-09-12 16:26:19 +11:00
%{_datadir}/applications/%{name}.desktop
%{_gamesdatadir}/%{name}
%{_mandir}/man6/*.6*
2014-06-21 13:44:42 +11:00
#----------------------------------------------------------------------------
2013-09-12 16:26:19 +11:00
2012-02-01 20:26:48 +04:00
%prep
2012-02-02 00:12:10 +04:00
%setup -q -n %{name}-%{version}-alpha
2014-06-21 13:44:42 +11:00
%patch0 -p1
%if !%{with_debug}
# disable debug build, and "int 0x3" to trap to debugger (x86 only)
%patch1 -p1
2014-06-21 13:44:42 +11:00
%endif
%patch2 -p1
2014-06-21 13:44:42 +11:00
%patch3 -p1
%if %{with_system_nvtt}
rm -fr libraries/nvtt
%endif
2012-02-01 20:26:48 +04:00
%build
2014-06-21 13:44:42 +11:00
export CC=%{__cc}
2012-02-01 20:26:48 +04:00
export CFLAGS="%{optflags}"
# avoid warnings with gcc 4.7 due to _FORTIFY_SOURCE in CPPFLAGS
export CPPFLAGS="`echo %{optflags} | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//'`"
2014-06-21 13:44:42 +11:00
build/workspaces/update-workspaces.sh \
--bindir %{_gamesbindir} \
--datadir %{_gamesdatadir}/%{name} \
--libdir %{_libdir}/%{name} \
--with-system-mozjs38 \
%if %{with_system_nvtt}
2014-06-21 13:44:42 +11:00
--with-system-nvtt \
%endif
%if %{without_nvtt}
2014-06-21 13:44:42 +11:00
--without-nvtt \
%endif
2014-06-21 13:44:42 +11:00
%{?_smp_mflags}
2012-02-01 20:26:48 +04:00
2012-02-02 00:12:10 +04:00
%make -C build/workspaces/gcc config=%{config} verbose=1
2012-02-01 20:26:48 +04:00
%install
2014-06-21 13:44:42 +11:00
export CC=%{__cc}
2012-02-02 00:12:10 +04:00
install -d -m 755 %{buildroot}%{_gamesbindir}
install -m 755 binaries/system/pyrogenesis%{dbg} %{buildroot}%{_gamesbindir}/pyrogenesis%{dbg}
2012-02-01 20:26:48 +04:00
install -d -m 755 %{buildroot}%{_libdir}/%{name}
for name in AtlasUI%{dbg} Collada%{dbg}; do
2017-09-25 00:07:00 +03:00
install -m 755 binaries/system/lib${name}.so %{buildroot}%{_libdir}/%{name}/lib${name}.so
2012-02-02 00:12:10 +04:00
done
%if !%{without_nvtt} && !%{with_system_nvtt}
for name in nvcore nvimage nvmath nvtt; do
2017-09-25 00:07:00 +03:00
install -p -m 755 binaries/system/lib${name}.so %{buildroot}%{_libdir}/%{name}/lib${name}.so
done
%endif
2014-06-21 13:44:42 +11:00
install -d -m 755 %{buildroot}%{_datadir}/appdata
install -p -m 644 build/resources/0ad.appdata.xml %{buildroot}%{_datadir}/appdata
2012-02-02 00:12:10 +04:00
install -d -m 755 %{buildroot}%{_gamesdatadir}/applications
install -m 644 build/resources/0ad.desktop %{buildroot}%{_gamesdatadir}/applications/%{name}.desktop
perl -pi -e 's|%{_bindir}/0ad|%{_gamesbindir}/0ad|;' \
2017-09-25 00:07:00 +03:00
%{buildroot}%{_gamesdatadir}/applications/%{name}.desktop
2012-02-01 20:26:48 +04:00
2012-02-02 00:12:10 +04:00
install -d -m 755 %{buildroot}%{_gamesdatadir}/pixmaps
install -m 644 build/resources/0ad.png %{buildroot}%{_gamesdatadir}/pixmaps/%{name}.png
2012-02-01 20:26:48 +04:00
2012-02-02 00:12:10 +04:00
install -d -m 755 %{buildroot}%{_gamesdatadir}/%{name}
cp -a binaries/data/* %{buildroot}%{_gamesdatadir}/%{name}
2012-02-01 20:26:48 +04:00
install -d -m 755 %{buildroot}%{_mandir}/man6
install -p -m 644 %{SOURCE1} %{buildroot}%{_mandir}/man6/%{name}.6
ln -sf %{name}.6 %{buildroot}%{_mandir}/man6/pyrogenesis.6
2014-06-21 13:44:42 +11:00
desktop-file-validate %{buildroot}%{_gamesdatadir}/applications/%{name}.desktop
2012-03-21 05:19:18 +04:00
mkdir -p %{buildroot}%{_datadir}
mv -f %{buildroot}%{_gamesdatadir}/{pixmaps,applications} %{buildroot}%{_datadir}
2012-02-02 00:12:10 +04:00
cat > %{buildroot}%{_gamesbindir}/0ad <<EOF
#!/bin/sh
2012-02-01 20:26:48 +04:00
2012-02-02 00:12:10 +04:00
cd %{_gamesdatadir}/0ad
LD_LIBRARY_PATH=%{_libdir}/0ad %{_gamesbindir}/pyrogenesis%{dbg} "\$@"
EOF
chmod +x %{buildroot}%{_gamesbindir}/0ad
2012-02-01 20:26:48 +04:00
2012-02-02 00:12:10 +04:00
%if %{with debug}
export EXCLUDE_FROM_FULL_STRIP="libAtlasUI_dbg.so libCollada_dbg.so pyrogenesis_dbg"
%endif
2013-09-12 16:26:19 +11:00
# Depends on availablity of nvtt
%if !%{without_nvtt}
%check
2014-06-21 13:44:42 +11:00
export CC=%{__cc}
LD_LIBRARY_PATH=binaries/system binaries/system/test%{dbg}
2013-09-12 16:26:19 +11:00
%endif