Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / bin / distro-install-sdk
blobe8cf28d618d4fcd752414cdfd67c4a2c357ed989
1 #!/bin/sh
3 if test -z "${SRC_ROOT}"; then
4 echo "distro-install-clean-up: No environment set!"
5 exit 1
6 fi
8 if test -d $DESTDIR$INSTALLDIR/sdk ; then
10 echo "SDK installation clean up"
12 # bin potential .orig files
13 find $DESTDIR$INSTALLDIR/sdk -name "*.orig" -exec rm -f {} \;
15 # move some SDK directories to the right place according to FHS
16 # note that examples must stay in $DESTDIR$INSTALLDIR/sdk because there are used
17 # relative paths to $DESTDIR$INSTALLDIR/sdk/setting and it does not work via
18 # a symlink
19 mkdir -p $DESTDIR$PREFIXDIR/include
20 mkdir -p $DESTDIR$DATADIR/idl
21 mkdir -p $DESTDIR$DATADIR/$INSTALLDIRNAME/sdk
22 mkdir -p $DESTDIR$DOCDIR/sdk
23 mv $DESTDIR$INSTALLDIR/sdk/include $DESTDIR$PREFIXDIR/include/$INSTALLDIRNAME
24 if [ -d $DESTDIR$INSTALLDIR/sdk/classes ]; then
25 mv $DESTDIR$INSTALLDIR/sdk/classes $DESTDIR$DATADIR/$INSTALLDIRNAME/sdk/classes
27 mv $DESTDIR$INSTALLDIR/sdk/idl $DESTDIR$DATADIR/idl/$INSTALLDIRNAME
28 mv $DESTDIR$INSTALLDIR/sdk/docs $DESTDIR$DOCDIR/sdk
29 mv $DESTDIR$INSTALLDIR/sdk/share/readme $DESTDIR$DOCDIR/sdk/readme
30 mv $DESTDIR$INSTALLDIR/sdk/index.html $DESTDIR$DOCDIR/sdk
32 # compat symlinks
33 ln -sf $PREFIXDIR/include/$INSTALLDIRNAME $DESTDIR$INSTALLDIR/sdk/include
34 ln -sf $DATADIR/$INSTALLDIRNAME/sdk/classes $DESTDIR$INSTALLDIR/sdk/classes
35 ln -sf $DATADIR/idl/$INSTALLDIRNAME $DESTDIR$INSTALLDIR/sdk/idl
36 ln -sf $DOCDIR/sdk/docs $DESTDIR$INSTALLDIR/sdk/
37 ln -sf $DOCDIR/sdk/index.html $DESTDIR$INSTALLDIR/sdk/index.html
38 ln -sf $INSTALLDIR/sdk/examples $DESTDIR$DOCDIR/sdk/examples
40 # fix file list
41 sed -e "s|^\(%dir \)\?$INSTALLDIR/sdk/include|\1$PREFIXDIR/include/$INSTALLDIRNAME|" \
42 -e "s|^\(%dir \)\?$INSTALLDIR/sdk/classes|\1$DATADIR/$INSTALLDIRNAME/sdk/classes|" \
43 -e "s|^\(%dir \)\?$INSTALLDIR/sdk/idl|\1$DATADIR/idl/$INSTALLDIRNAME|" \
44 -e "s|^\(%dir \)\?$INSTALLDIR/sdk/docs|\1$DOCDIR/sdk/docs|" \
45 -e "s|^\(%dir \)\?$INSTALLDIR/sdk/share/readme|\1$DOCDIR/sdk/readme|" \
46 -e "s|^$INSTALLDIR/sdk/index.html$|$DOCDIR/sdk/index.html|" \
47 -e "s|^\(%dir \)\?$INSTALLDIR/sdk/share.*$||" \
48 -e "/\.orig$/D" \
49 -e "/^$/D" \
50 $DESTDIR/gid_Module_Root_SDK | sort -u \
51 >$DESTDIR/gid_Module_Root_SDK.new
52 mv $DESTDIR/gid_Module_Root_SDK.new $DESTDIR/gid_Module_Root_SDK
54 echo "%dir $DATADIR/$INSTALLDIRNAME/sdk" >>$DESTDIR/gid_Module_Root_SDK
55 echo "%dir $DATADIR/$INSTALLDIRNAME" >>$DESTDIR/gid_Module_Root_SDK
56 echo "%dir $DATADIR/idl" >>$DESTDIR/gid_Module_Root_SDK
57 echo "%dir $DOCDIR/sdk/docs" >>$DESTDIR/gid_Module_Root_SDK
58 echo "%dir $DOCDIR/sdk" >>$DESTDIR/gid_Module_Root_SDK
59 echo "%dir $DOCDIR" >>$DESTDIR/gid_Module_Root_SDK
60 echo "$INSTALLDIR/sdk/include" >>$DESTDIR/gid_Module_Root_SDK
61 echo "$INSTALLDIR/sdk/classes" >>$DESTDIR/gid_Module_Root_SDK
62 echo "$INSTALLDIR/sdk/idl" >>$DESTDIR/gid_Module_Root_SDK
63 echo "$INSTALLDIR/sdk/docs" >>$DESTDIR/gid_Module_Root_SDK
64 echo "$INSTALLDIR/sdk/index.html" >>$DESTDIR/gid_Module_Root_SDK
65 echo "$DOCDIR/sdk/examples" >>$DESTDIR/gid_Module_Root_SDK
67 # generate default profiles
68 sed -e "s,@OO_SDK_NAME@,libreoffice${PRODUCTVERSION}_sdk," \
69 -e "s,@OO_SDK_HOME@,$INSTALLDIR/sdk," \
70 -e "s,@OFFICE_HOME@,$INSTALLDIR," \
71 -e "s,@OO_SDK_MAKE_HOME@,$(dirname $(command -v make))," \
72 -e "s,@OO_SDK_ZIP_HOME@,$(dirname $(command -v zip))," \
73 -e "s,@OO_SDK_CPP_HOME@,$(dirname $(command -v cpp))," \
74 -e "s,@OO_SDK_SED_HOME@,$(dirname $(command -v sed))," \
75 -e "s,@OO_SDK_CAT_HOME@,$(dirname $(command -v cat))," \
76 -e "s,@OO_SDK_JAVA_HOME@,$JAVA_HOME," \
77 -e "s,@OO_SDK_OUTPUT_DIR@,\$HOME," \
78 -e "s,@SDK_AUTO_DEPLOYMENT@,NO," \
79 $DESTDIR$INSTALLDIR/sdk/setsdkenv_unix.sh.in \
80 > $DESTDIR$INSTALLDIR/sdk/setsdkenv_unix.sh
81 chmod 755 $DESTDIR$INSTALLDIR/sdk/setsdkenv_unix.sh
82 echo $INSTALLDIR/sdk/setsdkenv_unix.sh >>$DESTDIR/gid_Module_Root_SDK