File guacamole-server.spec of Package guacamole-server
#
# spec file for package guacamole-server
#
# Copyright (c) 2020 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 with_rdp 1
%define with_test 1
# See also http://en.opensuse.org/openSUSE:Specfile_guidelines
%if 0%{?suse_version} > 1500
%define _lto_cflags %{nil}
%endif
Name: guacamole-server
Version: 1.5.5
Release: 0
Summary: Clientless remote desktop gateway
License: Apache-2.0
Group: Productivity/Networking/Other
URL: https://guac-dev.org/
#Source0: http://sourceforge.net/projects/guacamole/files/current/source/%%{name}-%%{version}.tar.gz
Source0: https://www.apache.org/dist/guacamole/%{version}/source/guacamole-server-%{version}.tar.gz
Source1: guacd.conf
Source2: %{name}.sysconfig
Source3: %{name}.service
Patch0: %{name}.patch
BuildRequires: libtool
BuildRequires: doxygen
BuildRequires: graphviz
BuildRequires: pkgconfig
BuildRequires: pkgconfig(cairo)
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavformat)
#BuildRequires: pkgconfig(libavresample)
BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(libjpeg)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(libssh2)
BuildRequires: pkgconfig(libswscale)
BuildRequires: pkgconfig(libvncserver)
BuildRequires: pkgconfig(libwebp)
BuildRequires: pkgconfig(libwebsockets)
BuildRequires: pkgconfig(ossp-uuid)
BuildRequires: pkgconfig(pango)
BuildRequires: pkgconfig(vorbis)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(winpr2)
%if %{with_rdp}
BuildRequires: pkgconfig(freerdp2)
%endif
%if %{with_test}
BuildRequires: pkgconfig(cunit)
%endif
%description
Guacamole is an HTML5 web application that provides access to desktop environments using remote desktop protocols such as VNC or RDP.
A centralized server acts as a tunnel and proxy, allowing access to multiple desktops through a web browser.
No plugins are needed: the client requires nothing more than a web browser supporting HTML5 and AJAX.
This is the server-part.
%package devel
Summary: Development files for guacamole-server
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
%description devel
This package provides development libraries and headers needed
to build %{name}.
%prep
%setup -q
%patch -P 0 -p1
#%%patch -P 1 -p1
# deprecated nested_send_instruction: https://issues.apache.org/jira/browse/GUACAMOLE-661
#rm -fr src/libguac/tests/socket/nested_send_instruction.c
%build
export CPPFLAGS="%{optflags} -Wno-deprecated-declarations"
export LDFLAGS="-lrt"
# Want my own service file
#%%configure --with-systemd-dir=%%{_unitdir} --with-rdp
#2: %%configure
#2: make %%{?_smp_mflags}
%configure
%make_build
pushd doc/libguac
doxygen Doxyfile
popd
pushd doc/libguac-terminal
doxygen Doxyfile
popd
%install
%make_install
install -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/guacamole/guacd.conf
# include freerdp libs
%if %{with_rdp}
mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d/
cat <<EOF >%{buildroot}%{_sysconfdir}/ld.so.conf.d/guacamole.conf
%{_libdir}
%{_libdir}/freerdp2
EOF
%endif
# install sysconfig
install -D -m 644 %{SOURCE2} %{buildroot}%{_fillupdir}/sysconfig.guacd
# install systemd.service file
install -D -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.service
ln -s -f %{_sbindir}/guacd %{buildroot}%{_sbindir}/rc%{name}
%check
export MAKEFLAGS="-i"
make check
%pre
%service_add_pre %{name}.service
%preun
%service_del_preun %{name}.service
%post
%service_add_post %{name}.service
/sbin/ldconfig
%postun
%service_del_postun %{name}.service
/sbin/ldconfig
%files
%license LICENSE
%doc README
%doc doc/libguac/doxygen-output/html
%doc doc/libguac-terminal/doxygen-output/html
%dir %{_sysconfdir}/guacamole
%config(noreplace) %{_sysconfdir}/guacamole/guacd.conf
%{_fillupdir}/sysconfig.guacd
%{_unitdir}/%{name}.service
%{_libdir}/*.so.*
%{_mandir}/man1/guac*
%{_mandir}/man5/guacd*
%{_mandir}/man8/guacd*
%{_sbindir}/guacd
%{_sbindir}/rc%{name}
%{_bindir}/guacenc
%{_bindir}/guaclog
%if %{with_rdp}
%config %{_sysconfdir}/ld.so.conf.d/guacamole.conf
%dir %{_libdir}/freerdp2
%{_libdir}/freerdp2/*.so
%endif
%files devel
%{_libdir}/*.so
%{_libdir}/*.la
%{_libdir}/*.a
%{_includedir}/*
%if %{with_rdp}
%dir %{_libdir}/freerdp2
%{_libdir}/freerdp2/*.la
%endif
%changelog