Project/build/packaging adjustments + version 1.3
[measurements/measurements.git] / shell-setup
index 357a4f1..9f50e5a 100644 (file)
@@ -1,5 +1,18 @@
 # No shebang; it makes no sense to execute this standalone.
 
-export OO=/usr/lib/openoffice.org/basis3.0
-export PATH=$OO/sdk/bin:$PATH
-export LD_LIBRARY_PATH=$OO/ure-link/lib
+if [ -z "$OOO_BASIS" ]; then
+       basis="$(echo /usr/lib/openoffice.org/basis*)"
+       if ! [ -d "$basis" ]; then
+               echo >&2 "Could not find /usr/lib/openoffice.org/basis* dir."
+               echo >&2 "Make sure you have the OOo SDK installed."
+               return 1
+       fi
+       export OOO_BASIS="$basis"
+
+       # One would hope PATH is set, but we'll use the same test for consistency.
+       export PATH="$OOO_BASIS/sdk/bin:$OOO_BASIS/ure-link/bin${PATH+:${PATH}}"
+
+       # Seems to be no longer needed in OOo 3.1: the executables have the
+       # library path coded into them.
+       #export LD_LIBRARY_PATH="$OOO_BASIS/ure-link/lib${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}"
+fi