File NetMauMau-client-qt.spec of Package NetMauMau-client-qt

#
# spec file for package NetMauMau-client-qt
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


# See also http://en.opensuse.org/openSUSE:Specfile_guidelines

%define		sourcename	NetMauMau-Qt-Client
%define 	binname		nmm-qt-client

Name:           NetMauMau-client-qt
Version:        0.23
Release:        0
Summary:        A Qt client for the NetMauMau server
License:        GPL-3.0+
Group:          Amusements/Games/Board/Card
Url:            https://github.com/velnias75/NetMauMau-Qt-Client
Source0:        https://github.com/velnias75/NetMauMau-Qt-Client/archive/V%{version}.tar.gz
Patch0:		%{name}.patch
BuildRequires:  netmaumau-devel >= %{version}
#BuildRequires:  libqt4-devel 
BuildRequires: 	libqt5-linguist
BuildRequires: 	hicolor-icon-theme
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(Qt5Widgets)
#BuildRequires:  libqt5-qtsvg-devel
#BuildRequires:  libQt5Widgets-devel
BuildRequires:  espeak-devel
BuildRequires:  libqjson-devel
BuildRequires:  libmarkdown-devel
BuildRequires:  update-desktop-files
Recommends:	NetMauMau-server >= %{version}

%description
Play the popular card game Mau Mau against the computer or over the network with your friends.
This is the NetMauMau QT-Client.

%prep
%setup -q -n %{sourcename}-%{version}
%patch0 -p1

%build
# without espeek
# qmake CONFIG+=release && make && sudo make install
# with espeek
# qmake CONFIG+=release CONFIG+=espeak && make && sudo make install
qmake CONFIG+=release CONFIG+=espeak 
make CPPFLAGS=-DNDEBUG %{?_smp_mflags}
# generate german languages manuell, because error in src.pro
pushd src
lrelease -nounfinished nmm_qt_client_de_DE.ts \
	 -qm nmm_qt_client_de_DE.qm
popd


%install
#make install DESTDIR=%%{buildroot}
make INSTALL_ROOT=%{buildroot} install
# install manuell generated german language file
mkdir -p %{buildroot}%{_datadir}/%{binname}
pushd src
install -p -m 644 nmm_qt_client_de_DE.qm %{buildroot}%{_datadir}/%{binname}
popd
# rename to package-name
mv %{buildroot}%{_datadir}/applications/nmm_qt_client.desktop %{buildroot}%{_datadir}/applications/%{binname}.desktop
mv %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/nmm_qt_client.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/%{binname}.png
# update desktopfile
%suse_update_desktop_file %{binname}


%files
#%%doc NO DOC
%defattr(-,root,root)
%{_bindir}/%{binname}
%{_datadir}/applications/%{binname}.desktop
%{_datadir}/icons/hicolor/256x256/apps/%{binname}.png
%dir %{_datadir}/%{binname}
%{_datadir}/%{binname}/*

%changelog
openSUSE Build Service is sponsored by