File dark-oberon.spec of Package dark-oberon
#
# spec file for package dark-oberon
#
# Copyright (c) 2023 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
Name: dark-oberon
Version: svn.2009.08.20
Release: 0
Summary: Real-time strategy game similar to Warcraft II
License: GPL-2.0-only
Group: Amusements/Games/Strategy/Real Time
URL: https://dark-oberon.sourceforge.net/
Source: dark-oberon-svn-2009-08-20.tar.bz2
# PATCH-FIX-OPENSUSE dark-oberon-Makefile.patch
Patch0: dark-oberon-Makefile.patch
# PATCH-FIX-UPSTREAM fix-bool-as-ptr.patch -- https://sourceforge.net/p/dark-oberon/patches/3/
Patch1: fix-bool-as-ptr.patch
BuildRequires: ctags
BuildRequires: gcc-c++
BuildRequires: glfw2-devel
BuildRequires: pkgconfig
BuildRequires: pkgconfig(glu)
BuildRequires: pkgconfig(sdl)
BuildRequires: pkgconfig(SDL_mixer)
%description
Dark Oberon is an open source real-time strategy game similar to Warcraft II released under GPL.
It has got unique graphics - textures created from shots of real models made out of plasticine!
%prep
%setup -q -n dark-oberon
%patch -P 0 -p1
%patch -P 1 -p1
find . -name "*.h" | xargs sed -i -e "s:<DATADIR>:%{_datadir}/dark-oberon:"
find . -name "*.cpp" | xargs sed -i -e "s:<DATADIR>:%{_datadir}/dark-oberon:"
sed -i -e "s:/usr/lib:%{_libdir}:g" src/create_makefile.sh
cd src && sh ./create_makefile.sh && cd ..
%build
export CXXFLAGS="%{optflags}"
%make_build
%install
install -d %{buildroot}%{_bindir}
install dark-oberon %{buildroot}%{_bindir}
install -d %{buildroot}%{_datadir}/dark-oberon/
cp -rfv dat/ %{buildroot}%{_datadir}/dark-oberon/
cp -rfv maps/ %{buildroot}%{_datadir}/dark-oberon/
cp -rfv races/ %{buildroot}%{_datadir}/dark-oberon/
cp -rfv schemes/ %{buildroot}%{_datadir}/dark-oberon/
%files
%{_bindir}/dark-oberon
%dir %{_datadir}/dark-oberon
%dir %{_datadir}/dark-oberon/dat
%dir %{_datadir}/dark-oberon/maps
%dir %{_datadir}/dark-oberon/races
%dir %{_datadir}/dark-oberon/schemes
%{_datadir}/dark-oberon/dat/*
%{_datadir}/dark-oberon/maps/*
%{_datadir}/dark-oberon/races/*
%{_datadir}/dark-oberon/schemes/*
%changelog