[SCM] eclipse - Powerful IDE written in java - Debian package. branch, master, updated. 9203efb7d6590accc6435d2c7fc43bb5771d1116

Niels Thykier nthykier-guest at alioth.debian.org
Tue Jan 26 21:04:36 UTC 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "eclipse - Powerful IDE written in java - Debian package.".

The branch, master has been updated
       via  9203efb7d6590accc6435d2c7fc43bb5771d1116 (commit)
      from  054270ca0b9359b7f6e07764f789614d60554f79 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9203efb7d6590accc6435d2c7fc43bb5771d1116
Author: Niels Thykier <niels at thykier.net>
Date:   Tue Jan 26 22:01:39 2010 +0100

    Build and install eclipse with empty third-party source jars.
     - allows repacking of orig.tar.gz with these emptied.
    
    Corrected check in eclipse wrapper.
    Added missing link to swtbug291128 patch.
    Made debian/rules re-generate the eclipse.ini symlink.
     - It is trashed by one of post-install eclipse runs.

-----------------------------------------------------------------------

Summary of changes:
 build.xml                         |    5 +
 debian/extra/eclipse              |    2 +-
 debian/patches/series             |    1 +
 debian/patches/source-jars.patch  |  224 +++++++++++++++++++++++++++++++++++++
 debian/patches/swtbug291128.patch |    2 +-
 debian/rules                      |    2 +
 replacements                      |   17 +++
 unjar-jar                         |  179 +++++++++++++++++++++++++++++
 8 files changed, 430 insertions(+), 2 deletions(-)

diff --git a/build.xml b/build.xml
index a537cb3..a470ea4 100644
--- a/build.xml
+++ b/build.xml
@@ -281,6 +281,11 @@
 			<arg line="-c" />
 			<arg line="${buildDirectory}" />
 		</exec>
+		<chmod perm="+x" file="unjar-jar" />
+		<exec executable="./unjar-jar" failonerror="true">
+			<arg line="-c" />
+			<arg line="${buildDirectory}/plugins" />
+		</exec>
 		<echo file="symlink-stamp" />
 	</target>
 
diff --git a/debian/extra/eclipse b/debian/extra/eclipse
index 4984f45..c155216 100644
--- a/debian/extra/eclipse
+++ b/debian/extra/eclipse
@@ -26,7 +26,7 @@ EOF
 }
 
 
-if [ ! -e ~/eclipse/ ] ; then
+if [ ! -d ~/.eclipse/ ] ; then
     $ECLIPSE -clean -initialize || exit $?
     settings=`echo ~/.eclipse/org.eclipse.platform_*/p2/org.eclipse.equinox.p2.engine/profileRegistry/PlatformProfile.profile/.data/.settings/`
     if [ ! -d "$settings" ] ; then
diff --git a/debian/patches/series b/debian/patches/series
index a0fe6bc..7477c92 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@ system-jars.patch
 codec.patch
 lucene.patch
 swtbug291128.patch
+source-jars.patch
diff --git a/debian/patches/source-jars.patch b/debian/patches/source-jars.patch
new file mode 100644
index 0000000..de96970
--- /dev/null
+++ b/debian/patches/source-jars.patch
@@ -0,0 +1,224 @@
+diff --git a/build.xml b/build.xml
+index a537cb3..a470ea4 100644
+--- a/build.xml
++++ b/build.xml
+@@ -281,6 +281,11 @@
+ 			<arg line="-c" />
+ 			<arg line="${buildDirectory}" />
+ 		</exec>
++		<chmod perm="+x" file="unjar-jar" />
++		<exec executable="./unjar-jar" failonerror="true">
++			<arg line="-c" />
++			<arg line="${buildDirectory}/plugins" />
++		</exec>
+ 		<echo file="symlink-stamp" />
+ 	</target>
+ 
+diff --git a/replacements b/replacements
+index e69de29..41be130 100644
+--- a/replacements
++++ b/replacements
+@@ -0,0 +1,17 @@
++com.ibm.icu.base.source_*.jar
++com.ibm.icu.source_*.jar
++com.jcraft.jsch.source_*.jar
++javax.servlet.jsp.source_*.jar
++javax.servlet.source_*.jar
++org.apache.ant.source_*.jar
++org.apache.commons.codec.source_*.jar
++org.apache.commons.el.source_*.jar
++org.apache.commons.httpclient.source_*.jar
++org.apache.commons.logging.source_*.jar
++org.apache.jasper.source_*.jar
++org.apache.lucene.analysis.source_*.jar
++org.hamcrest.core.source_*.jar
++org.junit.source_*.jar
++org.mortbay.jetty.server.source_*.jar
++org.mortbay.jetty.util.source_*.jar
++org.objectweb.asm.source_*.jar
+diff --git a/unjar-jar b/unjar-jar
+old mode 100644
+new mode 100755
+index e69de29..876789f
+--- a/unjar-jar
++++ b/unjar-jar
+@@ -0,0 +1,179 @@
++#!/usr/bin/perl
++
++use strict;
++use warnings;
++
++my $tmp = undef;
++my $linkdir = ".";
++my $prefix = "link-";
++my @jarpath = (".", "/usr/share/java");
++my $wdir;
++my $rfile = `pwd`;
++my $linkonly = 0;
++my $embed = 0;
++my $ignore = 0;
++chomp($rfile);
++$rfile.="/replacements";
++
++while(defined(my $arg = shift(@ARGV))){
++    my $param;
++    if($arg eq '-c'){
++	$param = shift(@ARGV);
++	choke("Missing argument for $arg") if(!defined($param));
++	chdir($param) or choke("E: Could not cd to $param: $!");
++    } elsif($arg eq '-d'){
++	$linkdir = shift(@ARGV);
++	choke("Missing argument for $arg") if(!defined($linkdir));
++    } elsif($arg eq "-p"){
++	$prefix = shift(@ARGV);
++    } elsif($arg eq "-I"){
++	$param = shift(@ARGV);
++	push(@jarpath, $param);
++    } elsif($arg eq '-l'){
++	$linkonly = 1;
++	$embed = 0;
++    } elsif($arg eq '-e'){
++	$embed = 1;
++	$linkonly = 0;
++    } elsif($arg eq '-i'){
++	$ignore = 1;
++    } else {
++	choke("Unknown argument $arg");
++    }
++}
++
++-d $linkdir or system("mkdir -p \"$linkdir\"") == 0 or choke("Could not create $linkdir");
++
++$SIG{'INT'} = \&cleanup;
++$SIG{'TERM'} = \&cleanup;
++$tmp = `mktemp -d`;
++$wdir = `pwd`;
++chomp($wdir);
++chomp($tmp);
++
++replace($rfile);
++cleanup();
++exit 0;
++
++sub base{
++    my $name = shift;
++    $name =~ s@[^/]*+/@@go;
++    return $name;
++}
++
++sub dolink {
++    my @jars = @_;
++    foreach my $jar (@jars){
++	my $base = base($jar);
++	info("Linking $jar -> $linkdir/$prefix$base");
++	system("ln -sf \"$jar\" \"$linkdir/$prefix$base\"") == 0 or choke("Could not create link $jar -> $linkdir/$prefix$base");
++    }
++}
++
++sub embed {
++    my $file = shift;
++    my @cp = @_;
++    choke("$file does not exist") if( ! -e $file);
++    choke("$file has no classpath") if(scalar(@cp) < 1);
++
++    system("mkdir -p \"$tmp/old\" \"$tmp/new\" && cd \"$tmp/old\" && jar xf \"$wdir/$file\"" . 
++	   " && mv -f \"$tmp/old/META-INF/MANIFEST.MF\" \"$tmp/manifest\"") == 0 or choke("Could not unjar $file");
++    unlink($file) or choke("Unlinking $file: $!");
++    foreach my $jar (@cp){
++	system("unzip \"$jar\" -d  \"$tmp/new\" && rm -fr \"$tmp/new/META-INF/\"") == 0 or choke("Could not unzip $jar");
++    }
++    system("rm -fr \"$tmp/new/META-INF\" && cd \"$tmp/new\" && zip -r \"$wdir/$file\" *");
++    system("jar umf \"$tmp/manifest\" $wdir/$file && rm -fr \"$tmp/\"*") == 0 or choke("Could not create replacement jar.");
++    info("Embedded $file");
++    return 1;
++}
++
++sub repack {
++    my $file = shift;
++    my @cp = map { $_ = "$linkdir/$prefix" . base($_); } @_;
++    choke("$file does not exist") if( ! -e $file);
++
++    system("cd \"$tmp\" && jar xf \"$wdir/$file\"") == 0 or choke("Could not unjar $file");
++
++    unlink($file) or choke("Unlinking $file: $!");
++
++    open(MANIFEST_ORIG, "<", "$tmp/META-INF/MANIFEST.MF") or choke("Opening $tmp/META-INF/MANIFEST.MF");
++    open(MANIFEST, ">", "$tmp/manifest") or choke("Opening $tmp/manifest: $!");
++    while( my $line = <MANIFEST_ORIG> ) {
++	chomp($line);
++	last if($line =~ m/^\s*$/o);
++	print MANIFEST "$line\n";
++    }
++    close(MANIFEST) or choke("Writing $tmp/manifest: $!");
++    close(MANIFEST_ORIG);
++    system("rm -fr \"$tmp/META-INF/\" && find \"$tmp\" -name '*.class' -o -name '*.java' -delete") == 0 or choke("Could not clean $file");
++    system("cd \"$tmp\" && zip -r \"$wdir/$file\" * && jar umf \"$tmp/manifest\" \"$wdir/$file\" && rm -fr \"$tmp/\"*") == 0 or choke("Could not create replacement jar.");
++    info("Replaced $file");
++    return 1;
++}
++
++sub findJars{
++    my @result = ();
++    foreach my $jar (@_) {
++	my $jarfname = undef;
++	next if($jar eq "");
++	foreach my $path (@jarpath) {
++	    if( -e "$path/$jar" ) {
++		$jarfname = "$path/$jar";
++		last;
++	    }
++	}
++	choke("Cannot find $jar in " . join(" ", @jarpath)) unless(defined($jarfname));
++	push(@result, $jarfname),
++    }
++    return @result;
++}
++
++sub replace {
++    my $fname = shift;
++    open(REPLACEMENTS, "<", $fname) or choke("$fname: $!");
++    while( my $line = <REPLACEMENTS> ){
++	my $toReplace;
++	my $rest;
++	my @jars;
++	chomp($line);
++	next if($line =~ m/^#/o);
++	($toReplace, $rest) = split(/\s*;\s*/o, $line);
++	@jars = findJars(split(/\s*,\s*/o, $rest//''));
++	# Make the shell expand wildcards
++	$toReplace = `echo $toReplace`;
++	chomp($toReplace);
++	next if( ! -e $toReplace && $ignore);
++	if($embed) {
++	    embed($toReplace, @jars);
++	    next;
++	}
++	if( -e $toReplace) {
++	    dolink(@jars);
++	    repack($toReplace, @jars) unless($linkonly);
++	} elsif(!$linkonly){
++	    choke("Cannot find $toReplace");
++	}
++    }
++    close(REPLACEMENTS);
++}
++
++sub choke{
++    my $msg = shift;
++    print STDERR "E: $msg\n";
++    cleanup();
++    exit 1;
++}
++
++sub info{
++    my $msg = shift;
++    print "I: $msg\n";
++}
++
++sub cleanup{
++    if(defined($tmp) && -d $tmp){
++	info("Removing $tmp");
++	system("rm -fr \"$tmp\"");
++    }
++}
++
diff --git a/debian/patches/swtbug291128.patch b/debian/patches/swtbug291128.patch
index f9caafd..cdd5bed 100644
--- a/debian/patches/swtbug291128.patch
+++ b/debian/patches/swtbug291128.patch
@@ -1,5 +1,5 @@
 Description: Fixes upstream #291128
-Origin: Fedora
+Origin: Fedora, http://cvs.fedoraproject.org/viewvc/rpms/eclipse/devel/eclipse-swtbug291128.patch?revision=1.2&content-type=text%2Fplain&view=co
 
 --- a/patches/swtbug291128.patch	1969-12-31 19:00:00.000000000 -0500
 +++ b/patches/swtbug291128.patch	2009-12-22 16:46:54.000000000 -0500
diff --git a/debian/rules b/debian/rules
index 964877e..063ed3e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -178,3 +178,5 @@ debian-install-stamp:
 	find $(DEBIAN_PACK_LIBDIR) -depth -type d -empty -delete
 	# fix permissions of scripts
 	chmod +x $(DEB_DESTDIR)usr/lib/eclipse/plugins/org.eclipse.pde.build_*/templates/package-build/*.sh
+	# Regenerate the eclipse.ini symlink - one of the eclipse runs above trashes it.
+	ln -sf /etc/eclipse.ini $(DEB_DESTDIR)usr/lib/eclipse/eclipse.ini
diff --git a/replacements b/replacements
new file mode 100644
index 0000000..41be130
--- /dev/null
+++ b/replacements
@@ -0,0 +1,17 @@
+com.ibm.icu.base.source_*.jar
+com.ibm.icu.source_*.jar
+com.jcraft.jsch.source_*.jar
+javax.servlet.jsp.source_*.jar
+javax.servlet.source_*.jar
+org.apache.ant.source_*.jar
+org.apache.commons.codec.source_*.jar
+org.apache.commons.el.source_*.jar
+org.apache.commons.httpclient.source_*.jar
+org.apache.commons.logging.source_*.jar
+org.apache.jasper.source_*.jar
+org.apache.lucene.analysis.source_*.jar
+org.hamcrest.core.source_*.jar
+org.junit.source_*.jar
+org.mortbay.jetty.server.source_*.jar
+org.mortbay.jetty.util.source_*.jar
+org.objectweb.asm.source_*.jar
diff --git a/unjar-jar b/unjar-jar
new file mode 100755
index 0000000..876789f
--- /dev/null
+++ b/unjar-jar
@@ -0,0 +1,179 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+my $tmp = undef;
+my $linkdir = ".";
+my $prefix = "link-";
+my @jarpath = (".", "/usr/share/java");
+my $wdir;
+my $rfile = `pwd`;
+my $linkonly = 0;
+my $embed = 0;
+my $ignore = 0;
+chomp($rfile);
+$rfile.="/replacements";
+
+while(defined(my $arg = shift(@ARGV))){
+    my $param;
+    if($arg eq '-c'){
+	$param = shift(@ARGV);
+	choke("Missing argument for $arg") if(!defined($param));
+	chdir($param) or choke("E: Could not cd to $param: $!");
+    } elsif($arg eq '-d'){
+	$linkdir = shift(@ARGV);
+	choke("Missing argument for $arg") if(!defined($linkdir));
+    } elsif($arg eq "-p"){
+	$prefix = shift(@ARGV);
+    } elsif($arg eq "-I"){
+	$param = shift(@ARGV);
+	push(@jarpath, $param);
+    } elsif($arg eq '-l'){
+	$linkonly = 1;
+	$embed = 0;
+    } elsif($arg eq '-e'){
+	$embed = 1;
+	$linkonly = 0;
+    } elsif($arg eq '-i'){
+	$ignore = 1;
+    } else {
+	choke("Unknown argument $arg");
+    }
+}
+
+-d $linkdir or system("mkdir -p \"$linkdir\"") == 0 or choke("Could not create $linkdir");
+
+$SIG{'INT'} = \&cleanup;
+$SIG{'TERM'} = \&cleanup;
+$tmp = `mktemp -d`;
+$wdir = `pwd`;
+chomp($wdir);
+chomp($tmp);
+
+replace($rfile);
+cleanup();
+exit 0;
+
+sub base{
+    my $name = shift;
+    $name =~ s@[^/]*+/@@go;
+    return $name;
+}
+
+sub dolink {
+    my @jars = @_;
+    foreach my $jar (@jars){
+	my $base = base($jar);
+	info("Linking $jar -> $linkdir/$prefix$base");
+	system("ln -sf \"$jar\" \"$linkdir/$prefix$base\"") == 0 or choke("Could not create link $jar -> $linkdir/$prefix$base");
+    }
+}
+
+sub embed {
+    my $file = shift;
+    my @cp = @_;
+    choke("$file does not exist") if( ! -e $file);
+    choke("$file has no classpath") if(scalar(@cp) < 1);
+
+    system("mkdir -p \"$tmp/old\" \"$tmp/new\" && cd \"$tmp/old\" && jar xf \"$wdir/$file\"" . 
+	   " && mv -f \"$tmp/old/META-INF/MANIFEST.MF\" \"$tmp/manifest\"") == 0 or choke("Could not unjar $file");
+    unlink($file) or choke("Unlinking $file: $!");
+    foreach my $jar (@cp){
+	system("unzip \"$jar\" -d  \"$tmp/new\" && rm -fr \"$tmp/new/META-INF/\"") == 0 or choke("Could not unzip $jar");
+    }
+    system("rm -fr \"$tmp/new/META-INF\" && cd \"$tmp/new\" && zip -r \"$wdir/$file\" *");
+    system("jar umf \"$tmp/manifest\" $wdir/$file && rm -fr \"$tmp/\"*") == 0 or choke("Could not create replacement jar.");
+    info("Embedded $file");
+    return 1;
+}
+
+sub repack {
+    my $file = shift;
+    my @cp = map { $_ = "$linkdir/$prefix" . base($_); } @_;
+    choke("$file does not exist") if( ! -e $file);
+
+    system("cd \"$tmp\" && jar xf \"$wdir/$file\"") == 0 or choke("Could not unjar $file");
+
+    unlink($file) or choke("Unlinking $file: $!");
+
+    open(MANIFEST_ORIG, "<", "$tmp/META-INF/MANIFEST.MF") or choke("Opening $tmp/META-INF/MANIFEST.MF");
+    open(MANIFEST, ">", "$tmp/manifest") or choke("Opening $tmp/manifest: $!");
+    while( my $line = <MANIFEST_ORIG> ) {
+	chomp($line);
+	last if($line =~ m/^\s*$/o);
+	print MANIFEST "$line\n";
+    }
+    close(MANIFEST) or choke("Writing $tmp/manifest: $!");
+    close(MANIFEST_ORIG);
+    system("rm -fr \"$tmp/META-INF/\" && find \"$tmp\" -name '*.class' -o -name '*.java' -delete") == 0 or choke("Could not clean $file");
+    system("cd \"$tmp\" && zip -r \"$wdir/$file\" * && jar umf \"$tmp/manifest\" \"$wdir/$file\" && rm -fr \"$tmp/\"*") == 0 or choke("Could not create replacement jar.");
+    info("Replaced $file");
+    return 1;
+}
+
+sub findJars{
+    my @result = ();
+    foreach my $jar (@_) {
+	my $jarfname = undef;
+	next if($jar eq "");
+	foreach my $path (@jarpath) {
+	    if( -e "$path/$jar" ) {
+		$jarfname = "$path/$jar";
+		last;
+	    }
+	}
+	choke("Cannot find $jar in " . join(" ", @jarpath)) unless(defined($jarfname));
+	push(@result, $jarfname),
+    }
+    return @result;
+}
+
+sub replace {
+    my $fname = shift;
+    open(REPLACEMENTS, "<", $fname) or choke("$fname: $!");
+    while( my $line = <REPLACEMENTS> ){
+	my $toReplace;
+	my $rest;
+	my @jars;
+	chomp($line);
+	next if($line =~ m/^#/o);
+	($toReplace, $rest) = split(/\s*;\s*/o, $line);
+	@jars = findJars(split(/\s*,\s*/o, $rest//''));
+	# Make the shell expand wildcards
+	$toReplace = `echo $toReplace`;
+	chomp($toReplace);
+	next if( ! -e $toReplace && $ignore);
+	if($embed) {
+	    embed($toReplace, @jars);
+	    next;
+	}
+	if( -e $toReplace) {
+	    dolink(@jars);
+	    repack($toReplace, @jars) unless($linkonly);
+	} elsif(!$linkonly){
+	    choke("Cannot find $toReplace");
+	}
+    }
+    close(REPLACEMENTS);
+}
+
+sub choke{
+    my $msg = shift;
+    print STDERR "E: $msg\n";
+    cleanup();
+    exit 1;
+}
+
+sub info{
+    my $msg = shift;
+    print "I: $msg\n";
+}
+
+sub cleanup{
+    if(defined($tmp) && -d $tmp){
+	info("Removing $tmp");
+	system("rm -fr \"$tmp\"");
+    }
+}
+


hooks/post-receive
-- 
eclipse - Powerful IDE written in java - Debian package.



More information about the pkg-java-commits mailing list