From a6b06a896694d82783f108ba8a87e56ac76f82dc Mon Sep 17 00:00:00 2001 From: Michael Simacek Date: Jul 09 2015 15:20:33 +0000 Subject: Update to upstream version 2.4.1 --- diff --git a/.gitignore b/.gitignore index 45ff9af..05da893 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ /aqute-service.tar.gz /bnd-0.0.363.jar +/2.4.1.REL.tar.gz +/biz.aQute.bnd-2.4.1.pom +/biz.aQute.bndlib-2.4.1.pom diff --git a/0001-Port-to-Java-8.patch b/0001-Port-to-Java-8.patch new file mode 100644 index 0000000..cda96ad --- /dev/null +++ b/0001-Port-to-Java-8.patch @@ -0,0 +1,25 @@ +From 8989181fa07ecd77e7e4383c692d5122f0114673 Mon Sep 17 00:00:00 2001 +From: Michael Simacek +Date: Tue, 28 Apr 2015 16:45:08 +0200 +Subject: [PATCH 1/3] Port to Java 8 + +--- + aQute.libg/src/aQute/lib/collections/MultiMap.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/aQute.libg/src/aQute/lib/collections/MultiMap.java b/aQute.libg/src/aQute/lib/collections/MultiMap.java +index bcfe354..2e91bdc 100644 +--- a/aQute.libg/src/aQute/lib/collections/MultiMap.java ++++ b/aQute.libg/src/aQute/lib/collections/MultiMap.java +@@ -81,7 +81,7 @@ public class MultiMap extends HashMap> implements Map> + return set.addAll(value); + } + +- public boolean remove(K key, V value) { ++ public boolean remove(Object key, Object value) { + assert keyClass.isInstance(key); + assert valueClass.isInstance(value); + +-- +2.1.0 + diff --git a/0002-Inline-namespace-constants.patch b/0002-Inline-namespace-constants.patch new file mode 100644 index 0000000..84df03f --- /dev/null +++ b/0002-Inline-namespace-constants.patch @@ -0,0 +1,145 @@ +From 60cd6ac1bf9e2ca9c2de1f33ed4fe3b7225f8f08 Mon Sep 17 00:00:00 2001 +From: Michael Simacek +Date: Tue, 28 Apr 2015 17:02:29 +0200 +Subject: [PATCH 2/3] Inline namespace constants + +--- + .../src/aQute/bnd/obr/OBRFragment.java | 22 ++++++++++------------ + biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java | 18 ++++++++---------- + 2 files changed, 18 insertions(+), 22 deletions(-) + +diff --git a/biz.aQute.bndlib/src/aQute/bnd/obr/OBRFragment.java b/biz.aQute.bndlib/src/aQute/bnd/obr/OBRFragment.java +index 5311772..fb1c029 100644 +--- a/biz.aQute.bndlib/src/aQute/bnd/obr/OBRFragment.java ++++ b/biz.aQute.bndlib/src/aQute/bnd/obr/OBRFragment.java +@@ -9,9 +9,7 @@ import java.util.regex.*; + import org.osgi.framework.Constants; + import org.osgi.framework.Version; + import org.osgi.framework.namespace.*; +-import org.osgi.namespace.service.*; + import org.osgi.resource.*; +-import org.osgi.service.repository.*; + + import aQute.bnd.header.*; + import aQute.bnd.osgi.*; +@@ -206,10 +204,10 @@ public class OBRFragment { + // + + for (Entry export : d.getParameters(Constants.EXPORT_SERVICE).entrySet()) { +- CapReqBuilder exportedService = new CapReqBuilder(ServiceNamespace.SERVICE_NAMESPACE); ++ CapReqBuilder exportedService = new CapReqBuilder("osgi.service"); + String service = Processor.removeDuplicateMarker(export.getKey()); +- exportedService.addAttribute(ServiceNamespace.SERVICE_NAMESPACE, service); +- exportedService.addAttribute(ServiceNamespace.CAPABILITY_OBJECTCLASS_ATTRIBUTE, ++ exportedService.addAttribute("osgi.service", service); ++ exportedService.addAttribute("objectClass", + export.getValue().get("objectclass")); + resource.addCapability(exportedService); + } +@@ -219,10 +217,10 @@ public class OBRFragment { + // + + for (Entry imported : d.getParameters(Constants.IMPORT_SERVICE).entrySet()) { +- CapReqBuilder importedService = new CapReqBuilder(ServiceNamespace.SERVICE_NAMESPACE); ++ CapReqBuilder importedService = new CapReqBuilder("osgi.service"); + String service = Processor.removeDuplicateMarker(imported.getKey()); + importedService.addDirective(Namespace.REQUIREMENT_FILTER_DIRECTIVE, +- filter(ServiceNamespace.SERVICE_NAMESPACE, service, imported.getValue())); ++ filter("osgi.service", service, imported.getValue())); + resource.addRequirement(importedService); + } + +@@ -266,16 +264,16 @@ public class OBRFragment { + if (!reporter.isOk()) + return reporter; + +- CapReqBuilder content = new CapReqBuilder(ContentNamespace.CONTENT_NAMESPACE); ++ CapReqBuilder content = new CapReqBuilder("osgi.content"); + String sha = SHA1.digest(file).asHex(); +- content.addAttribute(ContentNamespace.CONTENT_NAMESPACE, sha); +- content.addAttribute(ContentNamespace.CAPABILITY_SIZE_ATTRIBUTE, (long) file.length()); +- content.addAttribute(ContentNamespace.CAPABILITY_MIME_ATTRIBUTE, MIME_TYPE_OSGI_BUNDLE); ++ content.addAttribute("osgi.content", sha); ++ content.addAttribute("size", (long) file.length()); ++ content.addAttribute("mime", MIME_TYPE_OSGI_BUNDLE); + + if (base != null) { + String path = file.getAbsolutePath(); + if (base.startsWith(path)) { +- content.addAttribute(ContentNamespace.CAPABILITY_URL_ATTRIBUTE, path.substring(base.length()) ++ content.addAttribute("url", path.substring(base.length()) + .replace(File.separatorChar, '/')); + } else { + reporter.error("Base path %s is not parent of file path: %s", base, file.getAbsolutePath()); +diff --git a/biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java b/biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java +index f32c5b0..887247b 100644 +--- a/biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java ++++ b/biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java +@@ -3,8 +3,6 @@ package aQute.bnd.osgi; + import java.util.*; + import java.util.Map.Entry; + +-import org.osgi.namespace.contract.*; +- + import aQute.bnd.header.*; + import aQute.bnd.osgi.Descriptors.PackageRef; + import aQute.bnd.version.*; +@@ -69,13 +67,13 @@ class Contracts { + contract: for (Entry p : pcs.entrySet()) { + String namespace = p.getKey(); + +- if (namespace.equals(ContractNamespace.CONTRACT_NAMESPACE)) { ++ if (namespace.equals("osgi.contract")) { + Attrs capabilityAttrs = p.getValue(); + +- String name = capabilityAttrs.get(ContractNamespace.CONTRACT_NAMESPACE); ++ String name = capabilityAttrs.get("osgi.contract"); + if (name == null) { + analyzer.warning("No name (attr %s) defined in bundle %s from contract namespace: %s", +- ContractNamespace.CONTRACT_NAMESPACE, from, capabilityAttrs); ++ "osgi.contract", from, capabilityAttrs); + continue contract; + } + +@@ -92,7 +90,7 @@ class Contracts { + Contract c = new Contract(); + c.name = name; + +- String list = capabilityAttrs.get(ContractNamespace.CAPABILITY_USES_DIRECTIVE + ":"); ++ String list = capabilityAttrs.get("uses" + ":"); + if (list == null || list.length() == 0) { + analyzer.warning("Contract %s has no uses: directive in %s.", name, from); + continue contract; // next contract +@@ -100,7 +98,7 @@ class Contracts { + + c.uses = Processor.split(list); + +- c.version = (Version) capabilityAttrs.getTyped(ContractNamespace.CAPABILITY_VERSION_ATTRIBUTE); ++ c.version = (Version) capabilityAttrs.getTyped("version"); + c.from = from; + + if (c.version == null) { +@@ -156,9 +154,9 @@ class Contracts { + void addToRequirements(Parameters requirements) { + for (Contract c : contracts) { + Attrs attrs = new Attrs(c.decorators); +- attrs.put(ContractNamespace.CONTRACT_NAMESPACE, c.name); ++ attrs.put("osgi.contract", c.name); + String range = analyzer.applyVersionPolicy(c.version.toString(), c.decorators.getVersion(), false); +- String name = ContractNamespace.CONTRACT_NAMESPACE; ++ String name = "osgi.contract"; + while (requirements.containsKey(name)) + name += "~"; + +@@ -166,7 +164,7 @@ class Contracts { + + Formatter f = new Formatter(); + try { +- f.format("(&(%s=%s)%s)", ContractNamespace.CONTRACT_NAMESPACE, c.name, r.toFilter()); ++ f.format("(&(%s=%s)%s)", "osgi.contract", c.name, r.toFilter()); + + // TODO : shall we also assert the attributes? + +-- +2.1.0 + diff --git a/0003-Use-equinox-s-annotations.patch b/0003-Use-equinox-s-annotations.patch new file mode 100644 index 0000000..7ba67fa --- /dev/null +++ b/0003-Use-equinox-s-annotations.patch @@ -0,0 +1,238 @@ +From 46db98329dc88e039948f58aa34d151c1aaa7a05 Mon Sep 17 00:00:00 2001 +From: Michael Simacek +Date: Wed, 8 Jul 2015 13:46:30 +0200 +Subject: [PATCH 3/3] Use equinox's annotations + +--- + .../src/aQute/bnd/component/AnnotationReader.java | 19 +++++-------------- + .../src/aQute/bnd/component/ComponentDef.java | 13 ++++--------- + .../src/aQute/bnd/component/HeaderReader.java | 1 - + .../src/aQute/bnd/component/ReferenceScope.java | 13 +++++++++++++ + .../src/aQute/bnd/component/ServiceScope.java | 14 ++++++++++++++ + .../src/aQute/bnd/metatype/DesignateReader.java | 13 +++---------- + biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java | 3 --- + 7 files changed, 39 insertions(+), 37 deletions(-) + create mode 100644 biz.aQute.bndlib/src/aQute/bnd/component/ReferenceScope.java + create mode 100644 biz.aQute.bndlib/src/aQute/bnd/component/ServiceScope.java + +diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/AnnotationReader.java b/biz.aQute.bndlib/src/aQute/bnd/component/AnnotationReader.java +index f979187..8505d8c 100644 +--- a/biz.aQute.bndlib/src/aQute/bnd/component/AnnotationReader.java ++++ b/biz.aQute.bndlib/src/aQute/bnd/component/AnnotationReader.java +@@ -412,7 +412,7 @@ public class AnnotationReader extends ClassDataCollector { + String annoService = raw.get("service"); + if (annoService != null) + annoService = Clazz.objectDescriptorToFQN(annoService); +- ReferenceScope scope = reference.scope(); ++ ReferenceScope scope = ReferenceScope.BUNDLE; + + String service = determineReferenceType(method.getDescriptor().toString(), def, annoService, scope); + +@@ -446,7 +446,7 @@ public class AnnotationReader extends ClassDataCollector { + def.cardinality = reference.cardinality(); + def.policy = reference.policy(); + def.policyOption = reference.policyOption(); +- def.scope = reference.scope(); ++ def.scope = ReferenceScope.BUNDLE; + } + + private String determineReferenceType(String methodDescriptor, ReferenceDef def, String annoService, ReferenceScope scope) { +@@ -545,20 +545,10 @@ public class AnnotationReader extends ClassDataCollector { + component.immediate = comp.immediate(); + if (annotation.get("servicefactory") != null) + component.scope = comp.servicefactory()? ServiceScope.BUNDLE: ServiceScope.SINGLETON; +- if (annotation.get("scope") != null && comp.scope() != ServiceScope.DEFAULT) { +- component.scope = comp.scope(); +- if (comp.scope() == ServiceScope.PROTOTYPE) { +- component.updateVersion(V1_3); +- } +- } + + if (annotation.get("configurationPid") != null) { + component.configurationPid = comp.configurationPid(); +- if (component.configurationPid.length > 1) { +- component.updateVersion(V1_3); +- } else { + component.updateVersion(V1_2); +- } + } + + if (annotation.get("xmlns") != null) +@@ -601,6 +591,7 @@ public class AnnotationReader extends ClassDataCollector { + component.service[i] = ref; + } + } ++ /* + Object[] refAnnotations = annotation.get("reference"); + if (refAnnotations != null) { + for (Object o: refAnnotations) { +@@ -613,11 +604,11 @@ public class AnnotationReader extends ClassDataCollector { + refdef.policy = ref.policy(); + refdef.policyOption = ref.policyOption(); + refdef.target = ref.target(); +- refdef.scope = ref.scope(); ++ refdef.scope = ReferenceScope.BUNDLE; + component.references.put(refdef.name, refdef); + } + } +- ++ */ + } + + /** +diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/ComponentDef.java b/biz.aQute.bndlib/src/aQute/bnd/component/ComponentDef.java +index d5719c2..f975dda 100644 +--- a/biz.aQute.bndlib/src/aQute/bnd/component/ComponentDef.java ++++ b/biz.aQute.bndlib/src/aQute/bnd/component/ComponentDef.java +@@ -39,7 +39,7 @@ class ComponentDef { + String modified; + Boolean enabled; + String xmlns; +- String[] configurationPid; ++ String configurationPid; + List propertyTags = new ArrayList(); + + /** +@@ -162,13 +162,8 @@ class ComponentDef { + + if (configurationPid != null) { + StringBuilder b = new StringBuilder(); +- String space = ""; +- for (String pid: configurationPid) { +- if ("$".equals(pid)) +- pid = name; +- b.append(space).append(pid); +- space = " "; +- } ++ if (configurationPid != null) ++ b.append("$".equals(configurationPid)?name:configurationPid); + component.addAttribute("configuration-pid", b.toString()); + } + Tag impl = new Tag(component, "implementation"); +@@ -252,4 +247,4 @@ class ComponentDef { + return b; + } + +-} +\ No newline at end of file ++} +diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/HeaderReader.java b/biz.aQute.bndlib/src/aQute/bnd/component/HeaderReader.java +index f2ed67f..17539d3 100644 +--- a/biz.aQute.bndlib/src/aQute/bnd/component/HeaderReader.java ++++ b/biz.aQute.bndlib/src/aQute/bnd/component/HeaderReader.java +@@ -16,7 +16,6 @@ import org.osgi.service.component.annotations.ConfigurationPolicy; + import org.osgi.service.component.annotations.ReferenceCardinality; + import org.osgi.service.component.annotations.ReferencePolicy; + import org.osgi.service.component.annotations.ReferencePolicyOption; +-import org.osgi.service.component.annotations.ServiceScope; + + import aQute.bnd.component.error.*; + import aQute.bnd.component.error.DeclarativeServicesAnnotationError.*; +diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceScope.java b/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceScope.java +new file mode 100644 +index 0000000..70f2b78 +--- /dev/null ++++ b/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceScope.java +@@ -0,0 +1,13 @@ ++package aQute.bnd.component; ++enum ReferenceScope { ++ BUNDLE("bundle"), ++ PROTOTYPE("prototype"), ++ PROTOTYPE_REQUIRED("prototype_required"); ++ private final String value; ++ ReferenceScope(String value) { ++ this.value = value; ++ } ++ public String toString() { ++ return value; ++ } ++} +diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/ServiceScope.java b/biz.aQute.bndlib/src/aQute/bnd/component/ServiceScope.java +new file mode 100644 +index 0000000..aa49766 +--- /dev/null ++++ b/biz.aQute.bndlib/src/aQute/bnd/component/ServiceScope.java +@@ -0,0 +1,14 @@ ++package aQute.bnd.component; ++enum ServiceScope { ++ SINGLETON("singleton"), ++ BUNDLE("bundle"), ++ PROTOTYPE("prototype"), ++ DEFAULT("<>"); ++ private final String value; ++ ServiceScope(String value) { ++ this.value = value; ++ } ++ public String toString() { ++ return value; ++ } ++} +diff --git a/biz.aQute.bndlib/src/aQute/bnd/metatype/DesignateReader.java b/biz.aQute.bndlib/src/aQute/bnd/metatype/DesignateReader.java +index 29ebbdb..f1dd9d4 100644 +--- a/biz.aQute.bndlib/src/aQute/bnd/metatype/DesignateReader.java ++++ b/biz.aQute.bndlib/src/aQute/bnd/metatype/DesignateReader.java +@@ -13,7 +13,7 @@ public class DesignateReader extends ClassDataCollector { + private Clazz clazz; + private Map classToOCDMap; + +- private String[] pids; ++ private String pid; + private Annotation designate; + + DesignateReader(Analyzer analyzer, Clazz clazz, Map classToOCDMap) { +@@ -29,14 +29,7 @@ public class DesignateReader extends ClassDataCollector { + + private DesignateDef getDef() throws Exception { + clazz.parseClassFileWithCollector(this); +- if (pids != null && designate != null) { +- if (pids.length != 1) { +- analyzer.error( +- "DS Component %s specifies multiple pids %s, and a Designate which requires exactly one pid", +- clazz.getClassName().getFQN(), Arrays.asList(pids)); +- return null; +- } +- String pid = pids[0]; ++ if (pid != null && designate != null) { + String ocdClass = ((String) designate.get("ocd")); + ocdClass = ocdClass.substring(1, ocdClass.length() - 1); + OCDDef ocd = classToOCDMap.get(ocdClass); +@@ -61,7 +54,7 @@ public class DesignateReader extends ClassDataCollector { + if (a instanceof Designate) + designate = annotation; + else if (a instanceof Component) +- pids = ((Component)a).configurationPid(); ++ pid = ((Component)a).configurationPid(); + } + catch (Exception e) { + e.printStackTrace(); +diff --git a/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java b/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java +index b326c97..52d42c8 100755 +--- a/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java ++++ b/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java +@@ -14,7 +14,6 @@ import aQute.bnd.make.*; + import aQute.bnd.make.component.*; + import aQute.bnd.make.metatype.*; + import aQute.bnd.maven.*; +-import aQute.bnd.metatype.*; + import aQute.bnd.osgi.Descriptors.PackageRef; + import aQute.bnd.osgi.Descriptors.TypeRef; + import aQute.bnd.service.*; +@@ -1548,7 +1547,6 @@ public class Builder extends Analyzer { + static ServiceComponent serviceComponent = new ServiceComponent(); + static DSAnnotations dsAnnotations = new DSAnnotations(); + static MetatypePlugin metatypePlugin = new MetatypePlugin(); +- static MetatypeAnnotations metatypeAnnotations = new MetatypeAnnotations(); + + @Override + protected void setTypeSpecificPlugins(Set list) { +@@ -1557,7 +1555,6 @@ public class Builder extends Analyzer { + list.add(serviceComponent); + list.add(dsAnnotations); + list.add(metatypePlugin); +- list.add(metatypeAnnotations); + super.setTypeSpecificPlugins(list); + } + +-- +2.1.0 + diff --git a/aqute-bnd-0.0.363-ambiguous-base64.patch b/aqute-bnd-0.0.363-ambiguous-base64.patch deleted file mode 100644 index 639bda4..0000000 --- a/aqute-bnd-0.0.363-ambiguous-base64.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -Naur aqute-bnd-0.0.363.orig/src/main/java/aQute/bnd/signing/Signer.java aqute-bnd-0.0.363/src/main/java/aQute/bnd/signing/Signer.java ---- aqute-bnd-0.0.363.orig/src/main/java/aQute/bnd/signing/Signer.java 2009-02-24 16:40:24.000000000 +0000 -+++ aqute-bnd-0.0.363/src/main/java/aQute/bnd/signing/Signer.java 2014-05-09 16:57:46.400038213 +0000 -@@ -119,7 +119,7 @@ - if (algorithms[a] != null) { - byte[] digest = algorithms[a].digest(manbytes); - ps.print(digestNames[a] + "-Digest-Manifest: "); -- ps.print(new Base64(digest)); -+ ps.print(new aQute.lib.base64.Base64(digest)); - ps.print("\r\n"); - } - } -@@ -142,7 +142,7 @@ - if (algorithms[a] != null) { - byte[] digest = algorithms[a].digest(); - String header = digestNames[a] + "-Digest: " -- + new Base64(digest) + "\r\n"; -+ + new aQute.lib.base64.Base64(digest) + "\r\n"; - out.write(header.getBytes()); - } - } diff --git a/aqute-bnd-0.0.363-ant19.patch b/aqute-bnd-0.0.363-ant19.patch deleted file mode 100644 index 2d72bb2..0000000 --- a/aqute-bnd-0.0.363-ant19.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff -Nru aqute-bnd-0.0.363/src/main/java/aQute/bnd/main/bnd.java aqute-bnd-0.0.363-gil/src/main/java/aQute/bnd/main/bnd.java ---- aqute-bnd-0.0.363/src/main/java/aQute/bnd/main/bnd.java 2009-08-21 09:21:24.000000000 +0200 -+++ aqute-bnd-0.0.363-gil/src/main/java/aQute/bnd/main/bnd.java 2013-09-01 14:15:42.325747311 +0200 -@@ -1020,7 +1020,7 @@ - } - - public boolean doWrap(File properties, File bundle, File output, -- File classpath[], int options, Map additional) -+ File classpath[], int options, Map additional) - throws Exception { - if (!bundle.exists()) { - error("No such file: " + bundle.getAbsolutePath()); -diff -Nru aqute-bnd-0.0.363/src/main/java/aQute/lib/osgi/Analyzer.java aqute-bnd-0.0.363-gil/src/main/java/aQute/lib/osgi/Analyzer.java ---- aqute-bnd-0.0.363/src/main/java/aQute/lib/osgi/Analyzer.java 2009-08-20 08:40:30.000000000 +0200 -+++ aqute-bnd-0.0.363-gil/src/main/java/aQute/lib/osgi/Analyzer.java 2013-09-01 14:17:52.246330093 +0200 -@@ -1216,10 +1216,10 @@ - return sb.toString(); - } - -- public void putAll(Map additional, boolean force) { -- for (Iterator> i = additional.entrySet() -+ public void putAll(Map additional, boolean force) { -+ for (Iterator> i = additional.entrySet() - .iterator(); i.hasNext();) { -- Map.Entry entry = i.next(); -+ Map.Entry entry = i.next(); - if (force || getProperties().get(entry.getKey()) == null) - setProperty((String) entry.getKey(), (String) entry.getValue()); - } diff --git a/aqute-bnd.spec b/aqute-bnd.spec index 620c813..537a963 100644 --- a/aqute-bnd.spec +++ b/aqute-bnd.spec @@ -1,66 +1,28 @@ -# Copyright (c) 2000-2008, JPackage Project -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the -# distribution. -# 3. Neither the name of the JPackage Project nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - Name: aqute-bnd -Version: 0.0.363 -Release: 16%{?dist} +Version: 2.4.1 +Release: 1%{?dist} Summary: BND Tool License: ASL 2.0 -URL: http://www.aQute.biz/Code/Bnd - -# NOTE : sources for 0.0.363 are no longer available -# The following links would work for 0.0.370-0.0.401 version range, but -# we need to stay by 0.0.363 to minimize problems during the 1.43.0 introduction -Source0: http://www.aqute.biz/repo/biz/aQute/bnd/%{version}/bnd-%{version}.jar -Source1: http://www.aqute.biz/repo/biz/aQute/bnd/%{version}/bnd-%{version}.pom -Source2: aqute-service.tar.gz - -# from Debian, add source compatibility with ant 1.9 -Patch0: %{name}-%{version}-ant19.patch -# fixing base64 class ambiguity -Patch1: %{name}-%{version}-ambiguous-base64.patch - - +URL: http://www.aqute.biz/Bnd/Bnd BuildArch: noarch -BuildRequires: jpackage-utils -BuildRequires: java-devel -BuildRequires: ant -BuildRequires: felix-osgi-compendium -BuildRequires: felix-osgi-core -BuildRequires: junit +Source0: https://github.com/bndtools/bnd/archive/%{version}.REL.tar.gz +# Auxiliary parent pom, packager-written +Source1: parent.pom +Source2: https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd/%{version}/biz.aQute.bnd-%{version}.pom +Source3: https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/%{version}/biz.aQute.bndlib-%{version}.pom -Requires: java-headless +Patch0: 0001-Port-to-Java-8.patch +Patch1: 0002-Inline-namespace-constants.patch +Patch2: 0003-Use-equinox-s-annotations.patch + +BuildRequires: maven-local +BuildRequires: mvn(ant:ant) +BuildRequires: mvn(org.eclipse.osgi:org.eclipse.osgi) +BuildRequires: mvn(org.eclipse.osgi:org.eclipse.osgi.services) %description -The bnd tool helps you create and diagnose OSGi R4 bundles. +The bnd tool helps you create and diagnose OSGi bundles. The key functions are: - Show the manifest and JAR contents of a bundle - Wrap a JAR so that it becomes a bundle @@ -72,100 +34,104 @@ The tool is capable of acting as: - Directives - Use of macros +%package -n aqute-bndlib +Summary: BND library + +%description -n aqute-bndlib +%{summary}. + %package javadoc Summary: Javadoc for %{name} %description javadoc -Javadoc for %{name}. +API documentation for %{name}. %prep -%setup -q -c - -mkdir -p target/site/apidocs/ -mkdir -p target/classes/ -mkdir -p src/main/ -mv OSGI-OPT/src src/main/java -pushd src/main/java -tar xfs %{SOURCE2} +%setup -q -n bnd-%{version}.REL + +rm gradlew* +find -name '*.jar' -delete +find -name '*.class' -delete + +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + +# reference to Base64 is ambiguous +find -name '*.java' -not -name 'Base64.java' | xargs sed -i 's/\/aQute.lib.base64.Base64/g' + +cp -p %{SOURCE1} pom.xml + +build_section=' + + src + + + src/ + + **/*.java + **/packageinfo + + + +' + +pushd biz.aQute.bnd +cp -p %{SOURCE2} pom.xml +%pom_add_parent biz.aQute.bnd:parent:%{version} +%pom_xpath_inject /pom:project "$build_section" + +%pom_add_dep ant:ant +%pom_add_dep biz.aQute.bnd:biz.aQute.bndlib:%{version} +%pom_add_dep org.eclipse.osgi:org.eclipse.osgi +%pom_add_dep org.eclipse.osgi:org.eclipse.osgi.services +# The common library is expected to be included in all artifacts +cp -r ../aQute.libg/src/* src/ popd -sed -i "s|import aQute.lib.filter.*;||g" src/main/java/aQute/bnd/make/ComponentDef.java -sed -i "s|import aQute.lib.filter.*;||g" src/main/java/aQute/bnd/make/ServiceComponent.java - -# get rid of eclipse plugins which are not usable anyway and complicate -# things -rm -rf src/main/java/aQute/bnd/annotation/Test.java \ - src/main/java/aQute/bnd/{classpath,jareditor,junit,launch,plugin} \ - aQute/bnd/classpath/messages.properties - -# remove bundled stuff -find aQute/ -type f -name "*.class" -delete - -%patch0 -p1 -b .ant19 -%patch1 -p1 -b .base64 - -# Convert CR+LF to LF -sed -i "s|\r||g" LICENSE -mkdir temp -( -cd temp -mkdir -p target/classes/ -mkdir -p src/main/ -%jar -xf ../aQute/bnd/test/aQute.runtime.jar -mv OSGI-OPT/src src/main/java -find aQute -type f -name "*.class" -delete -) -rm -rf aQute/bnd/test/aQute.runtime.jar -%build -export LANG=en_US.utf8 - - -( -cd temp -%{javac} -d target/classes -target 1.5 -source 1.5 -classpath $(build-classpath junit felix/org.osgi.core felix/org.osgi.compendium) $(find src/main/java -type f -name "*.java") -for f in $(find aQute/ -type f -not -name "*.class"); do - cp -p $f target/classes/$f -done - ( - cd target/classes - %jar cmf ../../META-INF/MANIFEST.MF ../../../aQute/bnd/test/aQute.runtime.jar * - ) -) -rm -r temp -export OPT_JAR_LIST=: -export CLASSPATH=$(build-classpath ant) - -%{javac} -d target/classes -target 1.5 -source 1.5 $(find src/main/java -type f -name "*.java") -%{javadoc} -Xdoclint:none -d target/site/apidocs -sourcepath src/main/java aQute.lib.header aQute.lib.osgi aQute.lib.qtokens aQute.lib.filter -cp -p LICENSE maven-dependencies.txt plugin.xml pom.xml target/classes -for f in $(find aQute/ -type f -not -name "*.class"); do - cp -p $f target/classes/$f -done -pushd target/classes -%{jar} cmf ../../META-INF/MANIFEST.MF ../%{name}-%{version}.jar * +pushd biz.aQute.bndlib +cp -p %{SOURCE3} pom.xml +%pom_add_parent biz.aQute.bnd:parent:%{version} +%pom_xpath_inject /pom:project "$build_section" + +%pom_add_dep org.eclipse.osgi:org.eclipse.osgi +%pom_add_dep org.eclipse.osgi:org.eclipse.osgi.services +# The common library is expected to be included in all artifacts +cp -r ../aQute.libg/src/* src/ + +# We don't have metatype-annotations and I haven't found any proper release of it +rm -r src/aQute/bnd/metatype + popd -%install -# jars -install -Dpm 644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar +%mvn_alias biz.aQute.bnd:biz.aQute.bnd :bnd biz.aQute:bnd +%mvn_alias biz.aQute.bnd:biz.aQute.bndlib :bndlib biz.aQute:bndlib -# pom -install -Dm 644 %{SOURCE1} %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom +%mvn_package biz.aQute.bnd:biz.aQute.bndlib bndlib +%mvn_package biz.aQute.bnd:parent __noinstall -# javadoc -install -d -m 755 %{buildroot}%{_javadocdir}/%{name} -cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name} +%build +%mvn_build -- -Dproject.build.sourceEncoding=UTF-8 -%add_maven_depmap +%install +%mvn_install + +%jpackage_script bnd "" "" aqute-bnd bnd 1 %files -f .mfiles -%doc LICENSE +%doc biz.aQute.bnd/LICENSE +%{_bindir}/bnd -%files javadoc -%doc LICENSE -%{_javadocdir}/%{name} +%files -n aqute-bndlib -f .mfiles-bndlib +%doc biz.aQute.bnd/LICENSE + +%files javadoc -f .mfiles-javadoc +%doc biz.aQute.bnd/LICENSE %changelog +* Wed Jul 08 2015 Michael Simacek - 2.4.1-1 +- Update to upstream version 2.4.1 + * Wed Jun 17 2015 Fedora Release Engineering - 0.0.363-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild diff --git a/bnd-0.0.363.pom b/bnd-0.0.363.pom deleted file mode 100644 index ef1b897..0000000 --- a/bnd-0.0.363.pom +++ /dev/null @@ -1,22 +0,0 @@ - - 4.0.0 - biz.aQute - bnd - 0.0.363 - - A utility and plugin to wrap, build, or print bundles - - aQute Bundle Tool - http://www.aQute.biz/Code/Bnd - - aQute SARL - http://www.aQute.biz - - - - All files contained in this JAR are licensed under the Apache 2.0 license, unless noted differently in their source (see swing2swt). - http://www.opensource.org/licenses/apache2.0.php - repo - - - diff --git a/parent.pom b/parent.pom new file mode 100644 index 0000000..7873b42 --- /dev/null +++ b/parent.pom @@ -0,0 +1,171 @@ + + + 4.0.0 + + biz.aQute.bnd + parent + 2.4.1 + + pom + + Parent project for bnd tool suite + Project information for bnd. + http://www.aQute.biz/Code/Bnd + + + aQute SARL + http://www.aQute.biz + + + + + Apache Software License 2.0 + http://www.opensource.org/licenses/apache2.0.php + repo + + + + + + bnd + Peter Kriens + aQute SARL + + Primary Developer + + + + bjhargrave + BJ Hargrave + + + mcculls + Stuart McCulloch + + + njbartlett + Neil Bartlett + Paremus + + + fhuberts + Ferry Huberts + Pelagic + + + psoreide + PK Søreide + Comactivity AB + + + + + + Carter Smithhart + + + + Chabanois Cédric + Entropysoft + + + + Paul Bakker + Luminis Technologies + + + + David Jencks + + + + Rafał Krzewski + Caltha - Krzewski, Mach, Potempski Sp. J. + + + + Xavier Fournet + + + + Casey Crabb + + + + David Bosschaert + + + + Harald Wellmann + + + + Jan Willem Janssen + + + + Marcel Offermans + + + + Marian Grigoras + + + + Markus Wolf + + + + Nicolas Lalevée + + + + Pierre Labiausse + + + + Raymond Auge + + + + Tim Ward + + + + Bram de Kruijff + + + + Tang Yong + + + + Gregory Amerson + + + + Guillaume Nodet + + + + Marc de Jonge + + + + Roman Shevchenko + + + + + https://github.com/bndtools/bnd + scm:git:git://github.com/bndtools/bnd.git + scm:git:ssh://github.com/bndtools/bnd.git + + + + biz.aQute.bndlib + biz.aQute.bnd + + + diff --git a/sources b/sources index 4dc0aa4..36f5699 100644 --- a/sources +++ b/sources @@ -1,2 +1,3 @@ -11fe2398149f85066f6d0b6dc8af225b aqute-service.tar.gz -1d36d0271381964304c08b00b5fd1b4a bnd-0.0.363.jar +6892b9ab733b922210ce4a2f59cf3d85 2.4.1.REL.tar.gz +795114bdc17a6a74754cf5cb437a3e84 biz.aQute.bnd-2.4.1.pom +64884035472441607fff822e48d2dc41 biz.aQute.bndlib-2.4.1.pom