File manaverse.spec of Package manaverse-testing

%global enable_debug 1
%global enable_tcmalloc 1
%global enable_werror 0

%global _optflags %{_optflags} -O0 -g
%global optflags %{optflags} -O0 -g
%global cflags %{cflags} -O0 -g
%global cxxflags %{cxxflags} -O0 -g
%global _prefix /opt/manaplus-testing/

Name:		manaverse-testing
Summary:	Official client for The Mana World and Evol Online
License:	GPL-2.0-or-later
URL:		https://manaplus.germantmw.de/
Version:	1.0
Release:	1%{?dist}
Group:		Amusements/Games/Other
Prefix:		/opt/manaverse-testing

# The "v" preceding %%{version} is intentional. This is the way upstream
# names their archives.
# NOTE:	This may need to be adjusted once a new version comes out.
Source0:	verse-v%{version}.tar.bz2
Source1:	rpmlintrc

Obsoletes:	manaplus = 1.9.2.23

Provides:	evolonline-client = %{version}-%{release}
Provides:	manaworld-client = %{version}-%{release}

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

Recommends:	%{name}-lang = %{version}-%{release}

Requires:	xdg-utils
Requires:	xsel

Suggests:	mumble

BuildRequires:	autoconf
BuildRequires:	automake
BuildRequires:	binutils
BuildRequires:	gcc-c++
BuildRequires:	hicolor-icon-theme
BuildRequires:	make
BuildRequires:	pkgconfig

BuildRequires:	pkgconfig(gl)
BuildRequires:	pkgconfig(glu)
BuildRequires:	pkgconfig(libcurl)
BuildRequires:	pkgconfig(libpng)
BuildRequires:	pkgconfig(libxml-2.0)
BuildRequires:	pkgconfig(physfs)
BuildRequires:	pkgconfig(sdl)
BuildRequires:	pkgconfig(SDL_gfx)
BuildRequires:	pkgconfig(SDL_image)
BuildRequires:	pkgconfig(SDL_mixer)
BuildRequires:	pkgconfig(SDL_net)
BuildRequires:	pkgconfig(SDL_ttf)
BuildRequires:	pkgconfig(zlib)

%if 0%{?fedora}
BuildRequires:	jack-audio-connection-kit-devel
%else
BuildRequires:	pkgconfig(jack)
%endif

%if 0%{?enable_debug}
BuildRequires:	binutils-devel
BuildRequires:	gdb
BuildRequires:	libdwarf-devel
BuildRequires:	valgrind-devel

Requires:	gdb
Requires:	valgrind

%if 0%{?suse_version}
BuildRequires:	libdw-devel
%else
BuildRequires:	elfutils-devel
%endif
%endif

%if 0%{?enable_tcmalloc}
BuildRequires:	gperf
BuildRequires:	gperftools-devel
# Needed only on openSUSE
%if  0%{?suse_version}
BuildRequires:	libtcmalloc4
%endif
%else
%if 0%{?enable_debug}
BuildRequires:	gperf
BuildRequires:	gperftools-devel
%if  0%{?suse_version}
BuildRequires:	libtcmalloc4
%endif
%endif
%endif

%if 0%{?suse_version}
BuildRequires:	gettext-tools
%else
BuildRequires:	gettext
%endif

%if 0%{?mageia}
BuildRequires:	gettext-base
%else
BuildRequires:	gettext-runtime
%endif

%package common
Summary:	Common files for %{name}
BuildArch:	noarch
Group:	Amusements/Games/Other

%package doc
Summary:	Documentation for %{name}
BuildArch:	noarch
Group:	Amusements/Games/Other

%package lang
Summary:	Language files for %{name}
BuildArch:	noarch
Group:		Amusements/Games/Other

%description
ManaVerse is an extended client for Evol Online, The Mana World and similar
servers based on eAthena forks. ManaVerse is the successor to ManaPlus.

As a 2D style game, Evol Online aims to create a friendly environment where 
people can escape reality and interact with others while enjoying themselves 
through a fantasy style game.

The Mana World (TMW) is a serious effort to create an innovative free and 
open source MMORPG. TMW uses 2D graphics and aims to create a large and 
diverse interactive world.

%description common
Files that are common for all installations of %{name}.

%description doc
Dcoumentation for %{name}

%description lang
Language files for %{name}

%prep
%setup -n verse-v%{version}

autoreconf -i

%build
%configure \
	%if 0%{?enable_debug}
		--enable-checks \
		--enable-asserts \
		--enable-glibcdebug \
		--enable-stldebug \
		--enable-openglerrors \
	%endif
	%if 0%{?enable_werror}
		--enable-werror \
	%endif
	%if 0%{?enable_tcmalloc}
		--enable-tcmalloc \
	%endif
	--datadir=%{_datadir}/games \
	--enable-tmwa

cd po
%__make update-gmo
cd ..

%__make

%install
%make_install

%check
make check

%files
%license COPYING
%doc AUTHORS ChangeLog docs/*.txt README
%{_bindir}/*

# The files list for the -common package changes depending on whether we're
# building 1.9.3.23, or something newer
%files common

%dir %{_prefix}
%dir %{_bindir}
%dir %{_datadir}/
%dir %{_datadir}/games
%dir %{_datadir}/icons
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/scalable
%dir %{_datadir}/icons/hicolor/scalable/apps

%{_datadir}/applications/*
%dir %{_datadir}/games/manaverse/
%dir %{_datadir}/games/manaverse/data/
%dir %{_datadir}/games/manaverse/data/fonts/
%{_datadir}/games/manaverse/data/fonts/*
%dir %{_datadir}/games/manaverse/data/graphics/
%dir %{_datadir}/games/manaverse/data/graphics/badges/
%{_datadir}/games/manaverse/data/graphics/badges/*
%dir %{_datadir}/games/manaverse/data/graphics/flags/
%{_datadir}/games/manaverse/data/graphics/flags/*
%dir %{_datadir}/games/manaverse/data/graphics/gui/
%{_datadir}/games/manaverse/data/graphics/gui/*
%dir %{_datadir}/games/manaverse/data/graphics/images/
%{_datadir}/games/manaverse/data/graphics/images/*
%dir %{_datadir}/games/manaverse/data/graphics/shaders/
%{_datadir}/games/manaverse/data/graphics/shaders/*
%dir %{_datadir}/games/manaverse/data/graphics/sprites/
%{_datadir}/games/manaverse/data/graphics/sprites/*
%dir %{_datadir}/games/manaverse/data/help/
%dir %{_datadir}/games/manaverse/data/help/idx/
%{_datadir}/games/manaverse/data/help/idx/*
%dir %{_datadir}/games/manaverse/data/help/tips/
%{_datadir}/games/manaverse/data/help/tips/*
%{_datadir}/games/manaverse/data/help/*.txt
%dir %{_datadir}/games/manaverse/data/icons/
%{_datadir}/games/manaverse/data/icons/*
%dir %{_datadir}/games/manaverse/data/music/
%{_datadir}/games/manaverse/data/music/*
%dir %{_datadir}/games/manaverse/data/perserver/
%dir %{_datadir}/games/manaverse/data/perserver/default/
%{_datadir}/games/manaverse/data/perserver/default/*
%dir %{_datadir}/games/manaverse/data/sfx/
%dir %{_datadir}/games/manaverse/data/sfx/system/
%{_datadir}/games/manaverse/data/sfx/system/*
%dir %{_datadir}/games/manaverse/data/test/
%{_datadir}/games/manaverse/data/test/**
%dir %{_datadir}/games/manaverse/data/themes/
%dir %{_datadir}/games/manaverse/data/themes/blacknblack/
%{_datadir}/games/manaverse/data/themes/blacknblack/*
%dir %{_datadir}/games/manaverse/data/themes/blackwood/
%{_datadir}/games/manaverse/data/themes/blackwood/*
%dir %{_datadir}/games/manaverse/data/themes/enchilado/
%{_datadir}/games/manaverse/data/themes/enchilado/*
%dir %{_datadir}/games/manaverse/data/themes/golden-delicious/
%{_datadir}/games/manaverse/data/themes/golden-delicious/*
%dir %{_datadir}/games/manaverse/data/themes/jewelry-simple/
%{_datadir}/games/manaverse/data/themes/jewelry-simple/*
%dir %{_datadir}/games/manaverse/data/themes/jewelry/
%{_datadir}/games/manaverse/data/themes/jewelry/*
%dir %{_datadir}/games/manaverse/data/themes/mana/
%{_datadir}/games/manaverse/data/themes/mana/*
%dir %{_datadir}/games/manaverse/data/themes/pink/
%{_datadir}/games/manaverse/data/themes/pink/*
%dir %{_datadir}/games/manaverse/data/themes/unity/
%{_datadir}/games/manaverse/data/themes/unity/*
%dir %{_datadir}/games/manaverse/data/themes/wood/
%{_datadir}/games/manaverse/data/themes/wood/*
%{_datadir}/icons/hicolor/scalable/apps/*
%{_datadir}/metainfo/*

%files doc
%{_mandir}/man6/*

%files lang

%dir %{_datadir}/games/manaverse/data/translations
%dir %{_datadir}/games/manaverse/data/translations/test
%dir %{_datadir}/locale
%dir %{_datadir}/locale/ca
%dir %{_datadir}/locale/ca/LC_MESSAGES
%dir %{_datadir}/locale/cs
%dir %{_datadir}/locale/cs/LC_MESSAGES
%dir %{_datadir}/locale/de
%dir %{_datadir}/locale/de/LC_MESSAGES
%dir %{_datadir}/locale/eo
%dir %{_datadir}/locale/eo/LC_MESSAGES
%dir %{_datadir}/locale/es
%dir %{_datadir}/locale/es/LC_MESSAGES
%dir %{_datadir}/locale/fi
%dir %{_datadir}/locale/fi/LC_MESSAGES
%dir %{_datadir}/locale/fr
%dir %{_datadir}/locale/fr/LC_MESSAGES
%dir %{_datadir}/locale/id
%dir %{_datadir}/locale/id/LC_MESSAGES
%dir %{_datadir}/locale/it
%dir %{_datadir}/locale/it/LC_MESSAGES
%dir %{_datadir}/locale/ja
%dir %{_datadir}/locale/ja/LC_MESSAGES
%dir %{_datadir}/locale/nl
%dir %{_datadir}/locale/nl/LC_MESSAGES
%dir %{_datadir}/locale/nl_BE
%dir %{_datadir}/locale/nl_BE/LC_MESSAGES
%dir %{_datadir}/locale/pl
%dir %{_datadir}/locale/pl/LC_MESSAGES
%dir %{_datadir}/locale/pt
%dir %{_datadir}/locale/pt/LC_MESSAGES
%dir %{_datadir}/locale/pt_BR
%dir %{_datadir}/locale/pt_BR/LC_MESSAGES
%dir %{_datadir}/locale/ru
%dir %{_datadir}/locale/ru/LC_MESSAGES
%dir %{_datadir}/locale/sr
%dir %{_datadir}/locale/sr/LC_MESSAGES
%dir %{_datadir}/locale/sv
%dir %{_datadir}/locale/sv/LC_MESSAGES
%dir %{_datadir}/locale/sv_SE
%dir %{_datadir}/locale/sv_SE/LC_MESSAGES
%dir %{_datadir}/locale/tr
%dir %{_datadir}/locale/tr/LC_MESSAGES
%dir %{_datadir}/locale/uk
%dir %{_datadir}/locale/uk/LC_MESSAGES
%dir %{_datadir}/locale/zh_CN
%dir %{_datadir}/locale/zh_CN/LC_MESSAGES
%dir %{_datadir}/locale/zh_HK
%dir %{_datadir}/locale/zh_HK/LC_MESSAGES

%dir %{_datadir}/games/manaverse/data/translations/help/
%{_datadir}/games/manaverse/data/translations/help/*
%{_datadir}/games/manaverse/data/translations/test/*
%{_datadir}/locale/*/LC_MESSAGES/*

%changelog
* Sat Dec 13 2025 Kristopher Gamrat <gamrat.kristopher@protonmail.com 1.9.3.23-9
- Simplify BuildRequires
- Correctly generate lang package
- Simplify some of build logic

* Thu Dec 11 2025 Kristopher Gamrat <gamrat.kristopher@protonmail.com 1.9.3.23-8
- Update spec file to build latest git version of ManaVerse while maintaining
  compatibility with latest stable with a bit of logic.
- Add logic to decide whether or not to enable certain build flags
- Add support for having make run multiple jobs in parallel
- Add building against tcmalloc

* Tue Dec 09 2025 Kristopher Gamrat <gamrat.kristopher@protonmail.com> 1.9.3.23-7
- Drop Fedora support due to broken OBS support
- Update dumplibs patch
- Ensure BuildRequires are correct

* Wed Mar 26 2025 Kristopher Gamrat <gamrat.kristopher@protonmail.com> 1.9.3.23-6
- Disable compiler optimization for gdb debugging
* Fri Mar 07 2025 Kristopher Gamrat <gamrat.kristopher@protonmail.com> 1.9.3.23-5
- Remove PulseAudio requirement. Enabling audio without PulseAudio installed
  seems to be fixed on openSUSE.
- Fix XDG requirement.

* Tue Mar 04 2025 Kristopher Gamrat <gamrat.kristopher@protonmail.com> 1.9.3.23-4
- Add xsel and xdg-utils to Requires per the README on the GitLab page.

* Mon Feb 24 2025 Kristopher Gamrat <gamrat.kristopher@protonmail.com> 1.9.3.23-3
- Add pulseaudio and alsa-plugins-pulse as Requires to prevent a crash when
  enabling audio.

* Sat Feb 15 2025 Kristopher Gamrat <gamrat.kristopher@protonmail.com> 1.9.3.23-2
- Set up BuildRequires across multiple distributions supported by the
  official OBS instance
- Apply several patches to fix builds on newer toolchains
- Learn how to use the %%find_lang macro
- Ensure the -g option is included in compiler flags so debug symbols are
  built for distros that support generating a debug package.

* Wed Feb 12 2025 Kristopher Gamrat <gamrat.kristopher@protonmail.com> 1.9.3.23-1
- Initial Release
openSUSE Build Service is sponsored by