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.
11 # Exclude irrelevant stuff, like shared libraries that actually are
12 # "modules" loaded at run-time by some software.
14 EXCLUDE
='lib/ld-linux \
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 \
39 EXCLUDE
=`echo "$EXCLUDE" | tr -d '
43 STAGINGDIR
=`mktemp -d`
46 lib
/arm-linux-gnueabihf \
48 usr
/lib
/liblpsolve
*.a \
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 \
56 grep -v -E "^($EXCLUDE)" >$FILELIST
58 tar -c --files-from=$FILELIST -f - |
(cd $STAGINGDIR && tar xf
-)
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,/,;,'`
71 target
=`echo "$target" | sed -e 's,;,/,g'`
72 ln -f -s $target $link
75 RESULT
=/tmp
/raspbian-root-
`date +%Y%m%d`.
tar.gz
81 echo === Result
in $RESULT ===