Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Nov 2018 08:12:18 +0000 (UTC)
From:      Koichiro Iwao <meta@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r486081 - in head/net/xrdp: . files
Message-ID:  <201811280812.wAS8CItm025197@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: meta
Date: Wed Nov 28 08:12:18 2018
New Revision: 486081
URL: https://svnweb.freebsd.org/changeset/ports/486081

Log:
  net/xrdp: Fix build with audio/fdk-aac 2.0.0 etc
  
  Submitter's patch has been merged into upstream with minor changes.
  
  Also while here, cleanup some leftovers. This port generates private key
  and server certificate in post-install script. Poudriere complains that
  these files are left over after deinstall. Now these auto-generated files
  will be removed when deinstall. If certificate and private key are replaced
  with user's own files, they should be kept.
  
  PR:		233558
  Submitted by:	takefu@airport.fm (original version)
  Approved by:	mentors (implicit)
  Obtained from:	https://github.com/neutrinolabs/xrdp/pull/1257
  Sponsored by:	HAW International, Inc.

Added:
  head/net/xrdp/files/pkg-deinstall.in   (contents, props changed)
Modified:
  head/net/xrdp/Makefile
  head/net/xrdp/distinfo
  head/net/xrdp/files/pkg-install.in

Modified: head/net/xrdp/Makefile
==============================================================================
--- head/net/xrdp/Makefile	Wed Nov 28 07:28:41 2018	(r486080)
+++ head/net/xrdp/Makefile	Wed Nov 28 08:12:18 2018	(r486081)
@@ -4,10 +4,14 @@
 PORTNAME=	xrdp
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.9.8
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	net
 DIST_SUBDIR?=	${PORTNAME}
 
+PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${PORTNAME}/commit/
+PATCHFILES=	88f0d31.patch:-p1
+
 MAINTAINER=	meta@FreeBSD.org
 COMMENT=	Open source Remote Desktop Protocol (RDP) server
 
@@ -34,7 +38,7 @@ CONFIGURE_ARGS=	--localstatedir=/var --enable-strict-l
 LDFLAGS+=	-lssl
 CONFLICTS=	xrdp-devel[0-9]*
 INSTALL_TARGET=	install-strip
-SUB_FILES=	pkg-install pkg-message
+SUB_FILES=	pkg-deinstall pkg-install pkg-message
 SUB_LIST=	OPENSSLBASE=${OPENSSLBASE}
 
 OPTIONS_DEFINE=	DEBUG FUSE IPV6

Modified: head/net/xrdp/distinfo
==============================================================================
--- head/net/xrdp/distinfo	Wed Nov 28 07:28:41 2018	(r486080)
+++ head/net/xrdp/distinfo	Wed Nov 28 08:12:18 2018	(r486081)
@@ -1,7 +1,9 @@
-TIMESTAMP = 1537858074
+TIMESTAMP = 1543368323
 SHA256 (xrdp/neutrinolabs-xrdp-v0.9.8_GH0.tar.gz) = 5764a3bb5ecdc8b566d03ea6c1526b3dc67802ac7f029485d3e93ffaf09fd4fc
 SIZE (xrdp/neutrinolabs-xrdp-v0.9.8_GH0.tar.gz) = 658830
 SHA256 (xrdp/neutrinolabs-librfxcodec-v0.1.4_GH0.tar.gz) = 8e2d6060aca6d92ebd8b5cd295e9b85b8dd12ec00aacf7e3d351a8dacb56f4f3
 SIZE (xrdp/neutrinolabs-librfxcodec-v0.1.4_GH0.tar.gz) = 48379
 SHA256 (xrdp/neutrinolabs-libpainter-v0.1.1_GH0.tar.gz) = 6caee8444fbd72677ac5e125c7ac99490688474975451668e751a9d9187ee5e6
 SIZE (xrdp/neutrinolabs-libpainter-v0.1.1_GH0.tar.gz) = 13929
+SHA256 (xrdp/88f0d31.patch) = 84e0b3796edac2cae19363d958c7b0f96a9eebb63ba7a046487a743a7f2cb4d4
+SIZE (xrdp/88f0d31.patch) = 1583

Added: head/net/xrdp/files/pkg-deinstall.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/xrdp/files/pkg-deinstall.in	Wed Nov 28 08:12:18 2018	(r486081)
@@ -0,0 +1,34 @@
+#!/bin/sh
+# vim:ts=4:sw=4:et
+
+if [ $# -ne 2 ]; then
+    echo "usage: $0 distname { DEINSTALL | POST-DEINSTALL }" >&2
+    exit 1
+fi
+
+case $2 in
+    DEINSTALL)
+        : nothing to do here
+        ;;
+    POST-DEINSTALL)
+        RSAKEYS=%%PREFIX%%/etc/xrdp/rsakeys.ini
+        PRIVATEKEY=%%PREFIX%%/etc/xrdp/key.pem
+        CERTIFICATE=%%PREFIX%%/etc/xrdp/cert.pem
+
+        # if keys are generated during post-install script, remove it
+        # but do not remove user's keys
+        for f in $RSAKEYS $PRIVATEKEY $CERTIFICATE;
+        do
+            if cmp -s "${f}.sample" "${f}"; then
+                rm -f "${f}"
+            fi
+                rm -f "${f}.sample"
+        done
+        ;;
+    *)
+        echo "usage: $0 distname { DEINSTALL | POST-DEINSTALL }" >&2
+        exit 1
+        ;;
+esac
+
+exit 0

Modified: head/net/xrdp/files/pkg-install.in
==============================================================================
--- head/net/xrdp/files/pkg-install.in	Wed Nov 28 07:28:41 2018	(r486080)
+++ head/net/xrdp/files/pkg-install.in	Wed Nov 28 08:12:18 2018	(r486081)
@@ -17,18 +17,23 @@ case $2 in
         # make sure rsakeys and certificates are private
         umask 077
         # generate rsakeys.ini
-        [ -e "$RSAKEYS" ] || %%PREFIX%%/bin/xrdp-keygen xrdp "$RSAKEYS"
+        [ -e "$RSAKEYS" ] || %%PREFIX%%/bin/xrdp-keygen xrdp "$RSAKEYS".sample && \
         # generate self-signed certificate
         [ -e "$PRIVATEKEY" -a -e "$CERTIFICATE" ] || \
             %%OPENSSLBASE%%/bin/openssl req \
                  -x509 \
                  -newkey rsa:4096 \
-                 -keyout "$PRIVATEKEY" \
+                 -keyout "$PRIVATEKEY".sample \
                  -sha256 \
                  -nodes \
-                 -out "$CERTIFICATE" \
+                 -out "$CERTIFICATE".sample \
                  -days 365 \
                  -subj "/CN=$(hostname)"
+
+        for f in "$RSAKEYS" "$PRIVATEKEY" "$CERTIFICATE"
+        do
+            [ -e "${f}" ] || cp -n "${f}.sample" "${f}"
+        done
         ;;
     *)
         echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811280812.wAS8CItm025197>