diff --git a/.gitignore b/.gitignore index e69de29..e2cfd5a 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/guacamole-server-0.8.2.tar.gz diff --git a/guacamole-server-function-test.patch b/guacamole-server-function-test.patch new file mode 100644 index 0000000..72cc538 --- /dev/null +++ b/guacamole-server-function-test.patch @@ -0,0 +1,35 @@ +From 7a6e7dcabca0060c385f3377b7c826457064bf16 Mon Sep 17 00:00:00 2001 +From: Michael Jumper +Date: Tue, 16 Jul 2013 11:27:46 -0700 +Subject: [PATCH] Fix library function tests in configure.ac (AC_CHECK_FUNCS + provides no means of specifying the library to check). + +--- + configure.ac | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index b1c0ac9..e2b4eca 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -87,8 +87,15 @@ AC_SUBST(CUNIT_LIBS) + # Library functions + AC_FUNC_MALLOC + AC_FUNC_REALLOC +-AC_CHECK_FUNCS([clock_gettime gettimeofday memmove memset select strdup png_get_io_ptr \ +- cairo_format_stride_for_width nanosleep]) ++AC_CHECK_FUNCS([clock_gettime gettimeofday memmove memset select strdup nanosleep]) ++ ++AC_CHECK_DECL([png_get_io_ptr], ++ [AC_DEFINE([HAVE_PNG_GET_IO_PTR])],, ++ [#include ]) ++ ++AC_CHECK_DECL([cairo_format_stride_for_width], ++ [AC_DEFINE([HAVE_CAIRO_FORMAT_STRIDE_FOR_WIDTH])],, ++ [#include ]) + + # Typedefs + AC_TYPE_SIZE_T +-- +1.7.10.4 + diff --git a/guacamole-server.init b/guacamole-server.init new file mode 100644 index 0000000..5e2455c --- /dev/null +++ b/guacamole-server.init @@ -0,0 +1,5 @@ +# Guacamole daemon configuration +# For details see guacd man page + +# Change listening port from default 4822 +# OPTS="-l 4823" diff --git a/guacamole-server.service b/guacamole-server.service new file mode 100644 index 0000000..45a3ddd --- /dev/null +++ b/guacamole-server.service @@ -0,0 +1,16 @@ +[Unit] +Description=Guacamole proxy daemon +Documentation=man:guacd(8) +After=network.target + +[Service] +EnvironmentFile=-/etc/sysconfig/guacd +Environment=HOME=`sh -c "echo ~%U"` +ExecStart=/usr/sbin/guacd -f $OPTS +Restart=on-failure +User=guacd +Group=guacd + +[Install] +WantedBy=multi-user.target + diff --git a/guacamole-server.spec b/guacamole-server.spec new file mode 100644 index 0000000..d1d5dc5 --- /dev/null +++ b/guacamole-server.spec @@ -0,0 +1,238 @@ +%global _hardened_build 1 +%global username guacd + +Name: guacamole-server +Version: 0.8.2 +Release: 1%{?dist} +Summary: Server-side native components that form the Guacamole proxy + +License: MPLv1.1 or GPLv2+ +URL: http://guac-dev.org/ +Source0: http://guac-dev.org/pub/dist/source/%{name}-%{version}.tar.gz +Source1: %{name}.sysconfig +Source2: %{name}.service +Source3: %{name}.init +Patch0: %{name}-function-test.patch + +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: doxygen +BuildRequires: libtool +BuildRequires: pkgconfig(cairo) +BuildRequires: pkgconfig(freerdp) +BuildRequires: pkgconfig(gnutls) +BuildRequires: pkgconfig(libpng) +BuildRequires: pkgconfig(libssh) +%if 0%{?rhel} == 6 +BuildRequires: libvncserver-devel +%else +BuildRequires: pkgconfig(libvncserver) +%endif +BuildRequires: pkgconfig(pango) +BuildRequires: pkgconfig(vorbis) + +%description +Guacamole is an HTML5 remote desktop gateway. + +Guacamole provides access to desktop environments using remote desktop protocols +like VNC and RDP. A centralized server acts as a tunnel and proxy, allowing +access to multiple desktops through a web browser. + +No browser plugins are needed, and no client software needs to be installed. The +client requires nothing more than a web browser supporting HTML5 and AJAX. + +The main web application is provided by the "guacamole-client" package. + +%package -n libguac +Summary: The common library used by all C components of Guacamole + +%description -n libguac +libguac is the core library for guacd (the Guacamole proxy) and any protocol +support plugins for guacd. libguac provides efficient buffered I/O of text and +base64 data, as well as somewhat abstracted functions for sending Guacamole +instructions. + +%package -n libguac-devel +Summary: Development files for %{name} +Requires: libguac%{?_isa} = %{version}-%{release} + +%description -n libguac-devel +The libguac-devel package contains libraries and header files for +developing applications that use %{name}. + +%package -n libguac-client-rdp +Summary: RDP support for guacd +Requires: libguac%{?_isa} = %{version}-%{release} +Requires: freerdp-plugins + +%description -n libguac-client-rdp +libguac-client-rdp is a protocol support plugin for the Guacamole proxy (guacd) +which provides support for RDP, the proprietary remote desktop protocol used by +Windows Remote Deskop / Terminal Services, via the libfreerdp library. + +%package -n libguac-client-ssh +Requires: libguac%{?_isa} = %{version}-%{release} +Summary: SSH support for guacd + +%description -n libguac-client-ssh +libguac-client-ssh is a protocol support plugin for the Guacamole proxy (guacd) +which provides support for SSH, the secure shell. + +%package -n libguac-client-vnc +Requires: libguac%{?_isa} = %{version}-%{release} +Summary: VNC support for guacd + +%description -n libguac-client-vnc +libguac-client-vnc is a protocol support plugin for the Guacamole proxy (guacd) +which provides support for VNC via the libvncclient library (part of +libvncserver). + +%package -n guacd +Summary: Proxy daemon for Guacamole +Requires(pre): shadow-utils +Requires: libguac%{?_isa} = %{version}-%{release} + +%if 0%{?fedora} || 0%{?rhel} >= 7 +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd +%endif + +%if 0%{?rhel} == 6 +Requires(post): /sbin/chkconfig +Requires(preun): /sbin/chkconfig +Requires(preun): /sbin/service +Requires(postun): /sbin/service +%endif + +%description -n guacd +guacd is the Guacamole proxy daemon used by the Guacamole web application and +framework to translate between arbitrary protocols and the Guacamole protocol. + +%prep +%setup -q +%patch0 -p1 + +%build +autoreconf -v -f --install +%configure +make %{?_smp_mflags} +cd doc/ +doxygen Doxyfile + +%install +%make_install +find %{buildroot} -type f -name "*.la" -delete +find %{buildroot} -type f -name "*.a" -delete +cp -fr doc/doxygen-output/html . + +mkdir -p %{buildroot}%{_sysconfdir}/sysconfig +install -p -m 644 -D %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/guacd +mkdir -p %{buildroot}%{_sharedstatedir}/guacd + +%if 0%{?fedora} || 0%{?rhel} >= 7 + +# Systemd unit files +mkdir -p %{buildroot}%{_unitdir} +install -p -m 644 -D %{SOURCE2} %{buildroot}%{_unitdir}/guacd.service + +%else + +# Initscripts +mkdir -p %{buildroot}%{_initrddir} +install -p -m 755 -D %{SOURCE3} %{buildroot}%{_initrddir}/guacd + +%endif + +%pre -n guacd +getent group %username >/dev/null || groupadd -r %username &>/dev/null || : +getent passwd %username >/dev/null || useradd -r -s /sbin/nologin \ + -d %{_sharedstatedir}/guacd -M -c 'Guacamole proxy daemon' -g %username %username &>/dev/null || : +exit 0 + +%if 0%{?fedora} || 0%{?rhel} >= 7 + +%post -n guacd +%systemd_post guacd.service + +%preun -n guacd +%systemd_preun guacd.service + +%postun -n guacd +%systemd_postun_with_restart guacd.service + +%endif + +%if 0%{?rhel} == 6 + +%post -n guacd +/sbin/chkconfig --add guacd + +%preun -n guacd +if [ "$1" = 0 ]; then + /sbin/service guacd stop >/dev/null 2>&1 || : + /sbin/chkconfig --del guacd +fi + +%postun -n guacd +if [ "$1" -ge "1" ]; then + /sbin/service guacd condrestart >/dev/null 2>&1 || : +fi + +%endif + +%post -n libguac -p /sbin/ldconfig + +%postun -n libguac -p /sbin/ldconfig + +%post -n libguac-client-rdp -p /sbin/ldconfig + +%postun -n libguac-client-rdp -p /sbin/ldconfig + +%post -n libguac-client-ssh -p /sbin/ldconfig + +%postun -n libguac-client-ssh -p /sbin/ldconfig + +%post -n libguac-client-vnc -p /sbin/ldconfig + +%postun -n libguac-client-vnc -p /sbin/ldconfig + +%files -n libguac +%doc AUTHORS LICENSE README +%{_libdir}/libguac.so.* + +%files -n libguac-devel +%doc html +%{_includedir}/* +%{_libdir}/libguac.so + +# The libguac source code dlopen's these plugins, and they are named without +# the version in the shared object; i.e. "libguac-client-$(PROTOCOL).so". + +%files -n libguac-client-rdp +%{_libdir}/libguac-client-rdp.so +%{_libdir}/libguac-client-rdp.so.* +%{_libdir}/freerdp/*.so + +%files -n libguac-client-ssh +%{_libdir}/libguac-client-ssh.so +%{_libdir}/libguac-client-ssh.so.* + +%files -n libguac-client-vnc +%{_libdir}/libguac-client-vnc.so +%{_libdir}/libguac-client-vnc.so.* + +%files -n guacd +%config(noreplace) %{_sysconfdir}/sysconfig/guacd +%{_mandir}/man8/guacd.8.* +%{_sbindir}/guacd +%if 0%{?fedora} || 0%{?rhel} >= 7 +%{_unitdir}/guacd.service +%else +%{_initrddir}/guacd +%endif +%attr(750,%{username},%{username}) %{_sharedstatedir}/guacd + +%changelog +* Tue Jul 16 2013 Simone Caronni - 0.8.2-1 +- First build. diff --git a/guacamole-server.sysconfig b/guacamole-server.sysconfig new file mode 100644 index 0000000..5e2455c --- /dev/null +++ b/guacamole-server.sysconfig @@ -0,0 +1,5 @@ +# Guacamole daemon configuration +# For details see guacd man page + +# Change listening port from default 4822 +# OPTS="-l 4823" diff --git a/sources b/sources index e69de29..fa8d1c0 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +a0bd3ab02c2f85e4f21d16f26421fb19 guacamole-server-0.8.2.tar.gz