aboutsummaryrefslogtreecommitdiffstats
path: root/net/xrdp/Makefile
blob: 516862edfdb95b18f0c7da9e0f5088402e3e7771 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Created by: alepulver
# $FreeBSD$

PORTNAME=   xrdp
DISTVERSIONPREFIX=  v
DISTVERSION=    0.9.12
PORTEPOCH=  1
CATEGORIES= net
DIST_SUBDIR?=   ${PORTNAME}

PATCH_SITES=    https://github.com/${GH_ACCOUNT}/${PORTNAME}/commit/

MAINTAINER= meta@FreeBSD.org
COMMENT=    Open source Remote Desktop Protocol (RDP) server

LICENSE=    APACHE20
LICENSE_FILE=   ${WRKSRC}/COPYING

BUILD_DEPENDS=  ${LOCALBASE}/bin/nasm:devel/nasm
RUN_DEPENDS=    xterm:x11/xterm \
        ${LOCALBASE}/lib/xorg/modules/libxorgxrdp.so:x11-drivers/xorgxrdp \
        ${LOCALBASE}/lib/pulse-13.0/modules/module-xrdp-sink.so:audio/pulseaudio-module-xrdp

USES=       autoreconf:build compiler:c11 jpeg localbase libtool pkgconfig \
        ssl xorg
USE_XORG=   ice pixman sm x11 xfixes xrandr
USE_LDCONFIG=   ${PREFIX}/lib/xrdp
USE_GITHUB= yes

GNU_CONFIGURE=  yes
GH_ACCOUNT= neutrinolabs
GH_PROJECT= xrdp librfxcodec:librfxcodec libpainter:libpainter
GH_TAGNAME= v0.1.5:librfxcodec v0.1.1:libpainter

CONFIGURE_ARGS= --localstatedir=/var --enable-strict-locations \
        --with-pkgconfigdir=${LOCALBASE}/libdata/pkgconfig \
        --enable-jpeg --enable-pixman --enable-rfxcodec --enable-painter
LDFLAGS+=   -lssl
CONFLICTS=  xrdp-devel[0-9]*
INSTALL_TARGET= install-strip
SUB_FILES=  pkg-deinstall pkg-install pkg-message
SUB_LIST=   OPENSSLBASE=${OPENSSLBASE}

OPTIONS_DEFINE= DEBUG FUSE IPV6
OPTIONS_DEFAULT=    FDKAAC OPUS
OPTIONS_GROUP=  AUDIO_CODEC
OPTIONS_GROUP_AUDIO_CODEC=  FDKAAC MP3LAME OPUS
FDKAAC_DESC=    Enable Fraunhofer FDK AAC for audio redirection
FUSE_DESC=  Enable drive redirection via FUSE (experimental)
MP3LAME_DESC=   Enable MP3 Lame for audio redirection
OPUS_DESC=  Enable Opus for audio redirection

DEBUG_CONFIGURE_ENABLE= xrdpdebug
FDKAAC_CONFIGURE_ENABLE=    fdkaac
FDKAAC_LIB_DEPENDS= libfdk-aac.so:audio/fdk-aac
FUSE_CONFIGURE_ENABLE=  fuse
FUSE_USES=      fuse
IPV6_CONFIGURE_ENABLE=  ipv6
MP3LAME_CONFIGURE_ENABLE=   mp3lame
MP3LAME_LIB_DEPENDS=    libmp3lame.so:audio/lame
OPUS_CONFIGURE_ENABLE=  opus
OPUS_LIB_DEPENDS=   libopus.so:audio/opus

.include <bsd.port.pre.mk>

.if ${SSL_DEFAULT} == base
# As base OpenSSL doesn't install a .pc file, some flags such as -lcrypto
# cannot be obtained automatically via pkgconfig. When compiled with base
# OpenSSL, it needs to be specified explicitly.
CONFIGURE_ENV+= OPENSSL_CFLAGS="-I${OPENSSLINC}" \
        OPENSSL_LIBS="-L${OPENSSLLIB} -lcrypto -lssl"
.endif

post-extract:
    # librfxcodec is provided as git submodule
    @${CP} -r ${WRKSRC_librfxcodec}/ ${WRKSRC}/librfxcodec/
    @${CP} -r ${WRKSRC_libpainter}/ ${WRKSRC}/libpainter/

pre-configure:
    @cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ./bootstrap

post-install:
    ${INSTALL_SCRIPT} ${FILESDIR}/startwm.sh ${STAGEDIR}${ETCDIR}

post-stage:
    @${RM} ${STAGEDIR}${PREFIX}/etc/xrdp/rsakeys.ini
    @${RM} ${STAGEDIR}${PREFIX}/etc/xrdp/cert.pem
    @${RM} ${STAGEDIR}${PREFIX}/etc/xrdp/key.pem
.for f in sesman.ini startwm.sh reconnectwm.sh xrdp.ini xrdp_keyboard.ini
    @${MV} ${STAGEDIR}${PREFIX}/etc/xrdp/$f ${STAGEDIR}${PREFIX}/etc/xrdp/$f.sample
.endfor

.include <bsd.port.post.mk>