2009-12-24 12:17:37 +03:00
|
|
|
#!/bin/bash
|
2009-10-16 12:01:59 +04:00
|
|
|
# WARNING: This script might only work with the authors setup...
|
|
|
|
|
2011-12-30 18:26:16 +04:00
|
|
|
VERSION=`date "+%Y.%m.%d"`
|
|
|
|
#VERSION=2011.12
|
2009-12-13 03:22:07 +03:00
|
|
|
|
2009-10-16 12:01:59 +04:00
|
|
|
set -ex
|
|
|
|
|
2009-10-18 18:09:53 +04:00
|
|
|
# svnclean
|
2009-10-16 12:01:59 +04:00
|
|
|
|
2010-03-02 09:18:09 +03:00
|
|
|
qmake-qt4 VERSION=$VERSION QMAKE_CXXFLAGS_RELEASE="-O3 -march=pentium"
|
2009-10-16 12:01:59 +04:00
|
|
|
make
|
|
|
|
|
|
|
|
rm -rf release
|
2010-02-28 17:05:51 +03:00
|
|
|
mkdir -p release/{bin,lib/openscad,examples,libraries}
|
2009-10-16 12:01:59 +04:00
|
|
|
|
|
|
|
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/
|
2010-02-19 12:51:35 +03:00
|
|
|
gcc -o chrpath_linux scripts/chrpath_linux.c
|
2009-10-16 12:01:59 +04:00
|
|
|
./chrpath_linux -d release/lib/openscad/openscad
|
|
|
|
|
2009-10-18 18:09:53 +04:00
|
|
|
ldd openscad | sed -re 's,.* => ,,; s,[\t ].*,,;' -e '/Qt|boost/ { p; d; };' \
|
2011-04-13 22:20:53 +04:00
|
|
|
-e '/lib(audio|CGAL|GLEW|opencsg|png|gmp|gmpxx|mpfr)\.so/ { p; d; };' \
|
|
|
|
-e 'd;' | xargs cp -vt release/lib/openscad/
|
2009-10-16 12:01:59 +04:00
|
|
|
strip release/lib/openscad/*
|
|
|
|
|
|
|
|
cat > release/install.sh << "EOT"
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# change to the install source directory
|
|
|
|
cd "$( dirname "$( type -p $0 )" )"
|
|
|
|
|
2010-02-28 17:05:51 +03:00
|
|
|
if ! [ -f bin/openscad -a -d lib/openscad -a -d examples -a -d libraries ]; then
|
2009-10-16 12:01:59 +04:00
|
|
|
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
|
|
|
|
|
2010-02-28 17:05:51 +03:00
|
|
|
mkdir -p "$prefix"/{bin,lib/openscad,share/openscad/examples,share/openscad/libraries}
|
2009-10-16 12:01:59 +04:00
|
|
|
|
2010-02-19 12:51:35 +03:00
|
|
|
if ! [ -w "$prefix"/bin/ -a -w "$prefix"/lib/openscad -a -w "$prefix"/share/openscad ]; then
|
2009-10-16 12:01:59 +04:00
|
|
|
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/
|
|
|
|
|
2010-02-28 17:05:51 +03:00
|
|
|
echo "Copying application..."
|
2009-10-16 12:01:59 +04:00
|
|
|
cp -rv lib/. "$prefix"/lib/
|
|
|
|
|
2010-02-19 12:51:35 +03:00
|
|
|
echo "Copying examples..."
|
|
|
|
cp -rv examples/. "$prefix"/share/openscad/examples/
|
|
|
|
|
2010-02-28 17:05:51 +03:00
|
|
|
echo "Copying libraries..."
|
|
|
|
cp -rv libraries/. "$prefix"/share/openscad/libraries/
|
|
|
|
|
2009-10-16 12:01:59 +04:00
|
|
|
echo "Installation finished. Have a nice day."
|
|
|
|
EOT
|
|
|
|
|
|
|
|
chmod 755 -R release/
|
|
|
|
|
2009-10-18 18:09:53 +04:00
|
|
|
cp examples/* release/examples/
|
2009-10-16 12:01:59 +04:00
|
|
|
chmod 644 -R release/examples/*
|
|
|
|
|
2011-09-08 05:27:18 +04:00
|
|
|
cp -R libraries/* release/libraries/
|
|
|
|
chmod -R u=rwx,go=r,+X release/libraries/*
|
|
|
|
rm -rf `find release/libraries -name ".git"`
|