FreeRDP/xrdp — pull request #86 by cocoon (2013-07-05 20:05:19+00:00)
Title: Dynamically build initscript paths from given prefix

dynamically insert prefix path into init script with sed by when running make install

xrdp initscript add BASE var, add SDAEMON var, replace fullpaths

Maybe in future should be using somethinglike:
sed -e and xrdp.sh > xrdp

as it seems that -i is not POSIX conform, if thats a Problem?

i.e. read here:
http://permalink.gmane.org/gmane.os.illumos.devel/1293)

Tested on Ubuntu 13.10:

Test-Commands

sudo mkdir -p /opt/x/x1
sudo make distclean
./configure --enable-neutrinordp --prefix=/opt/x/x1 --localstatedir=/run/xrdp1
make
sudo make install

with --prefix=/opt/x/x1

chmod 755 /opt/x/x1/etc/xrdp/xrdp.sh
chmod 755 /opt/x/x1/etc/init.d/xrdp
sed -i 's|__BASE__|/opt/x/x1|' /opt/x/x1/etc/init.d/xrdp; \

BASE=/opt/x/x1
DAEMON=${BASE}/sbin/xrdp
SDAEMON=${BASE}/sbin/xrdp-sesman

without --prefix (falling back to /usr/local on Ubuntu):

make[4]: Entering directory `/opt/dev/xrdp/instfiles'
chmod 755 /etc/xrdp/xrdp.sh
chmod 755 /etc/init.d/xrdp
sed -i 's|__BASE__|/usr/local|' /etc/init.d/xrdp; \

File: /etc/init.d/xrdp

BASE=/usr/local
DAEMON=${BASE}/sbin/xrdp
SDAEMON=${BASE}/sbin/xrdp-sesman