summaryrefslogtreecommitdiff
path: root/distribution/posix/postinst
diff options
context:
space:
mode:
Diffstat (limited to 'distribution/posix/postinst')
-rwxr-xr-xdistribution/posix/postinst21
1 files changed, 21 insertions, 0 deletions
diff --git a/distribution/posix/postinst b/distribution/posix/postinst
new file mode 100755
index 0000000..914534d
--- /dev/null
+++ b/distribution/posix/postinst
@@ -0,0 +1,21 @@
+#!/bin/sh
+LOGF=/tmp/xtrkcad-setup.log
+if [ -f "${LOGF}" ] ; then
+ chmod 666 ${LOGF}
+ echo postinst: $* >> ${LOGF}
+else
+ LOGF=/dev/null
+fi
+
+if [ -d /usr/local/share/xtrkcad ] ; then
+ INSTALLDIR=/usr/local/share/xtrkcad
+elif [ -d /usr/share/xtrkcad ] ; then
+ INSTALLDIR=/usr/share/xtrkcad
+else
+ echo No existing XTrkCad install >> ${LOGF}
+ exit 1
+fi
+
+( su -c "sh ${INSTALLDIR}/xtrkcad-setup install ${INSTALLDIR}" -l $SUDO_USER ) >> ${LOGF} 2>&1
+
+exit 0