ooo-build r13808 - in trunk: . bin/piece patches/dev300



Author: pmladek
Date: Fri Sep  5 12:31:43 2008
New Revision: 13808
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13808&view=rev

Log:
2008-09-05  Petr Mladek  <pmladek suse cz>

	* patches/dev300/piece-solenv.diff: generate the split file lists
	  again
	* bin/piece/sys-setup.in, bin/piece/install-generic: take the
	  selected localizations from configure
	* bin/piece/file-list-postprocess, bin/piece/file-list-components:
	* bin/piece/file-list-libs_core, bin/piece/file-list-l10n:
	* bin/piece/file-list-ure, bin/piece/file-list-libs_gui:
	* bin/piece/sys-setup.in, bin/piece/install-generic:
	* bin/piece/merge-file-lists: process the file lists; generate
	  pyuno and mono, icon-themes subpackages; more to come
	* bin/piece/install-generic, bin/piece/save-noarch:
	  push the prebuilt langpacks stuff back to sovler, so it
	  can be later installed to a single common package per language
	* bin/piece/post-inst-postprocess: magic stuff to register the
	  services
	* configure.in: add --enable-build-noarch option



Added:
   trunk/bin/piece/file-list-components   (contents, props changed)
   trunk/bin/piece/file-list-l10n   (contents, props changed)
   trunk/bin/piece/file-list-libs_core   (contents, props changed)
   trunk/bin/piece/file-list-libs_gui   (contents, props changed)
   trunk/bin/piece/file-list-postprocess   (contents, props changed)
   trunk/bin/piece/file-list-ure   (contents, props changed)
   trunk/bin/piece/merge-file-lists   (contents, props changed)
   trunk/bin/piece/post-inst-postprocess   (contents, props changed)
   trunk/bin/piece/save-noarch   (contents, props changed)
Modified:
   trunk/ChangeLog
   trunk/bin/piece/Makefile.am
   trunk/bin/piece/install-generic
   trunk/bin/piece/sys-setup.in
   trunk/configure.in
   trunk/patches/dev300/piece-solenv.diff

Modified: trunk/bin/piece/Makefile.am
==============================================================================
--- trunk/bin/piece/Makefile.am	(original)
+++ trunk/bin/piece/Makefile.am	Fri Sep  5 12:31:43 2008
@@ -5,7 +5,9 @@
 	noulf noulfconv \
 	install-generic \
 	install-bootstrap \
+	save-noarch \
 	${wildcard env-*} \
 	${wildcard build-*} \
+	${wildcard file-list-*} \
 	${wildcard inst-*} \
 	${wildcard post-inst-*}

Added: trunk/bin/piece/file-list-components
==============================================================================
--- (empty file)
+++ trunk/bin/piece/file-list-components	Fri Sep  5 12:31:43 2008
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+piece=$1
+ooo_build_tag=$2
+
+source $OO_TOOLSDIR/piece/sys-setup
+
+# generate the common file list
+$OO_TOOLSDIR/piece/merge-file-lists "files-$piece.txt" $DESTDIR/gid_*
+
+# prune redundant files the scp2 likes to make for us
+remove_file "files-$piece.txt" "$OO_INSTDIR/basis-link"
+remove_dir  "files-$piece.txt" "$OO_INSTDIR/ure"
+# solver is not in the file list, so rm is enough
+rm -f "$DESTDIR/$OO_INSTDIR/solver/bin/packinfo*.txt"
+
+exit 0

Added: trunk/bin/piece/file-list-l10n
==============================================================================
--- (empty file)
+++ trunk/bin/piece/file-list-l10n	Fri Sep  5 12:31:43 2008
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+piece=$1
+ooo_build_tag=$2
+
+source $OO_TOOLSDIR/piece/sys-setup
+
+# generate the common file list
+$OO_TOOLSDIR/piece/merge-file-lists "files-$piece.txt" $DESTDIR/gid_*
+
+# prune redundant files the scp2 likes to make for us
+remove_file "files-$piece.txt" "$OO_INSTDIR/basis-link"
+remove_dir  "files-$piece.txt" "$OO_INSTDIR/ure"
+
+exit 0

Added: trunk/bin/piece/file-list-libs_core
==============================================================================
--- (empty file)
+++ trunk/bin/piece/file-list-libs_core	Fri Sep  5 12:31:43 2008
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+piece=$1
+ooo_build_tag=$2
+
+source $OO_TOOLSDIR/piece/sys-setup
+
+# generate the common file list
+$OO_TOOLSDIR/piece/merge-file-lists "files-$piece.txt" $DESTDIR/gid_*
+
+remove_file "files-$piece.txt" "$OO_INSTDIR/basis-link"
+remove_file "files-$piece.txt" "$OO_INSTDIR/basis3.0/program/services.rdb"
+remove_dir  "files-$piece.txt" "$OO_INSTDIR/ure"
+
+exit 0

Added: trunk/bin/piece/file-list-libs_gui
==============================================================================
--- (empty file)
+++ trunk/bin/piece/file-list-libs_gui	Fri Sep  5 12:31:43 2008
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+piece=$1
+ooo_build_tag=$2
+
+source $OO_TOOLSDIR/piece/sys-setup
+
+# generate the common file list
+$OO_TOOLSDIR/piece/merge-file-lists "files-$piece.txt" $DESTDIR/gid_*
+
+remove_dir "files-$piece.txt" $OO_INSTDIR/basis-link
+remove_dir "files-$piece.txt" $OO_INSTDIR/basis3.0/ure-link
+remove_dir "files-$piece.txt" $OO_INSTDIR/ure
+
+exit 0

Added: trunk/bin/piece/file-list-postprocess
==============================================================================
--- (empty file)
+++ trunk/bin/piece/file-list-postprocess	Fri Sep  5 12:31:43 2008
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+piece=$1
+ooo_build_tag=$2
+
+source $OO_TOOLSDIR/piece/sys-setup
+
+# icon themes subpackages
+$OO_TOOLSDIR/piece/merge-file-lists "files-icon-themes.txt" $DESTDIR/gid_Module_Root_Files_Images
+
+# generate the common file list
+$OO_TOOLSDIR/piece/merge-file-lists "files-$piece.txt" $DESTDIR/gid_*

Added: trunk/bin/piece/file-list-ure
==============================================================================
--- (empty file)
+++ trunk/bin/piece/file-list-ure	Fri Sep  5 12:31:43 2008
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+piece=$1
+ooo_build_tag=$2
+
+source $OO_TOOLSDIR/piece/sys-setup
+
+# pyuno subpackages
+$OO_TOOLSDIR/piece/merge-file-lists "files-pyuno.txt" $DESTDIR/gid_Module_Optional_Pyuno
+
+# merge the rest already now, so we could extract the mono stuff
+$OO_TOOLSDIR/piece/merge-file-lists "files-$piece.txt" $DESTDIR/gid_*
+
+# mono subpackage
+rm -f files-mono.txt
+mv_file_between_flists files-mono.txt files-$piece.txt $OO_INSTDIR/basis3.0/program/cli_.*.dll
+mv_file_between_flists files-mono.txt files-$piece.txt $OO_INSTDIR/basis3.0/program/cli_.*.dll.config
+mv_file_between_flists files-mono.txt files-$piece.txt $OO_INSTDIR/basis3.0/program/policy.*.cli_.*.dll
+mv_file_between_flists files-mono.txt files-$piece.txt $OO_INSTDIR/ure/lib/cli_.*.dll
+mv_file_between_flists files-mono.txt files-$piece.txt $OO_INSTDIR/ure/lib/cli_.*.dll.config
+mv_file_between_flists files-mono.txt files-$piece.txt $OO_INSTDIR/ure/lib/policy.*.cli_.*.dll
+mv_file_between_flists files-mono.txt files-$piece.txt $OO_INSTDIR/ure/lib/libcli_.*.so
+add_used_directories files-mono.txt files-$piece.txt
+# add the files from GAC if it was installed
+test -f mono_gac && cat mono_gac >>files-mono.txt
+
+exit 0

Modified: trunk/bin/piece/install-generic
==============================================================================
--- trunk/bin/piece/install-generic	(original)
+++ trunk/bin/piece/install-generic	Fri Sep  5 12:31:43 2008
@@ -20,13 +20,21 @@
 export LOCAL_COMMON_OUT=$OUT;
 # install from the copy in the solver - to the system
 export SOLARVERSION="`pwd`/solver"
-export LANGS="en-US,en-GB"
 
 if test "z$DESTDIR" == "z"; then
     echo "install-generic requires a destdir to be set"
     exit 1
 fi
 
+export LANGS=
+for lang in $OO_LANGS ; do
+    if test -z "$LANGS" ; then
+	LANGS="$lang"
+    else
+	LANGS="$LANGS,$lang"
+    fi
+done
+
 perl -w $SOLARENV/bin/make_installer.pl \
      -f $OO_INSTDIR/solver/instsetoo_native/util/openoffice.lst \
      -l $LANGS -p OpenOffice -debug -verbose -log -buildid $BUILD -destdir $DESTDIR \
@@ -44,6 +52,21 @@
 $OO_TOOLSDIR/piece/copyexcept -x $filelist $SRCDIR/* $DEST
 rm -f $filelist
 
+# hack to install the noarch files later in the noarch RPMs
+if test -n "$DESTDIR" -a "$OOO_BUILD_NOARCH" = 'YES' ; then
+    $OO_TOOLSDIR/piece/save-noarch $piece $ooo_build_tag || exit 1;
+fi
+
+# file lists
+if test -n "$DESTDIR" -a "$OO_BUILD_FILE_LISTS_ENABLE" != "NO" ; then
+    custom_file_list="$OO_TOOLSDIR/piece/file-list-$piece"
+    if test -f $custom_file_list; then
+	$custom_file_list $piece $ooo_build_tag $DISTRO || exit 1;
+    else
+	$OO_TOOLSDIR/piece/merge-file-lists "files-$piece.txt" $DESTDIR/gid_*
+    fi
+fi
+
 find $DEST -depth -name "CVS" -type d -exec rm -rf {} \;
 find $DEST -name "*.orig" -exec rm -rf {} \;
 find $DEST -type f -exec chmod go-w {} \;
@@ -51,7 +74,6 @@
 
 # custom post install stuff
 custom_post_install="$OO_TOOLSDIR/piece/post-inst-$piece"
-echo test -f $custom_post_install
-if test -f $custom_post_install; then
-    $custom_post_install $piece $ooo_build_tag $DISTRO
+if test -f $custom_post_install -a "$OO_BUILD_POST_PROCESS_ENABLE" != "NO" ; then
+    $custom_post_install $piece $ooo_build_tag $DISTRO || exit 1;
 fi

Added: trunk/bin/piece/merge-file-lists
==============================================================================
--- (empty file)
+++ trunk/bin/piece/merge-file-lists	Fri Sep  5 12:31:43 2008
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# merge severla file lists into a single one
+
+# Usage: merge-file-lists out_filelist in_filelist...
+
+out=$1
+shift
+
+rm -f $out.new
+touch $out.new
+for list in $* ; do
+    grep "^%dir" $list >>$out.new
+    for file in `grep -v "^%dir" $list` ; do
+	# FIXME: ignore some files that are in the file list but are not
+	#        installed (mostly .rdb files)
+	if test -e $DESTDIR$file ; then
+	    echo "$file" >>$out.new
+	else
+	    echo "WARNING: Ignoring in the file list: $file"
+	fi
+    done
+    rm -f $list
+done
+sed -e "s|/./|/|g" $out.new | sort -u  >$out
+rm $out.new

Added: trunk/bin/piece/post-inst-postprocess
==============================================================================
--- (empty file)
+++ trunk/bin/piece/post-inst-postprocess	Fri Sep  5 12:31:43 2008
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+piece=$1
+ooo_build_tag=$2
+
+source $OO_TOOLSDIR/piece/sys-setup
+
+# Now do magic stuff to register the services - fully hacky (sadly).
+export OO_BUILD_SERVICES=1
+# avoid infinite recursion ;-)
+export OO_BUILD_POST_PROCESS_ENABLE='NO'
+# do not remove the already created file lists
+export OO_BUILD_FILE_LISTS_ENABLE='NO'
+#
+$OO_TOOLSDIR/piece/install-generic $piece $ooo_build_tag
+# urgh - unbelievably nasty:
+cp -a OpenOffice/gid_Starregistry_Services_Rdb_servicesrdb/*/services.rdb \
+    $DESTDIR$OO_INSTDIR/basis3.0/program/services.rdb
+cp -a OpenOffice/gid_Starregistry_Services_Rdb_Ure_servicesrdb/*/services.rdb \
+    $DESTDIR$OO_INSTDIR/ure/share/misc/services.rdb
+# udpate the file list
+if test -f "files-$piece.txt" ; then
+    echo "$OO_INSTDIR/basis3.0/program/services.rdb" >>"files-$piece.txt"
+    echo "$OO_INSTDIR/ure/share/misc/services.rdb" >>"files-$piece.txt"
+fi
+
+# no need for solver bits at this late stage
+rm -Rf "$DESTDIR/$OO_INSTDIR/solver"

Added: trunk/bin/piece/save-noarch
==============================================================================
--- (empty file)
+++ trunk/bin/piece/save-noarch	Fri Sep  5 12:31:43 2008
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+piece=$1
+ooo_build_tag=$2
+
+source $OO_TOOLSDIR/piece/sys-setup
+
+# this script saves the architecture independent files back into solver
+# they could be installed later in the noarch RPMs
+
+# the file lists are needed
+test -n "$DESTDIR" || exit 0;
+
+# you should use --enable-build-noarch configure switch to enable this feature
+test "$OOO_BUILD_NOARCH" = 'YES' || exit 0;
+
+DEST="$DESTDIR$OO_SOLVERDIR/noarch"
+
+echo "Saving noarch stuff back into solver ..."
+
+# always create the top dir, so we could put it into the package even when
+# just en-US is being built
+mkdir -p $DEST
+
+# lang packs are noarch
+for list in  $DESTDIR/gid_Module_Langpack* ; do
+    test -f $list || continue;
+    # we want to keep the en_US localization in the package
+    echo $list | grep "en_US" && continue;
+    for file in `grep -v "^%dir" $list | sort -ru` ; do
+	dir=`dirname $file`
+	mkdir -p "$DEST$dir"
+	mv "$DESTDIR$file" "$DEST$dir"
+	rmdir --ignore-fail-on-non-empty "$DESTDIR$dir"
+    done
+    mv $list $DEST
+done
+
+# icon themes are noarch but they could be keep as is in the separate package
+# and just repacked later, see $OO_TOOLSDIR/piece/file-list-postprocess

Modified: trunk/bin/piece/sys-setup.in
==============================================================================
--- trunk/bin/piece/sys-setup.in	(original)
+++ trunk/bin/piece/sys-setup.in	Fri Sep  5 12:31:43 2008
@@ -3,6 +3,8 @@
 # stuff from configure
 export DISTRO='@DISTRO@'
 export OO_INSTDIR= libdir@/@OOOINSTALLDIRNAME@
+export OO_LANGS='@OOO_LANGS@'
+export OOO_BUILD_NOARCH='@OOO_BUILD_NOARCH@'
 
 if test "z$OO_INSTDIR" == "z"; then
     echo "Error: missing oo instdir"
@@ -15,11 +17,13 @@
 
 # installed system libraries
 URE_DIR=$OO_INSTDIR/ure
-INSTALL_DIR=$OO_INSTDIR/basis3.0/program
+BASIS_DIR=$OO_INSTDIR/basis3.0
+INSTALL_DIR=$BASIS_DIR/program
 DEV_DIR=$OO_SOLVERDIR
 
 # dmake can't cope with '_' in env. var names (interestingly)
 export SPLITUREDIR=$URE_DIR
+export SPLITBASISDIR=$BASIS_DIR
 export SPLITINSTALLDIR=$INSTALL_DIR
 export SPLITDEVDIR=$DEV_DIR
 
@@ -66,3 +70,54 @@
 SOLARLIB="$SOLARLIB $SOLARLIB_SYSTEM"
 export SOLARLIB SOLARINC
 export SOLARIDLINC="-I$SOLARVERSION/$INPATH/idl$EXT_UPDMINOR -I$SOLARPIECE/$INPATH/idl$EXT_UPDMINOR"
+
+# some useful funtions
+
+# remove installed file even from the file list
+# Params: file_list file_to_remove
+remove_file()
+{
+    rm -f "$DESTDIR/$2"
+    perl -pi -e "s|^$2$||" "$1"
+}
+
+# remove installed directory even from the file list
+# Params: file_list dir_to_remove
+remove_dir()
+{
+    echo rm -rf "$DESTDIR/$2"
+    rm -rf "$DESTDIR/$2"
+    perl -pi -e "s|^(%dir\s*)?$2.*$||" "$1"
+}
+
+# move one file from one list of files to a second one
+# Params: target_file_list source_file_list file_to_move
+mv_file_between_flists()
+{
+    if grep "^$3\$" $2 >/dev/null 2>&1 ; then
+        # \$3 can be regular expression
+	grep "^$3\$" $2 >>$1
+	perl -pi -e "s|^$3$||" $2
+    fi
+}
+# add the directories from the source list of files to the target list of
+# file which are used in the target list of files but are missing there
+# Params: target_file_list source_file_list
+add_used_directories()
+{
+    sort -u -r $2 | sed -n "s|^%dir \(.*\)\$|s%^\\\\(\1\\\\).*%\\\\1%p|p" >$2.pattern
+    sed -n -f $2.pattern $1 | sort -u | sed "s|^|%dir |" >>$1
+    rm $2.pattern
+    sort -u $1 >$1.unique
+    mv $1.unique $1
+}
+
+# remove a duplicity between two filelist
+# Params: filelist_with_original filelist_with_duplicity duplicit_path
+remove_duplicity_from_flists()
+{
+    if grep "$3" "$1" >/dev/null 2>&1 && \
+       grep "$3" "$2" >/dev/null 2>&1 ; then
+	perl -pi -e "s|^$3$||" $2
+    fi
+}

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Fri Sep  5 12:31:43 2008
@@ -251,6 +251,13 @@
 			  debugging symbols are not removed.],
 ,)
 
+AC_ARG_ENABLE(build-noarch,
+[
+  --enable-build-noarch
+			  Allow to build some pieces in architecture
+			  independent RPMS (icon themes, help, l10n)],
+,)
+
 AC_ARG_ENABLE(split-app-modules,
 [
   --enable-split-app-modules
@@ -763,6 +770,12 @@
 AGFA_MONOTYPE_FONTS_SOURCE='agfa-monotype-fonts.tar.gz'
 AC_SUBST(AGFA_MONOTYPE_FONTS_SOURCE)
 
+OOO_BUILD_NOARCH="NO"
+if test "z$enable_build_noarch" = "zyes"; then
+    OOO_BUILD_NOARCH="YES"
+fi
+AC_SUBST(OOO_BUILD_NOARCH)
+
 SPLIT_APP_MODULES="NO"
 if test "z$enable_split_app_modules" = "zyes"; then
    SPLIT_APP_MODULES="YES"

Modified: trunk/patches/dev300/piece-solenv.diff
==============================================================================
--- trunk/patches/dev300/piece-solenv.diff	(original)
+++ trunk/patches/dev300/piece-solenv.diff	Fri Sep  5 12:31:43 2008
@@ -165,7 +165,7 @@
 
 --- solenv/bin/modules/installer/worker.pm	2008-07-22 13:49:26.000000000 +0100
 +++ solenv/bin/modules/installer/worker.pm	2008-07-22 13:49:26.000000000 +0100
-@@ -730,6 +730,17 @@
+@@ -730,6 +730,17 @@ sub remove_all_items_with_special_flag
  	return \ allitems;
  }
  
@@ -183,7 +183,7 @@
  ###########################################################
  # Mechanism for simple installation without packing
  ###########################################################
-@@ -748,6 +759,7 @@
+@@ -748,6 +759,7 @@ sub install_simple ($$$$$$)
  
  	my $destdir = $installer::globals::destdir;
  	my @lines = (); 
@@ -191,11 +191,15 @@
  
  	installer::logger::print_message( "DestDir: $destdir \n" );
  	installer::logger::print_message( "Rootpath: $installer::globals::rootpath \n" );
-@@ -797,11 +809,24 @@
+@@ -797,11 +809,24 @@ sub install_simple ($$$$$$)
  
  		push @lines, "$destination\n";
  		# printf "cp $sourcepath $destdir$destination\n";
 -		copy ("$sourcepath", "$destdir$destination") || die "Can't copy file: $sourcepath -> $destdir$destination $!";
+-		my $sourcestat = stat($sourcepath);
+-		utime ($sourcestat->atime, $sourcestat->mtime, "$destdir$destination");
+-		chmod (oct($unixrights), "$destdir$destination") || die "Can't change permissions: $!";
+- 		push @lines, "$destination\n";
 +
 +		next if ($installer::globals::split && $sourcepath eq '');
 +
@@ -208,16 +212,16 @@
 +		    }
 +		} else {
 +		    printf "copy file $sourcepath to $destdir$destination\n";
++		    my $sourcestat = stat($sourcepath);
++		    utime ($sourcestat->atime, $sourcestat->mtime, "$destdir$destination");
++		    chmod (oct($unixrights), "$destdir$destination") || die "Can't change permissions: $!";
++ 		    push @lines, "$destination\n";
++		    push @sources, "$sourcepath\n";
 +		}
- 		my $sourcestat = stat($sourcepath);
- 		utime ($sourcestat->atime, $sourcestat->mtime, "$destdir$destination");
- 		chmod (oct($unixrights), "$destdir$destination") || die "Can't change permissions: $!";
-  		push @lines, "$destination\n";
-+		push @sources, "$sourcepath\n";
  	}
  	
  	for ( my $i = 0; $i <= $#{$linksarray}; $i++ )
-@@ -826,9 +851,14 @@
+@@ -826,9 +851,15 @@ sub install_simple ($$$$$$)
  		push @lines, "$destination\n";
  	}
  
@@ -231,11 +235,12 @@
 +		open ($filelist, ">>$fname") || die "Can't open $fname: $!";
 +		print $filelist @sources;
 +		close ($filelist);
-+	} elsif ($destdir ne "" ) {
++	}
++	if ($destdir ne "" ) {
  		my $fname = $installer::globals::destdir . "/$packagename";
  		open ($filelist, ">$fname") || die "Can't open $fname: $!";
  		print $filelist @lines;
-@@ -2292,6 +2322,9 @@
+@@ -2292,6 +2323,9 @@ sub add_variables_from_inc_to_hashref
  		$includefilename =~ s/^\s*//;
  		$includefilename =~ s/\s*$//;
  		$includefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$includefilename, $includepatharrayref, 1);
@@ -245,7 +250,7 @@
  		if ( $$includefilenameref eq "" ) { installer::exiter::exit_program("Include file $includefilename not found!\nADD_INCLUDE_FILES = $allvariables->{'ADD_INCLUDE_FILES'}", "add_variables_from_inc_to_hashref"); }
  
  		$infoline = "Including inc file: $$includefilenameref \n";
-@@ -2916,6 +2949,9 @@
+@@ -2916,6 +2950,9 @@ sub set_spellcheckerlanguages
  {
  	my ( $productlanguagesarrayref, $allvariables ) = @_;
  



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]