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

Niels Thykier nthykier-guest at alioth.debian.org
Sun Feb 21 11:29:27 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  c1366d8ca62ea0373e94020b005511a6a3283e7b (commit)
      from  8aeca7c0f6bb42cc53ab63d46403ca4a3b916fcb (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 c1366d8ca62ea0373e94020b005511a6a3283e7b
Author: Niels Thykier <niels at thykier.net>
Date:   Sun Feb 21 12:28:21 2010 +0100

    Added a manpage for eh_install and fixed an issue with
     handling globbing. Also added support for given a default
     install name.

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

Summary of changes:
 debian/helper/eh_install |  142 ++++++++++++++++++++++++++++++++++++++--------
 debian/rules             |   14 ++++-
 2 files changed, 131 insertions(+), 25 deletions(-)

diff --git a/debian/helper/eh_install b/debian/helper/eh_install
index 083e7e6..fb7d8ac 100755
--- a/debian/helper/eh_install
+++ b/debian/helper/eh_install
@@ -1,16 +1,73 @@
 #!/usr/bin/perl
 
+=head1 NAME
+
+eh_install - Installs eclipse features and plugins built by pdebuild into package build directories
+
+=cut
+
 use strict;
 use Debian::Debhelper::Dh_Lib;
 
+=head1 SYNOPSIS
+
+B<eh_install> [S<I<debhelper options>>] [B<--eclipse-name=>I<name>] [B<--pdebuild-build-dir=>I<dir>] [S<I<feature/plugin [...]>>]
+
+=head1 DESCRIPTION
+
+eh_install is an eclipse-helper program that handles installing eclipse
+features/plugins built by pdebuild into package build directories.
+
+eh_install uses debhelper behind the scenes and are therefore subject
+to the compat level.
+
+=head1 FILES
+
+=over 4
+
+=item debian/I<package>.eh-install
+
+List the eclipse plugins or features to install into each package and
+optionally under which name. The format is a set of lines, where each
+line lists a file or files to install, and at the end of the line
+tells the name it should be installed under. You may use wildcards in
+the names of the files to install.
+
+If name is not present, eh_install will either use the name given on
+the command line or attempt to guess it from the package name.
+
+=back
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<--eclipse-name=name>
+
+Specifies the name to install under if it is not given in the file.
+
+=item B<--pdebuild-build-dir=dir>
+
+Specifies the directory from where pdebuild was run. Defauls to
+"debian/.eclipse_build".
+
+=back
+
+=cut
+
 my %archpackages;
-my $pdebdir = 'debian/.eclipse-build';
+my $pdebdir = undef;
+my $fallback = undef;
 init(options => {
-    "pdebuild-build-dir=s" => \$pdebdir
+    "pdebuild-build-dir=s" => \$pdebdir,
+    "eclipse-name=s" => \$fallback
 });
 inhibit_log();
 
+# Use default value if none are given.
+$pdebdir = 'debian/.eclipse-build' unless(defined($pdebdir));
 $pdebdir =~ s@/*$@@;
+# Append the actual output dir.
 $pdebdir = "$pdebdir/build/rpmBuild";
 
 foreach my $arch (getpackages("arch")){
@@ -21,25 +78,36 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
     my $installfile = pkgfile($package, "eh-install");
     my $dropins;
     my $lineno = 0;
-    my $defdname = undef;
+    my $defdname = $fallback;
+    my @infiles;
     next if($installfile eq '');
     $defdname = $1 if($package =~ m/^eclipse-(.+)/o);
     $dropins = getDropinsPath($package);
-    open(EH_INSTALL, "<", $installfile) or error("$installfile: $!");
-    while( my $line = <EH_INSTALL> ) {
-	my ($zip, $dname);
-	$line = trim($line);
-	$lineno++;
-	next if($line eq '');
-	($zip, $dname) = split(/\s+/o, $line, 2);
+    @infiles = filedoublearray($installfile);
+    if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
+	push @infiles, [@ARGV];
+    }
+    foreach my $line (@infiles) {
+	my ($zipglob, $dname, $other) = @$line;
+	error("Trailing text in $installfile ($other)") if(defined($other) && length($other) > 0);
 	$dname = $defdname unless(defined($dname) && length($dname) > 0);
-	error("Syntax error in $installfile at line $lineno") unless(defined($dname) && length($dname) > 0 && length($zip) > 0);
-	error("Cannot find $pdebdir/$zip") unless( -e "$pdebdir/$zip");
-	print "Extacting $pdebdir/$zip into $dropins/$dname\n";
-	doit("mkdir", "-p", "$dropins/$dname");
-	doit("unzip", "-qq", "-n", "-d", "$dropins/$dname", "$pdebdir/$zip");
+	error("Missing (and could not guess) eclipse-name for $zipglob for $package - please provide a default.") unless(defined($dname) && length($dname) > 0);
+	foreach my $zip (glob("$pdebdir/$zipglob")){
+	    foreach my $ext (('', '.zip', '.ZIP')){
+		# Guess common extensions.
+		if( -e "$zip"){
+		    $zip = "$zip${ext}";
+		    last;
+		}
+	    }
+	    verbose_print("mkdir -p $dropins/$dname");
+	    verbose_print("unzip -qq -n -d $dropins/$dname $zip");
+	    if (! $dh{NO_ACT}){
+		doit("mkdir", "-p", "$dropins/$dname");
+		doit("unzip", "-qq", "-n", "-d", "$dropins/$dname", "$zip");
+	    }
+	}
     }
-    close(EH_INSTALL);
 }
 
 exit(0);
@@ -51,12 +119,38 @@ sub getDropinsPath{
     return "$prefix/eclipse/dropins";
 }
 
-sub trim{
-    my $text = shift;
-    chomp($text);
-    $text =~ s/^\s++//o;
-    $text =~ s/\s+$//o;
-    $text =~ s/#.*+$//o;
-    return $text;
-}
+=head1 EXAMPLE
+
+Suppose your package builds org.eclipse.emf and org.eclipse.xsd and you want
+to put org.eclipse.emf into eclipse-emf and org.eclipse.xsd into eclipse-xsd.
+Then make debian/eclipse-emf.eh-install contain:
+
+  org.eclipse.emf
+
+and debian/eclipse-xsd.eh-install contain:
+
+  org.eclipse.xsd
+
+eh_install will then install org.eclipse.emf into
+usr/share/eclipse/dropins/emf/ and xsd into
+usr/share/eclipse/dropins/xsd/.
+
+In case your package is not called eclipse-I<name>, or you want to install
+two different features into the same package, you will have to provide a
+name. Suppose you wanted to install both eclipse above into a single
+package called foo, then debian/foo.eh-install should contain:
+
+  org.eclipse.emf emf
+  org.eclipse.xsf xsd
+
+=head1 SEE ALSO
+
+L<debhelper(7)>
+
+This program is a part of eclipse-helper and uses debhelper as backend.
+
+=head1 AUTHOR
+
+Niels Thykier <niels at thykier.net>
 
+=cut
diff --git a/debian/rules b/debian/rules
index fabe2c2..a72a276 100755
--- a/debian/rules
+++ b/debian/rules
@@ -86,7 +86,7 @@ RESULT_DIR := $(SOURCE_DIR)/installation/
 DEBIAN_PACK_LIBDIR := $(DEB_DESTDIR)/usr/lib/eclipse
 PROFILE_ID := PlatformProfile
 
-common-install-impl:: debian-install-stamp generate-pdebuild-scripts
+common-install-impl:: debian-install-stamp generate-pdebuild-scripts build-eclipse-helper
 
 LAUNCHERVERSION = $(shell ls $(DEBIAN_PACK_LIBDIR)/plugins | grep equinox.launcher_ | sed 's/org.eclipse.equinox.launcher_//')
 PDEBUILDVERSION = $(shell ls $(DEBIAN_PACK_LIBDIR)/plugins | grep org.eclipse.pde.build_ | sed 's/org.eclipse.pde.build_//')
@@ -192,3 +192,15 @@ generate-pdebuild-scripts: debian-install-stamp
 	) | sed -e's,^\(.*\),[ ! -e \1 ] \&\& ln -s $$eclipse/\1 \1,' >> $(COPY_PLATFORM_INSTALL)
 	sed -e "s/@PDEBUILDVERSION@/$(PDEBUILDVERSION)/g" -e "s/@COPY_PLATFORM@/$(COPY_PLATFORM)/g" < pdebuild/eclipse-pdebuild.sh > $(PDEBUILD_INSTALL)
 	chmod a+x $(PDEBUILD_INSTALL)
+
+
+# If not given pod2man will give it the same version as perl.
+ECLISPE_HELPER_VERSION=0.0.1
+
+POD2MAN=pod2man --stderr --utf8 -c Eclipse-Helper -r "$(ECLISPE_HELPER_VERSION)" -s 1
+
+build-eclipse-helper:
+	@echo "*** generate-eclipse-helper ***"
+	mkdir -p debian/eclipse-helper/usr/share/man/man1/
+	cd debian/helper/ && find . -maxdepth 1 -type f -name 'eh_*' \
+				-exec $(POD2MAN) {} ../../debian/eclipse-helper/usr/share/man/man1/{}.1 \;


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



More information about the pkg-java-commits mailing list