Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / solenv / bin / make-raspbian-root-tarball
bloba6540e9f9b1e09fb7a92862ff5d0bb8368f398ea
1 #!/bin/sh
3 # When lacking a proper cross-compilation package system from Linux
4 # (or some other Unix) to Raspbian, instead create a tarball of
5 # headers, libraries and pkg-config files on a Raspbian system and
6 # unpack that then on the build system, and pass in a -sysroot switch
7 # to the cross-compiler.
9 cd /
11 # Exclude irrelevant stuff, like shared libraries that actually are
12 # "modules" loaded at run-time by some software.
14 EXCLUDE='lib/ld-linux \
15 lib/klibc- \
16 lib/arm-linux-gnueabihf/security/ \
17 usr/lib/arm-linux-gnueabihf/ImageMagick- \
18 usr/lib/arm-linux-gnueabihf/autofs/ \
19 usr/lib/arm-linux-gnueabihf/directfb- \
20 usr/lib/arm-linux-gnueabihf/gconv/ \
21 usr/lib/arm-linux-gnueabihf/gdbus- \
22 usr/lib/arm-linux-gnueabihf/gdk-pixbuf- \
23 usr/lib/arm-linux-gnueabihf/gio/ \
24 usr/lib/arm-linux-gnueabihf/gvfs/ \
25 usr/lib/arm-linux-gnueabihf/jack/ \
26 usr/lib/arm-linux-gnueabihf/libgphoto2/ \
27 usr/lib/arm-linux-gnueabihf/libgphoto2_port/ \
28 usr/lib/arm-linux-gnueabihf/libgtk-2.0/ \
29 usr/lib/arm-linux-gnueabihf/libgtk-3.0/ \
30 usr/lib/arm-linux-gnueabihf/libproxy/ \
31 usr/lib/arm-linux-gnueabihf/odbc/ \
32 usr/lib/arm-linux-gnueabihf/pango/ \
33 usr/lib/arm-linux-gnueabihf/plymouth/ \
34 usr/lib/arm-linux-gnueabihf/qt4/ \
35 usr/lib/arm-linux-gnueabihf/sane \
36 usr/lib/libblas.so \
37 usr/lib/liblapack.so'
39 EXCLUDE=`echo "$EXCLUDE" | tr -d '
40 ' | sed -e 's/ /|/g'`
42 FILELIST=`mktemp`
43 STAGINGDIR=`mktemp -d`
45 find lib/*.so* \
46 lib/arm-linux-gnueabihf \
47 usr/include \
48 usr/lib/liblpsolve*.a \
49 usr/lib/*.so* \
50 usr/lib/arm-linux-gnueabihf \
51 usr/lib/jvm/java-6-openjdk-armhf/include \
52 usr/lib/jvm/java-6-openjdk-armhf/jre/lib/arm \
53 usr/lib/pkgconfig \
54 usr/share/pkgconfig \
55 -type f -o -type l |
56 grep -v -E "^($EXCLUDE)" >$FILELIST
58 tar -c --files-from=$FILELIST -f - | (cd $STAGINGDIR && tar xf -)
60 rm $FILELIST
62 cd $STAGINGDIR
63 # Change absolute symlinks to relative
64 find . -type l | xargs ls -ld | grep -- '-> /' |
65 while read mode links user group size month day yearortime link arrow target; do
66 target=`echo "$target" | sed -e 's,/,..;,'`
67 while test `expr index $target /` -gt 0; do
68 target=`echo "$target" | sed -e 's,/,;,'`
69 target="..;$target"
70 done
71 target=`echo "$target" | sed -e 's,;,/,g'`
72 ln -f -s $target $link
73 done
75 RESULT=/tmp/raspbian-root-`date +%Y%m%d`.tar.gz
76 tar czf $RESULT .
78 cd /
79 rm -rf $STAGINGDIR
81 echo === Result in $RESULT ===