From 8124bdf39b719c66e61355c0bc64f8235c4fbec0 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Fri, 8 Jul 2011 12:01:56 +0200 Subject: better support for distro packaging This is port from the build repo. The main differences are: + splits package-ooo into several scripts (bin/distro-install-*) + renames many variables to avoid OOO prefix and to better fit the variables produced by the current bootstrap configure.in + uses OOO_VENDOR from bootstrap/configure.in to add distro specific hacks; the conditions have been updated only for "Novell, inc." + install most of the desktop integration from sysui using sysui/desktop/share/create_tree.sh + do not install two extra templates: $OOINSTBASE/basis$VERSION/share/template/en-US/forms/resume.ott $OOINSTBASE/basis$VERSION/share/template/en-US/officorr/project-proposal.ott should get merged with other templates + do not install pyunorc-update64; it is needed only when you want to run 32-bit LO on 64-bit system; is anyone using it? + do not call install-dictionaries: + do not call build-galleries: is anyone using them? + do not install ootool and ooconfig is anyone using them? are they still working? Signed-off-by: Michael Meeks Signed-off-by: Miklos Vajna Signed-off-by: Bjoern Michaelsen --- bin/distro-install-clean-up | 89 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100755 bin/distro-install-clean-up (limited to 'bin/distro-install-clean-up') diff --git a/bin/distro-install-clean-up b/bin/distro-install-clean-up new file mode 100755 index 000000000000..7283bb9dcf2c --- /dev/null +++ b/bin/distro-install-clean-up @@ -0,0 +1,89 @@ +#!/bin/sh + +. ./*[Ee]nv.[Ss]et.sh + +echo "Cleaning up ..."; + +remove_help_localization() +{ + lang=$1 + + # nothing to be done if the localization is en-US if it does not exist + # or if it is already removed + test "$lang" = "en-US" -o \ + ! -e $DESTDIR$INSTALLDIR/help/$lang -o \ + -L $DESTDIR$INSTALLDIR/help/$lang && return; + + echo "... remove \"$lang\"" + + rm -rf $DESTDIR$INSTALLDIR/help/$lang + grep -v "$INSTALLDIR/help/$lang" $DESTDIR/gid_Module_Root.$lang >$DESTDIR/gid_Module_Root.$lang.new + mv -f $DESTDIR/gid_Module_Root.$lang.new $DESTDIR/gid_Module_Root.$lang + # FIXME: the following code could be used without the condition + # and should replace the lines above after only the milestones + # providing gid_Module_Helppack_Help and fixed gid_Module_Root.$lang + # are supported + # Note: The problem with gid_Module_Root.$lang is that it still includes + # %dir */help/* entries. + # Note: It was still necessary on ppc with gcj (OOo-2.0.2). Strange. Have to + # investigate it later. + if test -f $DESTDIR/gid_Module_Helppack_Help.$lang ; then + grep -v "$INSTALLDIR/help/$lang" $DESTDIR/gid_Module_Helppack_Help.$lang >$DESTDIR/gid_Module_Helppack_Help.$lang.new + mv -f $DESTDIR/gid_Module_Helppack_Help.$lang.new $DESTDIR/gid_Module_Helppack_Help.$lang + fi + + # Note: We created a compat symlink in the past. It is no longer necessary. + # We do not want it because RPM has problems with update when we remove + # poor localizations in never packages +} + +# Check if the English help is installed and is in the main package (is first on the list) +# Note that Java-disabled builds do not create help at all. +if test -f $DESTDIR$INSTALLDIR/help/en/sbasic.cfg -a \ + "`for lang in $WITH_LANG_LIST ; do echo $lang ; break ; done`" = "en-US" ; then + + echo "Removing duplicated English help..." + + for lang in $WITH_LANG_LIST ; do + test ! -f $DESTDIR$INSTALLDIR/help/en/sbasic.cfg -o ! -f $DESTDIR$INSTALLDIR/help/$lang/sbasic.cfg && continue; + if diff $DESTDIR$INSTALLDIR/help/en/sbasic.cfg $DESTDIR$INSTALLDIR/help/$lang/sbasic.cfg >/dev/null 2>&1 ; then + remove_help_localization $lang + fi + done + + echo "Removing poor help localizations..." + + for lang in $WITH_POOR_HELP_LOCALIZATIONS ; do + remove_help_localization $lang + done +fi + +echo "Fixing permissions..." +for dir in $DOCDIR $DESTDIR$INSTALLDIR/basis$PRODUCTVERSION/sdk/examples ; do + if test -d $dir -a -w $dir ; then + find "$dir" -type f \( -name "*.txt" -o -name "*.java" -o -name "*.xml" -o \ + -name "*.xcu" -o -name "*.xcs" -o -name "*.html" -o \ + -name "*.pdf" -o -name "*.ps" -o -name "*.gif" -o \ + -name "*.png" -o -name "*.jpg" -o -name "Makefile" -o \ + -name "manifest.mf" \) -exec chmod 644 {} \; + fi +done + +if test "z$DESTDIR" != "z" ; then + echo "Checking for DESTDIR inside installed files..." + found_destdir= + for file in `find $DESTDIR -type f` ; do + grep -q "$DESTDIR" $file && echo "$file: includes the string \"$DESTDIR\"" && found_destdir=1 + done + if test "z$found_destdir" != "z" ; then + echo "!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!" + echo "The path DESTDIR:$DESTDIR was found inside some" + echo "installed files. It is probably a bug." + echo + echo "Especially, if the DESTDIR is set to \$RPM_BUILD_ROOT" + echo "when creating RPM packages. Even it could be a security hole" + echo "if the application searches /var/tmp for binaries or" + echo "config files because the directory is world-writable." + echo "!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!" + fi +fi -- cgit