1SUMMARY = "An open source remote desktop protocol(rdp) server." 2 3LICENSE = "Apache-2.0" 4LIC_FILES_CHKSUM = "file://COPYING;md5=72cfbe4e7bd33a0a1de9630c91195c21 \ 5" 6 7inherit features_check autotools pkgconfig useradd systemd 8 9DEPENDS = "openssl virtual/libx11 libxfixes libxrandr libpam nasm-native imlib2 pixman libsm" 10 11REQUIRED_DISTRO_FEATURES = "x11 pam" 12 13SRC_URI = "https://github.com/neutrinolabs/${BPN}/releases/download/v${PV}/${BPN}-${PV}.tar.gz \ 14 file://xrdp.sysconfig \ 15 file://0001-Added-req_distinguished_name-in-etc-xrdp-openssl.con.patch \ 16 file://0001-Fix-the-compile-error.patch \ 17 file://0001-arch-Define-NO_NEED_ALIGN-on-ppc64.patch \ 18 " 19 20SRC_URI[sha256sum] = "c5eea0af055fac90c632e44fb667f1a25c55de2e34b37127e4cb0aabaef90a0f" 21 22CFLAGS += " -Wno-deprecated-declarations" 23 24PACKAGECONFIG ??= "" 25PACKAGECONFIG[fuse] = " --enable-fuse, --disable-fuse, fuse" 26 27USERADD_PACKAGES = "${PN}" 28GROUPADD_PARAM:${PN} = "--system xrdp" 29USERADD_PARAM:${PN} = "--system --home /var/run/xrdp -g xrdp \ 30 --no-create-home --shell /bin/false xrdp" 31 32FILES:${PN} += "${datadir}/dbus-1/services/*.service \ 33 ${datadir}/dbus-1/accessibility-services/*.service " 34 35FILES:${PN}-dev += "${libdir}/xrdp/libcommon.so \ 36 ${libdir}/xrdp/libxrdp.so \ 37 ${libdir}/xrdp/libscp.so \ 38 ${libdir}/xrdp/libxrdpapi.so " 39 40EXTRA_OECONF = "--enable-pam-config=suse --enable-fuse \ 41 --enable-pixman --enable-painter --enable-vsock \ 42 --enable-ipv6 --with-imlib2 --with-socketdir=${localstatedir}/run/${PN}" 43 44do_configure:prepend() { 45 cd ${S} 46 ./bootstrap 47 cd - 48} 49 50do_compile:prepend() { 51 sed -i 's/(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am/(MAKE) $(AM_MAKEFLAGS) install-exec-am/g' ${S}/keygen/Makefile.in 52 echo "" > ${B}/xrdp_configure_options.h 53} 54 55do_install:append() { 56 57 # deal with systemd unit files 58 install -d ${D}${systemd_unitdir}/system 59 install -m 0644 ${S}/instfiles/xrdp.service.in ${D}${systemd_unitdir}/system/xrdp.service 60 install -m 0644 ${S}/instfiles/xrdp-sesman.service.in ${D}${systemd_unitdir}/system/xrdp-sesman.service 61 sed -i -e 's,@localstatedir@,${localstatedir},g' ${D}${systemd_unitdir}/system/xrdp.service ${D}${systemd_unitdir}/system/xrdp-sesman.service 62 sed -i -e 's,@sysconfdir@,${sysconfdir},g' ${D}${systemd_unitdir}/system/xrdp.service ${D}${systemd_unitdir}/system/xrdp-sesman.service 63 sed -i -e 's,@sbindir@,${sbindir},g' ${D}${systemd_unitdir}/system/xrdp.service ${D}${systemd_unitdir}/system/xrdp-sesman.service 64 65 install -d ${D}${sysconfdir}/sysconfig/xrdp 66 install -m 0644 ${S}/instfiles/*.ini ${D}${sysconfdir}/xrdp/ 67 install -m 0644 ${S}/keygen/openssl.conf ${D}${sysconfdir}/xrdp/ 68 install -m 0644 ${WORKDIR}/xrdp.sysconfig ${D}${sysconfdir}/sysconfig/xrdp/ 69 chown xrdp:xrdp ${D}${sysconfdir}/xrdp 70} 71 72SYSTEMD_SERVICE:${PN} = "xrdp.service xrdp-sesman.service" 73 74pkg_postinst:${PN}() { 75 if test -z "$D" 76 then 77 if test -x ${bindir}/xrdp-keygen 78 then 79 ${bindir}/xrdp-keygen xrdp ${sysconfdir}/xrdp/rsakeys.ini >/dev/null 80 fi 81 if test ! -s ${sysconfdir}/xrdp/cert.pem 82 then 83 openssl req -x509 -newkey rsa:2048 -sha256 -nodes -days 3652 \ 84 -keyout ${sysconfdir}/xrdp/key.pem \ 85 -out ${sysconfdir}/xrdp/cert.pem \ 86 -config ${sysconfdir}/xrdp/openssl.conf >/dev/null 2>&1 87 chmod 400 ${sysconfdir}/xrdp/key.pem 88 fi 89 fi 90} 91