Skip to content
Commits on Source (4)
eclipse-debian-helper (1.3) unstable; urgency=medium
* Add a symlink in /usr/lib/eclipse/plugins/ when installing a plugin
* New parameter to set the shortname of a bundle
-- Emmanuel Bourg <ebourg@apache.org> Fri, 28 Sep 2018 00:21:02 +0200
eclipse-debian-helper (1.2) unstable; urgency=medium
* Made the source encoding configurable
......
......@@ -5,6 +5,7 @@
<macrodef name="make-bundle">
<attribute name="name" description="The name of the bundle (for example org.eclipse.foo.bar)"/>
<attribute name="shortname" default="" description="The short name of the bundle (for example eclipse-foo-bar)"/>
<attribute name="depends" default="" description="The comma separated list of local bundles used as dependencies"/>
<attribute name="basedir" default="bundles" description="The base directory holding all the bundles"/>
<attribute name="release" default="8" description="The version of Java targeted"/>
......@@ -92,6 +93,10 @@
</sequential>
</for>
<bundle2shortname bundle="@{name}" property="shortname.@{name}"/>
<if>
<not><equals arg1="@{shortname}" arg2="" /></not>
<then><var name="shortname.@{name}" value="@{shortname}"/></then>
</if>
<concat destfile="debian/bundles.properties" append="true">@{name} ${bundle.version.@{name}} ${shortname.@{name}} lib${shortname.@{name}}-java ${bundle.depends.@{name}}${line.separator}</concat>
<!-- Prepare the pom to be installed in the package -->
......
......@@ -64,15 +64,28 @@ sub install {
my $file = "debian/bundles.properties";
open(my $data, '<', $file) or die "Could not open '$file' $!\n";
while (my $line = <$data>) {
# Parse the line
chomp $line;
my @fields = split(/\s/ , $line);
my $bundle = $fields[0];
my $version = $fields[1];
my $shortname = $fields[2];
my $package = $fields[3];
my $dependencies = $fields[4];
# Install the Maven artifacts
$this->doit_in_builddir("mh_installpom", "-p$fields[3]", "--no-parent", "-e$fields[1]", "$this->{bundledir}/$fields[0]/target/pom.xml");
$this->doit_in_builddir("mh_installjar", "-p$fields[3]", "--java-lib", "-e$fields[1]", "--usj-name=$fields[2]", "$this->{bundledir}/$fields[0]/target/pom.xml", "$this->{bundledir}/$fields[0]/target/$fields[0].jar");
$this->doit_in_builddir("mh_installpom", "-p$package", "--no-parent", "-e$version", "$this->{bundledir}/$bundle/target/pom.xml");
$this->doit_in_builddir("mh_installjar", "-p$package", "--java-lib", "-e$version", "--usj-name=$shortname", "$this->{bundledir}/$bundle/target/pom.xml", "$this->{bundledir}/$bundle/target/$bundle.jar");
# Specify the bundle dependencies in the substvars file
addsubstvar($fields[3], "bundle:Depends", $fields[4]);
addsubstvar($package, "bundle:Depends", $dependencies);
# Add a symlink in /usr/lib/eclipse/plugins/ for plugins
open(PROJECT_FILE, "$this->{bundledir}/$bundle/.project");
if (grep{/org.eclipse.pde.PluginNature/} <PROJECT_FILE>) {
$this->doit_in_builddir("dh_link", "-p$package", "/usr/share/java/$shortname.jar", "/usr/lib/eclipse/plugins/${bundle}_${version}.jar");
}
close PROJECT_FILE;
}
}
......