File ICAClient.spec of Package ICAClient
#
# spec file for package ICAClient
#
# Copyright (c) 2022 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/
#
%define arch \\(64bit\\)
%define lib1 libgst[a-z]*\\-0\\.10\\.so\\.0\\(\\)%{arch}$
%define lib2 libjavascriptcoregtk\\-1\\.0\\.so\\.0\\(\\)%{arch}$
%define lib3 libwebkitgtk\\-1\\.0\\.so\\.0\\(\\)%{arch}$
%define lib4 libgssapi\\.so\\.3\\(\\)%{arch}$
%define lib5 libunwind\\.so\\.1\\(\\)%{arch}$
%global __requires_exclude (%{lib1}|%{lib2}|%{lib3}|%{lib4}|%{lib5})
Name: ICAClient
Version: 24.5.0.76
Release: 0
Summary: Citrix Client Full Package
License: NonFree
Group: Productivity/Networking/Other
URL: https://www.citrix.de/downloads/workspace-app/linux/workspace-app-for-linux-latest.html
# Don't delete 23.2.0.10 because it is the last source without dir .build-id
Source1: %{name}-suse-%{version}-0.x86_64.rpm
Source2: citrix-configmgr.desktop
Source3: citrix-conncenter.desktop
Source4: citrix-new_store.desktop
Source5: citrix-selfservice.desktop
Source6: citrix-wfica.desktop
Source7: ctxwalog.service
Source99: %{name}-rpmlintrc
BuildRequires: -brp-check-suse
BuildRequires: build
BuildRequires: ca-certificates
BuildRequires: fdupes
BuildRequires: pkgconfig
BuildRequires: shared-mime-info
BuildRequires: update-desktop-files
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(systemd)
Requires: ca-certificates-mozilla
Requires: openssl
ExclusiveArch: x86_64
%{?systemd_requires}
%description
Receiver for Linux enables users to access virtual desktops and hosted applications
delivered by XenDesktop and XenApp from devices running the Linux operating system.
Receiver for Linux is available in English, German, Spanish, French, Japanese,
Simplified Chinese and Russian.
%prep
%build
%install
cd %{buildroot}
unrpm %{SOURCE1}
#
#rm -rf usr/
#
mkdir -p .%{_libexecdir}
mv -f opt/Citrix/%{name} .%{_libexecdir}/
# TODO: Is build-id needed? If so, symlinks must be fixed!
mv -f usr/lib/.build-id .%{_libexecdir}/%{name}/
rm -rf opt
rm -rf .%{_libexecdir}/%{name}/PKCS#11
mkdir -p .%{_datadir}/mime
mv .%{_libexecdir}/%{name}/desktop .%{_datadir}/mime/packages
ln -sf %{_libexecdir}/%{name}/util/integrate.sh .%{_libexecdir}/%{name}/util/disintegrate.sh
# dekstop
mkdir -p .%{_datadir}/applications
install -m 644 %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} .%{_datadir}/applications/
sed -i -e 's|@LIBDIR@|%{_libexecdir}|g' .%{_datadir}/applications/*.desktop
# certs
rm -rf .%{_libexecdir}/%{name}/keystore/cacerts
ln -sf %{_sysconfdir}/ssl/certs .%{_libexecdir}/%{name}/keystore/cacerts
mkdir -p .%{_sbindir}
install -D -m 644 %{SOURCE7} .%{_unitdir}/ctxwalog.service
ln -sf service .%{_sbindir}/rcctxwalog
rm -rf .%{_sysconfdir}
find . -name '*.so' -exec chmod +x {} \;
find . -name '*.DLL' -exec chmod +x {} \;
%suse_update_desktop_file citrix-configmgr
%suse_update_desktop_file citrix-conncenter
%suse_update_desktop_file citrix-new_store
%suse_update_desktop_file citrix-selfservice
%suse_update_desktop_file citrix-wfica
%fdupes -s %{buildroot}
%pre
%service_add_pre ctxwalog.service
%post
%service_add_post ctxwalog.service
if [ "$1" -eq 1 ];
then
mkdir -p %{_sysconfdir}/icalicense
%{_libexecdir}/%{name}/util/echo_cmd -l >%{_sysconfdir}/icalicense/clientlicense
chmod 444 %{_sysconfdir}/icalicense/clientlicense
chmod 555 %{_sysconfdir}/icalicense
lang=`echo $LANG | cut -c1-2`
if [ ! -d %{_libexecdir}/%{name}/nls/$lang ]
then
lang=en
fi
if [ `echo ${LANG: -5}` = "UTF-8" ]
then
ln -sf %{_libexecdir}/%{name}/nls/$lang.UTF-8/eula.txt %{_libexecdir}/%{name}/eula.txt
else
ln -sf %{_libexecdir}/%{name}/nls/$lang/eula.txt %{_libexecdir}/%{name}/eula.txt
fi
ln -sf %{_libexecdir}/%{name}/nls/$lang/appsrv.template %{_libexecdir}/%{name}/config/appsrv.ini
ln -sf %{_libexecdir}/%{name}/nls/$lang/module.ini %{_libexecdir}/%{name}/config/module.ini
ln -sf %{_libexecdir}/%{name}/nls/$lang/wfclient.template %{_libexecdir}/%{name}/config/wfclient.ini
fi
%preun
%service_del_preun ctxwalog.service
if [ "$1" -eq 0 ];
then
rm -rf %{_sysconfdir}/icalicense
rm -rf %{_libexecdir}/%{name}/eula.txt
rm -rf %{_libexecdir}/%{name}/config/appsrv.ini
rm -rf %{_libexecdir}/%{name}/config/module.ini
rm -rf %{_libexecdir}/%{name}/config/wfclient.ini
fi
%postun
%service_del_postun ctxwalog.service
%files
%{_libexecdir}/%{name}
%{_datadir}/applications/*.desktop
%{_datadir}/mime/packages/Citrix-mime_types.xml
%{_unitdir}/ctxwalog.service
%{_sbindir}/rcctxwalog
%changelog