Commits

Anonymous committed 4563076

CWS-TOOLING: integrate CWS native238_DEV300
2009-03-19 10:48:03 +0100 is r269730 : #i100258# copyright for system integration packages
2009-03-18 14:44:04 +0100 is r269669 : #i100258# license also into system integration packages
2009-03-18 14:23:56 +0100 ihi r269664 : removed debug stuff
2009-03-18 13:24:17 +0100 ihi r269655 : #i100305# 30 -> 3
2009-03-17 17:06:59 +0100 is r269619 : #i100258# license files into solaris packages
2009-03-17 16:25:39 +0100 is r269616 : #i100258# license file into solaris packages

  • Participants
  • Parent commits 2dd5bcc

Comments (0)

Files changed (7)

instsetoo_native/util/openoffice.lst

         active 1
         compression 5
         script ure
-	include {solarenvpath}/{os}/loader2,{solarpath}/bin.{minor}/ure,{solarpath}/bin.{minor},{solarpath}/lib.{minor},{solarenvpath}/{os}/MS
+        include {solarenvpath}/{os}/loader2,{solarpath}/bin.{minor}/ure,{solarpath}/bin.{minor},{solarpath}/bin.{minor}/osl,{solarpath}/lib.{minor},{solarenvpath}/{os}/MS
     }
 }
 

solenv/bin/modules/installer/epmfile.pm

 
 		if ( $$fileref eq "" ) { installer::exiter::exit_program("ERROR: Could not find license file $licensefilename!", "create_epm_header"); }
 
+		# Special handling to add the content of the file "license_en-US" to the solaris copyrightfile
+		if ( $installer::globals::issolarispkgbuild )
+		{
+			if ( ! $installer::globals::englishlicenseset ) { installer::worker::set_english_license() }
+
+			# The location for the new file
+			my $languagestring = "";
+			for ( my $i = 0; $i <= $#{$languagesref}; $i++ ) { $languagestring = $languagestring . "_" . ${$languagesref}[$i]; }
+			$languagestring =~ s/^\s*_//;
+			
+			my $copyrightdir = installer::systemactions::create_directories("copyright", \$languagestring);
+			
+			my $copyrightfile = installer::files::read_file($$fileref);
+
+			# Adding license content to copyright file
+			push(@{$copyrightfile}, "\n");
+			for ( my $i = 0; $i <= $#{$installer::globals::englishlicense}; $i++ ) { push(@{$copyrightfile}, ${$installer::globals::englishlicense}[$i]); }
+
+			# New destination for $$fileref
+			$$fileref = $copyrightdir . $installer::globals::separator . "solariscopyrightfile_" . $onepackage->{'module'};
+			if ( -f $$fileref ) { unlink $$fileref; }
+			installer::files::save_file($$fileref, $copyrightfile);
+		}
+
 		$infoline = "Using license file: \"$$fileref\"!\n";
 		push(@installer::globals::logfileinfo, $infoline);
 
 		# special handling, if new content is a directory
 		my $subdir = "";
 		if ( ! $installer::globals::issolarispkgbuild ) { ($newcontent, $subdir) = control_subdirectories($newcontent); }
+		
+		# Adding license content into Solaris packages
+		if (( $installer::globals::issolarispkgbuild ) && ( $installer::globals::englishlicenseset )) { installer::worker::add_license_into_systemintegrationpackages($destdir, $newcontent); }
 
 		if (( $installer::globals::isxpdplatform ) && ( $allvariables->{'XPDINSTALLER'} ))
 		{

solenv/bin/modules/installer/globals.pm

 	$globalblock = "Globals";
 	$rootmodulegid = "";
 	%alllangmodules = ();
+	$englishlicenseset = 0;
+	$englishlicense = "";
+	$englishsolarislicensename = "LICENSE_en-US";
 	$patharray = "";
 	
 	$is_special_epm = 0;

solenv/bin/modules/installer/worker.pm

 use installer::logger;
 use installer::mail;
 use installer::pathanalyzer;
+use installer::scpzipfiles;
 use installer::scriptitems;
 use installer::sorter;
 use installer::systemactions;
 	# }
 }
 
+################################################
+# Defining the English license text to add
+# it into Solaris packages.
+################################################
+
+sub set_english_license
+{
+	my $additional_license_name = $installer::globals::englishsolarislicensename;	# always the English file
+	my $licensefileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$additional_license_name, "" , 0);
+	if ( $$licensefileref eq "" ) { installer::exiter::exit_program("ERROR: Could not find license file $additional_license_name!", "set_english_license"); }
+	$installer::globals::englishlicenseset = 1;
+	$installer::globals::englishlicense = installer::files::read_file($$licensefileref);
+	installer::scpzipfiles::replace_all_ziplistvariables_in_file($installer::globals::englishlicense, $variableshashref);
+}
+
+##############################################
+# Setting time stamp of copied files to avoid
+# errors from pkgchk.
+##############################################
+
+sub set_time_stamp_for_file
+{
+	my ($sourcefile, $destfile) = @_;
+	
+	my $systemcall = "touch -r $sourcefile $destfile";
+
+	my $returnvalue = system($systemcall);
+
+	my $infoline = "Systemcall: $systemcall\n";
+	push( @installer::globals::logfileinfo, $infoline);
+
+	if ($returnvalue)
+	{
+		$infoline = "ERROR: \"$systemcall\" failed!\n";
+		push( @installer::globals::logfileinfo, $infoline);
+	}
+	else
+	{
+		$infoline = "Success: \"$systemcall\" !\n";
+		push( @installer::globals::logfileinfo, $infoline);
+	}
+}
+
+##############################################
+# Setting checksum and wordcount for changed
+# pkginfo file into pkgmap.
+##############################################
+
+sub change_onefile_in_pkgmap
+{
+	my ($pkgmapfile, $fullfilename, $shortfilename) = @_;
+
+	# 1 i pkginfo 442 34577 1166716297
+	# ->
+	# 1 i pkginfo 443 34737 1166716297
+	# 
+	# wc -c pkginfo | cut -f6 -d' '  -> 442  (variable)
+	# sum pkginfo | cut -f1 -d' '  -> 34577  (variable)
+	# grep 'pkginfo' pkgmap | cut -f6 -d' '  -> 1166716297  (fix)
+
+	my $checksum = call_sum($fullfilename);
+	if ( $checksum =~ /^\s*(\d+)\s+.*$/ ) { $checksum = $1; }
+	
+	my $wordcount = call_wc($fullfilename);
+	if ( $wordcount =~ /^\s*(\d+)\s+.*$/ ) { $wordcount = $1; }
+
+	for ( my $i = 0; $i <= $#{$pkgmapfile}; $i++ )
+	{
+		if ( ${$pkgmapfile}[$i] =~ /(^.*\b\Q$shortfilename\E\b\s+)(\d+)(\s+)(\d+)(\s+)(\d+)(\s*$)/ )
+		{
+			my $newline = $1 . $wordcount . $3 . $checksum . $5 . $6 . $7;
+			${$pkgmapfile}[$i] = $newline;
+			last;
+		}
+	}
+}
+
+################################################
+# Adding the content of the English license
+# file into the system integration packages.
+################################################
+
+sub add_license_into_systemintegrationpackages
+{
+	my ($destdir, $packages) = @_;
+
+	for ( my $i = 0; $i <= $#{$packages}; $i++ )
+	{
+		my $copyrightfilename = ${$packages}[$i] . $installer::globals::separator . "install" . $installer::globals::separator . "copyright";
+		if ( ! -f $copyrightfilename ) { installer::exiter::exit_program("ERROR: Could not find license file in system integration package: $copyrightfilename!", "add_license_into_systemintegrationpackages"); }
+		my $copyrightfile = installer::files::read_file($copyrightfilename);
+		
+		# Saving time stamp of old copyrightfile
+		my $savcopyrightfilename = $copyrightfilename . ".sav";
+		installer::systemactions::copy_one_file($copyrightfilename, $savcopyrightfilename);
+		set_time_stamp_for_file($copyrightfilename, $savcopyrightfilename); # now $savcopyrightfile has the time stamp of $copyrightfile
+	
+		# Adding license content to copyright file
+		push(@{$copyrightfile}, "\n");
+		for ( my $i = 0; $i <= $#{$installer::globals::englishlicense}; $i++ ) { push(@{$copyrightfile}, ${$installer::globals::englishlicense}[$i]); }
+		installer::files::save_file($copyrightfilename, $copyrightfile);
+
+		# Setting the old time stamp saved with $savcopyrightfilename
+		set_time_stamp_for_file($savcopyrightfilename, $copyrightfilename); # now $copyrightfile has the time stamp of $savcopyrightfile
+		unlink($savcopyrightfilename);
+	
+		# Changing content of copyright file in pkgmap
+		my $pkgmapfilename = ${$packages}[$i] . $installer::globals::separator . "pkgmap";
+		if ( ! -f $pkgmapfilename ) { installer::exiter::exit_program("ERROR: Could not find pkgmap in system integration package: $pkgmapfilename!", "add_license_into_systemintegrationpackages"); }
+		my $pkgmap = installer::files::read_file($pkgmapfilename);
+		change_onefile_in_pkgmap($pkgmap, $copyrightfilename, "copyright");
+		installer::files::save_file($pkgmapfilename, $pkgmap);		
+	}
+}
+
 1;

sysui/desktop/solaris/copyright

-Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
+Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 Use is subject to license terms.

sysui/desktop/solaris/makefile.mk

 	@-$(RM) $(BIN)$/$(@:f)
 	@$(MKDIRHIER) $(@:d)
 	pkgmk -l 1073741824 -r . -f $(MISC)$/$(@:b:b:s/-/ /:1)$/prototype -o -d $(PKGDIR) ARCH=$(PKGARCH) VERSION=$(PKGVERSION.$(@:b:s/-/ /:1)),REV=$(PKGREV).$(PKGDATESTRING) 
-	$(FASPAC) $(SOLARBINDIR)/faspac-so.sh -a -d $(PKGDIR) $(@:b:b:s/-/ /:1:s/.//)30-desktop-int
-	@tar -cf - -C $(PKGDIR) $(@:b:b:s/-/ /:1:s/.//)30-desktop-int | gzip > $@
-	@rm -rf $(PKGDIR)/$(@:b:b:s/-/ /:1:s/.//)30-desktop-int
+	$(FASPAC) $(SOLARBINDIR)/faspac-so.sh -a -d $(PKGDIR) $(@:b:b:s/-/ /:1:s/.//)$(PRODUCTVERSIONSHORT)-desktop-int
+	@tar -cf - -C $(PKGDIR) $(@:b:b:s/-/ /:1:s/.//)$(PRODUCTVERSIONSHORT)-desktop-int | gzip > $@
+	@rm -rf $(PKGDIR)/$(@:b:b:s/-/ /:1:s/.//)$(PRODUCTVERSIONSHORT)-desktop-int
 
 .ENDIF

sysui/desktop/solaris/pkginfo

-PKG=%pkgprefix30-desktop-int
+PKG=%pkgprefix3-desktop-int
 NAME=%PRODUCTNAME Solaris desktop integration
 CATEGORY=application
 BASEDIR=/