aa9fb75
%global		gittag0			2023-09-14-Release-2.9.0
d52aafe
d52aafe
%define			lang_subpkg() \
d52aafe
%package		langpack-%{1}\
d52aafe
Summary:		%{2} language data for %{name}\
abedfe5
BuildArch:	noarch\
7e2d002
Requires:		%{name} = %{version}-%{release}\
d52aafe
Supplements:	(%{name} = %{version}-%{release} and langpacks-%{1})\
d52aafe
\
d52aafe
%description	langpack-%{1}\
d52aafe
%{2} language data for %{name}.\
d52aafe
\
d52aafe
%files			langpack-%{1}\
d52aafe
%{_datadir}/%{name}/translations/%{name}_%{1}.qm\
d52aafe
%{_datadir}/oracle/translations/oracle_%{1}.qm
d52aafe
d52aafe
Name:		cockatrice
aa9fb75
Version:	2.9.0
b0866ca
Release:	%autorelease
d52aafe
Summary:	A cross-platform virtual tabletop software for multi-player card games
d52aafe
d52aafe
# * Public Domain (cockatrice/resources/countries/*.svg)
d52aafe
# * GPLv2+ (most of the code)
d52aafe
# * BSD (cockatrice/src/qt-json/, common/sfmt/, 
d52aafe
# * GPLv2 (oracle/src/zip/)
d52aafe
# * CPL or LGPLv2 (servatrice/src/smtp/)
d52aafe
# # Webclient code (not included?)
d52aafe
# * ASL 2.0 (webclient/js/protobuf.js, webclient/js/long.js,
d52aafe
# webclient/js/bytebuffer.js)
d52aafe
# * MIT (webclient/js/jquery-*.js)
d52aafe
License:	GPLv2 and Public Domain
d52aafe
URL:		https://%{name}.github.io
fb5a4d7
Source0:	https://github.com/%{name}/%{name}/archive/%{gittag0}.tar.gz
d52aafe
Source1:	cockatrice.appdata.xml
d52aafe
Patch0:		cockatrice-ea9e966330-fix-desktop-entry-files.patch
a8be709
# Support MacOS 12 & 13. Support Protobuf 23. Deprecate MacOS 11. (#4884)
a8be709
# https://github.com/Cockatrice/Cockatrice/commit/ee674cb0cfa42875eef1a0a80597840816ad86ea
a8be709
# Backported to the 2.9.0 release
a8be709
Patch1:         cockatrice-ee674cb0cf-protobuf-23.patch
d52aafe
56e0b21
BuildRequires:	gcc-c++
d52aafe
BuildRequires:	cmake >= 3.1
d52aafe
BuildRequires:	protobuf-devel
d52aafe
BuildRequires:	qt5-qttools-devel
d52aafe
BuildRequires:	qt5-qtsvg-devel
d52aafe
BuildRequires:	qt5-qtmultimedia-devel
d52aafe
BuildRequires:	zlib-devel
d52aafe
BuildRequires:	sqlite-devel
d52aafe
BuildRequires:	qt5-qtwebsockets-devel
d52aafe
BuildRequires:	libappstream-glib
d52aafe
BuildRequires:	desktop-file-utils
d52aafe
Requires:		wget
d52aafe
Requires:		hicolor-icon-theme
d1a73e8
Requires:		%{name}-utils = %{version}-%{release}
d52aafe
d52aafe
%description
d52aafe
Cockatrice is an open-source multi-platform supported program for playing
d52aafe
tabletop card games over a network. The program's server design prevents any
d52aafe
kind of client modifications to gain an unfair advantage in a game.
d52aafe
The client also has a built in single-player mode where you can create decks
d52aafe
without being connected to a server.
d52aafe
d52aafe
d1a73e8
%package server
d1a73e8
Summary:	Standalone server for Cockatrice
d1a73e8
Provides:	servatrice = %{version}-%{release}
d1a73e8
Requires:	%{name}-utils = %{version}-%{release}
d1a73e8
d1a73e8
%description server
d1a73e8
Cockatrice is an open-source multi-platform supported program for playing
d1a73e8
tabletop card games over a network. The program's server design prevents any
d1a73e8
kind of client modifications to gain an unfair advantage in a game.
d1a73e8
The client also has a built in single-player mode where you can create decks
d1a73e8
without being connected to a server.
d1a73e8
d1a73e8
This is the standalone server, "servatrice".
d1a73e8
d1a73e8
d1a73e8
%package utils
d1a73e8
Summary:	Utilities common to both cockatrice and servatrice
d1a73e8
d1a73e8
%description utils
d1a73e8
Cockatrice is an open-source multi-platform supported program for playing
d1a73e8
tabletop card games over a network. The program's server design prevents any
d1a73e8
kind of client modifications to gain an unfair advantage in a game.
d1a73e8
The client also has a built in single-player mode where you can create decks
d1a73e8
without being connected to a server.
d1a73e8
d1a73e8
This package provides utilities required by both cockatrice and servatrice.
d1a73e8
d1a73e8
d52aafe
%prep
d52aafe
%setup -q -n Cockatrice-%{gittag0}
aa9fb75
%patch -P 0
a8be709
%patch -P 1 -p1
d52aafe
find . -iname "*.h" -exec chmod a-x "{}" \;
d52aafe
find . -iname "*.cpp" -exec chmod a-x "{}" \;
10afc40
# The API for Protobuf v4 (23.x) requires at least C++14. When compiled as
10afc40
# C++17, abseil-cpp (a transitive dependency via the generated bindings)
10afc40
# requires API users to compile with at least C++17.
10afc40
sed -r -i 's/(CMAKE_CXX_STANDARD )11\b/\117/' CMakeLists.txt
d52aafe
d52aafe
d52aafe
%build
d52aafe
%cmake \
d52aafe
	-DCMAKE_BUILD_TYPE=RelWithDebInfo \
d52aafe
	-DBUILD_SHARED_LIBS=OFF \
c2927b2
	-DWITH_SERVER=ON
c2927b2
c2927b2
%cmake_build
d52aafe
d52aafe
d52aafe
%check
d52aafe
appstream-util validate-relax --nonet %{SOURCE1}
d52aafe
desktop-file-validate cockatrice/%{name}.desktop
d52aafe
desktop-file-validate servatrice/servatrice.desktop
d52aafe
desktop-file-validate oracle/oracle.desktop
d52aafe
d52aafe
d52aafe
%install
c2927b2
%cmake_install
c2927b2
d52aafe
install -m644 -D %{SOURCE1} %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml
d52aafe
rm %{buildroot}%{_datadir}/%{name}/translations/%{name}_en@pirate.qm
d52aafe
rm %{buildroot}%{_datadir}/oracle/translations/oracle_en@pirate.qm
d52aafe
d52aafe
d52aafe
%files
d52aafe
%doc README.md
abedfe5
%license LICENSE
d1a73e8
%{_bindir}/{cockatrice,oracle}
d1a73e8
%{_datadir}/applications/{cockatrice,oracle}.desktop
d52aafe
%{_datadir}/appdata/*
d52aafe
%{_datadir}/%{name}
d52aafe
%{_datadir}/icons/hicolor/{48x48,scalable}/apps/*
d52aafe
%{_datadir}/oracle
d52aafe
%exclude %{_datadir}/%{name}/translations/%{name}_*.qm
d52aafe
%exclude %{_datadir}/oracle/translations/oracle_*.qm
d52aafe
d52aafe
%lang_subpkg cs Czech
d52aafe
%lang_subpkg de German
aa9fb75
%lang_subpkg en_US English
d52aafe
%lang_subpkg es Spanish
d52aafe
%lang_subpkg et Estonian
d52aafe
%lang_subpkg fr French
d52aafe
%lang_subpkg it Italian
d52aafe
%lang_subpkg ja Japanese
d52aafe
%lang_subpkg ko Korean
d52aafe
%lang_subpkg nb Norwegian
d52aafe
%lang_subpkg nl Dutch
d52aafe
%lang_subpkg pl Polish
d52aafe
%lang_subpkg pt Portuguese
d52aafe
%lang_subpkg pt_BR Brazil
d52aafe
%lang_subpkg ru Russian
d52aafe
%lang_subpkg sr Serbian
d52aafe
%lang_subpkg sv Swedish
d52aafe
%lang_subpkg zh-Hans "Chinese (Simplified)"
d52aafe
d1a73e8
%files utils
d1a73e8
%license LICENSE
d1a73e8
%{_bindir}/dbconverter
d1a73e8
d1a73e8
%files server
d1a73e8
%license LICENSE
d1a73e8
%{_bindir}/servatrice
d1a73e8
%{_datadir}/servatrice
d1a73e8
%{_datadir}/applications/servatrice.desktop
d52aafe
d52aafe
%changelog
b0866ca
%autochangelog