File mingw32-x2goclient.spec of Package mingw32-x2goclient

#
# spec file for package mingw32-x2goclient
#
# Copyright (c) 2016 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/
#


Name:           mingw32-x2goclient
Version:        4.0.5.2
Release:        0
Summary:        The x2go client
License:        GPL-2.0-only
Group:          Productivity/Networking/Remote Desktop
Url:            http://x2go.org/

#DL-URL:	http://code.x2go.org/releases/source/x2goclient/
#Git-Clone:	git://code.x2go.org/x2goclient
#Git-Web:	http://code.x2go.org/gitweb?p=x2goclient.git;a=summary
Source:         http://code.x2go.org/releases/source/x2goclient/x2goclient-%version.tar.gz
Source2:        http://code.x2go.org/releases/source/x2goclient/x2goclient-%version.tar.gz.asc
Source3:        %name.keyring
Patch1:         winbuild.diff
Patch2:         keys.diff
BuildRequires:  fdupes
BuildRequires:  mingw32-cross-gcc-c++
BuildRequires:  mingw32-cross-qmake >= 4.6.0
BuildRequires:  mingw32-libqt4-devel >= 4.6.0
BuildRequires:  mingw32-libssh-devel >= 0.4
#!BuildIgnore:  -post-build-checks
%_mingw32_package_header_debug
BuildArch:      noarch

%description
This client will be able to connect to X2Go server(s) and start,
stop, resume and terminate (running) desktop sessions. X2Go Client
stores different server connections and may automatically request
authentication data from LDAP directories.

%_mingw32_debug_package

%prep
%setup -qn x2goclient-%version
%patch -P 1 -P 2 -p1

%build
mkdir pref
prog=""
for prog in $(which i686-w64-mingw32-lrelease 2>/dev/null); do
	break
done
if [ -z "$prog" ]; then
	echo ERROR: lrelease not found
fi
cat >"pref/lrelease" <<-EOF
	#!/bin/sh
	exec "$prog" "\$@"
EOF
chmod a+x "pref/lrelease"
ln -s lrelease pref/lrelease-qt4
export PATH="$PWD/pref:$PATH"

mkdir build-bin
for qmake in $(which i686-w64-mingw32-qmake 2>/dev/null); do
	break
done
cat >"build-bin/qmake" <<-EOF
	#!/bin/sh
	exec "$qmake" QMAKE_CFLAGS+="%optflags" QMAKE_CXXFLAGS+="%optflags"  "\$@"
EOF
chmod a+x build-bin/qmake
# make calls qmake by way of invoking qmake-qt4...
ln -s qmake build-bin/qmake-qt4
export PATH="$PATH:$PWD/build-bin"
make %{?_smp_mflags}
make %{?_smp_mflags} -C x2gohelper CXX="%_mingw32_cxx"

%install
b="%buildroot"
make install DESTDIR="$b" \
	PREFIX="%_mingw32_prefix"
%if 0%{?suse_version}
%fdupes -s %buildroot/%_mingw32_prefix
%endif
rm -Rf "$b/%_mingw32_datadir/x2go/plugin"
cp client_build/release/x2gohelper.exe "$b/%_mingw32_bindir/"

%files
%defattr(-,root,root)
%config(noreplace) %_sysconfdir/x2go/
%_mingw32_bindir/x2go*.exe
%_mingw32_datadir/applications/
%_mingw32_datadir/icons/
%_mingw32_mandir/man*/*.1*
%_mingw32_datadir/x2goclient/

%changelog
openSUSE Build Service is sponsored by