summaryrefslogtreecommitdiff
path: root/scripts/release-linux.sh
diff options
context:
space:
mode:
authorkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-30 04:17:05 (GMT)
committerkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-30 04:17:05 (GMT)
commit6940d171812565209efe679a5d923417c3f47d4a (patch)
tree2a05d2f8865ff1127f854db41bf31143f64ccf2d /scripts/release-linux.sh
parent2b19f33ee1ddce246c2bfe0a05fe379d0117a741 (diff)
reorganized file structure layout. more to follow...
git-svn-id: http://svn.clifford.at/openscad/trunk@364 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'scripts/release-linux.sh')
-rwxr-xr-xscripts/release-linux.sh82
1 files changed, 82 insertions, 0 deletions
diff --git a/scripts/release-linux.sh b/scripts/release-linux.sh
new file mode 100755
index 0000000..41a7aa3
--- /dev/null
+++ b/scripts/release-linux.sh
@@ -0,0 +1,82 @@
+#!/bin/bash
+# WARNING: This script might only work with the authors setup...
+
+VERSION=2010.01
+
+set -ex
+
+# svnclean
+
+qmake-qt4 VERSION=$VERSION
+make
+
+rm -rf release
+mkdir -p release/{bin,lib/openscad,examples}
+
+cat > release/bin/openscad << "EOT"
+#!/bin/bash
+
+cd "$( dirname "$( type -p $0 )" )"
+libdir=$PWD/../lib/openscad/
+cd "$OLDPWD"
+
+export LD_LIBRARY_PATH="$libdir${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
+exec $libdir/openscad "$@"
+EOT
+
+cp openscad release/lib/openscad/
+gcc -o chrpath_linux chrpath_linux.c
+./chrpath_linux -d release/lib/openscad/openscad
+
+ldd openscad | sed -re 's,.* => ,,; s,[\t ].*,,;' -e '/Qt|boost/ { p; d; };' \
+ -e '/lib(audio|CGAL|GLEW|opencsg|png)\.so/ { p; d; };' \
+ -e 'd;' | xargs cp -vt release/lib/openscad/
+strip release/lib/openscad/*
+
+cat > release/install.sh << "EOT"
+#!/bin/bash
+
+# change to the install source directory
+cd "$( dirname "$( type -p $0 )" )"
+
+if ! [ -f bin/openscad -a -d lib/openscad -a -d examples ]; then
+ echo "Error: Can't change to install source directory!" >&2
+ exit 1
+fi
+
+echo "This will install openscad. Please enter the install prefix"
+echo "or press Ctrl-C to abort the install process:"
+read -p "[/usr/local]: " prefix
+
+if [ "$prefix" = "" ]; then
+ prefix="/usr/local"
+fi
+
+if [ ! -d "$prefix" ]; then
+ echo; echo "Install prefix \`$prefix' does not exist. Press ENTER to continue"
+ echo "or press Ctrl-C to abort the install process:"
+ read -p "press enter to continue> "
+fi
+
+mkdir -p "$prefix"/{bin,lib/openscad}
+
+if ! [ -w "$prefix"/bin/ -a -w "$prefix"/lib/ ]; then
+ echo "You does not seam to have write permissions for prefix \`$prefix'!" >&2
+ echo "Maybe you should have run this install script using \`sudo'?" >&2
+ exit 1
+fi
+
+echo "Copying application wrappers..."
+cp -rv bin/. "$prefix"/bin/
+
+echo "Copying application and libraries..."
+cp -rv lib/. "$prefix"/lib/
+
+echo "Installation finished. Have a nice day."
+EOT
+
+chmod 755 -R release/
+
+cp examples/* release/examples/
+chmod 644 -R release/examples/*
+
contact: Jan Huwald // Impressum