Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | SUMMARY = "An open source remote desktop protocol(rdp) server." |
| 2 | |
| 3 | LICENSE = "Apache-2.0" |
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=72cfbe4e7bd33a0a1de9630c91195c21 \ |
| 5 | " |
| 6 | |
Brad Bishop | 8410d61 | 2019-11-25 09:40:59 -0500 | [diff] [blame] | 7 | inherit features_check autotools pkgconfig useradd systemd |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 8 | |
| 9 | DEPENDS = "openssl virtual/libx11 libxfixes libxrandr libpam nasm-native" |
| 10 | |
| 11 | REQUIRED_DISTRO_FEATURES = "x11 pam" |
| 12 | |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 13 | SRC_URI = "git://github.com/neutrinolabs/xrdp.git;branch=devel \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 14 | file://xrdp.sysconfig \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 15 | file://0001-Added-req_distinguished_name-in-etc-xrdp-openssl.con.patch \ |
| 16 | file://0001-Fix-the-compile-error.patch \ |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 17 | file://0001-arch-Define-NO_NEED_ALIGN-on-ppc64.patch \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 18 | " |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 19 | SRCREV = "a4c7ee077c049202d73f82f518b2de958d722890" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 20 | |
| 21 | S = "${WORKDIR}/git" |
| 22 | |
| 23 | PACKAGECONFIG ??= "" |
| 24 | PACKAGECONFIG[fuse] = " --enable-fuse, --disable-fuse, fuse" |
| 25 | |
| 26 | USERADD_PACKAGES = "${PN}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 27 | GROUPADD_PARAM:${PN} = "--system xrdp" |
| 28 | USERADD_PARAM:${PN} = "--system --home /var/run/xrdp -g xrdp \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 29 | --no-create-home --shell /bin/false xrdp" |
| 30 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 31 | FILES:${PN} += "${datadir}/dbus-1/services/*.service \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 32 | ${datadir}/dbus-1/accessibility-services/*.service " |
| 33 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 34 | FILES:${PN}-dev += "${libdir}/xrdp/libcommon.so \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 35 | ${libdir}/xrdp/libxrdp.so \ |
| 36 | ${libdir}/xrdp/libscp.so \ |
| 37 | ${libdir}/xrdp/libxrdpapi.so " |
| 38 | |
| 39 | EXTRA_OECONF = "--enable-pam-config=suse" |
| 40 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 41 | do_configure:prepend() { |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 42 | cd ${S} |
| 43 | ./bootstrap |
| 44 | cd - |
| 45 | } |
| 46 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 47 | do_compile:prepend() { |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 48 | sed -i 's/(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am/(MAKE) $(AM_MAKEFLAGS) install-exec-am/g' ${S}/keygen/Makefile.in |
| 49 | } |
| 50 | |
| 51 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 52 | do_install:append() { |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 53 | install -d ${D}${sysconfdir} |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 54 | install -d ${D}${sysconfdir}/xrdp |
| 55 | install -d ${D}${sysconfdir}/xrdp/pam.d |
| 56 | install -d ${D}${sysconfdir}/sysconfig/xrdp |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 57 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 58 | # deal with systemd unit files |
| 59 | install -d ${D}${systemd_unitdir}/system |
| 60 | install -m 0644 ${S}/instfiles/xrdp.service.in ${D}${systemd_unitdir}/system/xrdp.service |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 61 | install -m 0644 ${S}/instfiles/xrdp-sesman.service.in ${D}${systemd_unitdir}/system/xrdp-sesman.service |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 62 | sed -i -e 's,@localstatedir@,${localstatedir},g' ${D}${systemd_unitdir}/system/xrdp.service ${D}${systemd_unitdir}/system/xrdp-sesman.service |
| 63 | sed -i -e 's,@sysconfdir@,${sysconfdir},g' ${D}${systemd_unitdir}/system/xrdp.service ${D}${systemd_unitdir}/system/xrdp-sesman.service |
| 64 | sed -i -e 's,@sbindir@,${sbindir},g' ${D}${systemd_unitdir}/system/xrdp.service ${D}${systemd_unitdir}/system/xrdp-sesman.service |
| 65 | |
| 66 | install -m 0644 ${S}/instfiles/*.ini ${D}${sysconfdir}/xrdp/ |
Brad Bishop | b809eb9 | 2019-09-18 06:27:43 -0400 | [diff] [blame] | 67 | install -m 0644 ${S}/sesman/sesman.ini.in ${D}${sysconfdir}/xrdp/ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 68 | install -m 0644 ${S}/sesman/startwm.sh ${D}${sysconfdir}/xrdp/ |
Brad Bishop | b809eb9 | 2019-09-18 06:27:43 -0400 | [diff] [blame] | 69 | install -m 0644 ${S}/xrdp/xrdp.ini.in ${D}${sysconfdir}/xrdp/ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 70 | install -m 0644 ${S}/xrdp/xrdp_keyboard.ini ${D}${sysconfdir}/xrdp/ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 71 | install -m 0644 ${S}/keygen/openssl.conf ${D}${sysconfdir}/xrdp/ |
| 72 | install -m 0644 ${WORKDIR}/xrdp.sysconfig ${D}${sysconfdir}/sysconfig/xrdp/ |
| 73 | chown xrdp:xrdp ${D}${sysconfdir}/xrdp |
| 74 | } |
| 75 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 76 | SYSTEMD_SERVICE:${PN} = "xrdp.service xrdp-sesman.service" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 77 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 78 | pkg_postinst:${PN}() { |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 79 | if test -z "$D" |
| 80 | then |
| 81 | if test -x ${bindir}/xrdp-keygen |
| 82 | then |
| 83 | ${bindir}/xrdp-keygen xrdp ${sysconfdir}/xrdp/rsakeys.ini >/dev/null |
| 84 | fi |
| 85 | if test ! -s ${sysconfdir}/xrdp/cert.pem |
| 86 | then |
| 87 | openssl req -x509 -newkey rsa:2048 -sha256 -nodes -days 3652 \ |
| 88 | -keyout ${sysconfdir}/xrdp/key.pem \ |
| 89 | -out ${sysconfdir}/xrdp/cert.pem \ |
| 90 | -config ${sysconfdir}/xrdp/openssl.conf >/dev/null 2>&1 |
| 91 | chmod 400 ${sysconfdir}/xrdp/key.pem |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 92 | fi |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 93 | fi |
| 94 | } |