File lincity-ng.spec of Package lincity-ng
#
# spec file for package lincity-ng
#
# Copyright (c) 2021 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/
#
%global base_version 2.9.beta
Name: lincity-ng
Version: %{base_version}+git.20210425
Release: 0
Summary: City Simulation Game
License: GPL-2.0-or-later
Group: Amusements/Games/Strategy/Real Time
URL: https://github.com/lincity-ng/lincity-ng
Source: %{name}-%{version}.tar.xz
BuildRequires: Mesa-devel
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: jam
BuildRequires: physfs-devel >= 1.0.0
BuildRequires: pkgconfig
BuildRequires: update-desktop-files
BuildRequires: vorbis-tools
BuildRequires: pkgconfig(SDL2_gfx)
BuildRequires: pkgconfig(SDL2_image)
BuildRequires: pkgconfig(SDL2_mixer)
BuildRequires: pkgconfig(SDL2_ttf)
BuildRequires: pkgconfig(libxml-2.0) >= 2.6.11
BuildRequires: pkgconfig(sdl2)
BuildRequires: pkgconfig(zlib)
Requires: %{name}-data = %{version}
%description
LinCity-NG is a city simulation game. It is a polished and improved
version of the classic LinCity game. Within the scope of the GoTM
project at happypenguin, a new iso-3D graphics engine was created with
a completely redone and modern GUI.
%package data
Summary: Data files for LinCity-NG
Group: Amusements/Games/Strategy/Real Time
Requires: %{name} = %{version}
BuildArch: noarch
%description data
Data files for LinCity-NG (the city simulation game).
%prep
%setup -q
cat data/gui/creditslist.xml |grep -v "@"|cut -d\> -f2|cut -d\< -f1 >CREDITS
sh ./autogen.sh
%build
%configure
jam %{?_smp_mflags}
%install
jam \
-s bindir=%{buildroot}%{_bindir} \
-s applicationsdir=%{buildroot}%{_datadir}/applications \
-s datadir=%{buildroot}%{_datadir} \
-s mandir=%{buildroot}%{_mandir} \
install
# Save some space by encoding provided sounds to ogg
for i in %{buildroot}%{_datadir}/%{name}/sounds/*.wav; do
oggenc --quiet "$i" && rm "$i"
done
sed -i "s/\.wav/.ogg/" %{buildroot}%{_datadir}/%{name}/sounds/sounds.xml
%suse_update_desktop_file -r %{name} Game StrategyGame
# install man-page
install -D -m 644 doc/%{name}.6 %{buildroot}%{_mandir}/man6/%{name}.6
# done by doc-macro
rm -rf %{buildroot}%{_datadir}/doc/%{name}-%{base_version}
%fdupes %{buildroot}%{_datadir}
%files
%license COPYING*
%doc README TODO CREDITS RELNOTES
%doc doc/lincityconfig.xml doc/userconfig.xml
%{_mandir}/man6/*
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%files data
%defattr(-,root,root)
%{_datadir}/%{name}/
%changelog