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 | |
| 7 | inherit distro_features_check autotools pkgconfig useradd systemd |
| 8 | |
| 9 | DEPENDS = "openssl virtual/libx11 libxfixes libxrandr libpam nasm-native" |
| 10 | |
| 11 | REQUIRED_DISTRO_FEATURES = "x11 pam" |
| 12 | |
| 13 | SRC_URI = "git://github.com/neutrinolabs/xrdp.git \ |
| 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 \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 17 | " |
| 18 | |
Brad Bishop | b809eb9 | 2019-09-18 06:27:43 -0400 | [diff] [blame] | 19 | SRCREV = "1e4b03eb3c9aa7173de251a328c93c073dcc0fca" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 20 | |
Brad Bishop | b809eb9 | 2019-09-18 06:27:43 -0400 | [diff] [blame] | 21 | PV = "0.9.11" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 22 | |
| 23 | S = "${WORKDIR}/git" |
| 24 | |
| 25 | PACKAGECONFIG ??= "" |
| 26 | PACKAGECONFIG[fuse] = " --enable-fuse, --disable-fuse, fuse" |
| 27 | |
| 28 | USERADD_PACKAGES = "${PN}" |
| 29 | GROUPADD_PARAM_${PN} = "--system xrdp" |
| 30 | USERADD_PARAM_${PN} = "--system --home /var/run/xrdp -g xrdp \ |
| 31 | --no-create-home --shell /bin/false xrdp" |
| 32 | |
| 33 | FILES_${PN} += "${datadir}/dbus-1/services/*.service \ |
| 34 | ${datadir}/dbus-1/accessibility-services/*.service " |
| 35 | |
| 36 | FILES_${PN}-dev += "${libdir}/xrdp/libcommon.so \ |
| 37 | ${libdir}/xrdp/libxrdp.so \ |
| 38 | ${libdir}/xrdp/libscp.so \ |
| 39 | ${libdir}/xrdp/libxrdpapi.so " |
| 40 | |
| 41 | EXTRA_OECONF = "--enable-pam-config=suse" |
| 42 | |
| 43 | do_configure_prepend() { |
| 44 | cd ${S} |
| 45 | ./bootstrap |
| 46 | cd - |
| 47 | } |
| 48 | |
| 49 | do_compile_prepend() { |
| 50 | sed -i 's/(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am/(MAKE) $(AM_MAKEFLAGS) install-exec-am/g' ${S}/keygen/Makefile.in |
| 51 | } |
| 52 | |
| 53 | |
| 54 | do_install_append() { |
| 55 | install -d ${D}${sysconfdir} |
| 56 | install -d ${D}${sysconfdir}/xrdp |
| 57 | install -d ${D}${sysconfdir}/xrdp/pam.d |
| 58 | install -d ${D}${sysconfdir}/sysconfig/xrdp |
| 59 | |
| 60 | # deal with systemd unit files |
| 61 | install -d ${D}${systemd_unitdir}/system |
| 62 | install -m 0644 ${S}/instfiles/xrdp.service.in ${D}${systemd_unitdir}/system/xrdp.service |
| 63 | install -m 0644 ${S}/instfiles/xrdp-sesman.service.in ${D}${systemd_unitdir}/system/xrdp-sesman.service |
| 64 | sed -i -e 's,@localstatedir@,${localstatedir},g' ${D}${systemd_unitdir}/system/xrdp.service ${D}${systemd_unitdir}/system/xrdp-sesman.service |
| 65 | sed -i -e 's,@sysconfdir@,${sysconfdir},g' ${D}${systemd_unitdir}/system/xrdp.service ${D}${systemd_unitdir}/system/xrdp-sesman.service |
| 66 | sed -i -e 's,@sbindir@,${sbindir},g' ${D}${systemd_unitdir}/system/xrdp.service ${D}${systemd_unitdir}/system/xrdp-sesman.service |
| 67 | |
| 68 | install -m 0644 ${S}/instfiles/*.ini ${D}${sysconfdir}/xrdp/ |
Brad Bishop | b809eb9 | 2019-09-18 06:27:43 -0400 | [diff] [blame] | 69 | install -m 0644 ${S}/sesman/sesman.ini.in ${D}${sysconfdir}/xrdp/ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 70 | install -m 0644 ${S}/sesman/startwm.sh ${D}${sysconfdir}/xrdp/ |
Brad Bishop | b809eb9 | 2019-09-18 06:27:43 -0400 | [diff] [blame] | 71 | install -m 0644 ${S}/xrdp/xrdp.ini.in ${D}${sysconfdir}/xrdp/ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 72 | install -m 0644 ${S}/xrdp/xrdp_keyboard.ini ${D}${sysconfdir}/xrdp/ |
| 73 | install -m 0644 ${S}/instfiles/xrdp.sh ${D}${sysconfdir}/xrdp/ |
| 74 | install -m 0644 ${S}/keygen/openssl.conf ${D}${sysconfdir}/xrdp/ |
| 75 | install -m 0644 ${WORKDIR}/xrdp.sysconfig ${D}${sysconfdir}/sysconfig/xrdp/ |
| 76 | chown xrdp:xrdp ${D}${sysconfdir}/xrdp |
| 77 | } |
| 78 | |
| 79 | SYSTEMD_SERVICE_${PN} = "xrdp.service xrdp-sesman.service" |
| 80 | |
| 81 | pkg_postinst_${PN}() { |
| 82 | if test -z "$D" |
| 83 | then |
| 84 | if test -x ${bindir}/xrdp-keygen |
| 85 | then |
| 86 | ${bindir}/xrdp-keygen xrdp ${sysconfdir}/xrdp/rsakeys.ini >/dev/null |
| 87 | fi |
| 88 | if test ! -s ${sysconfdir}/xrdp/cert.pem |
| 89 | then |
| 90 | openssl req -x509 -newkey rsa:2048 -sha256 -nodes -days 3652 \ |
| 91 | -keyout ${sysconfdir}/xrdp/key.pem \ |
| 92 | -out ${sysconfdir}/xrdp/cert.pem \ |
| 93 | -config ${sysconfdir}/xrdp/openssl.conf >/dev/null 2>&1 |
| 94 | chmod 400 ${sysconfdir}/xrdp/key.pem |
| 95 | fi |
| 96 | fi |
| 97 | } |