Description: Build jars as OSGi bundles
 Added OSGi metadata to jar manifests. The patch is mostly based on a patch attached to the upstream bug, with some edits.
Author: Luca Stancapiano <jedim@vige.it> (original)
Author: Mat Scales <mat@wibbly.org.uk> (debianization)
Origin: https://issues.apache.org/jira/browse/LUCENE-3167
Index: lucene3/common-build.xml
===================================================================
--- lucene3.orig/common-build.xml	2011-11-29 09:21:38.245633846 +0000
+++ lucene3/common-build.xml	2011-11-29 09:21:38.521634620 +0000
@@ -365,42 +365,17 @@
     <attribute name="implementation.title"/>
     <attribute name="spec.version"/>
     <sequential>
-      <manifest file="${manifest.file}">
-        <!--
-        http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#JAR%20Manifest
-        http://java.sun.com/j2se/1.5.0/docs/guide/versioning/spec/versioning2.html
-        http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Package.html
-        http://java.sun.com/j2se/1.5.0/docs/api/java/util/jar/package-summary.html
-        http://java.sun.com/developer/Books/javaprogramming/JAR/basics/manifest.html
-        -->
-        <!-- Don't set 'Manifest-Version' it identifies the version of the
-             manifest file format, and should always be 1.0 (the default)
-
-             Don't set 'Created-by' attribute, its purpose is
-             to identify the version of java used to build the jar,
-             which ant will do by default.
-
-             Ant will happily override these with bogus strings if you
-             tell it to, so don't.
-
-             NOTE: we don't use section info because all of our manifest data
-             applies to the entire jar/war ... no package specific info.
-        -->
-        <attribute name="Extension-Name" value="@{implementation.title}"/>
-        <attribute name="Specification-Title" value="@{title}"/>
-        <!-- spec version must match "digit+{.digit+}*" -->
-        <attribute name="Specification-Version" value="@{spec.version}"/>
-        <attribute name="Specification-Vendor"
-                   value="The Apache Software Foundation"/>
-        <attribute name="Implementation-Title" value="@{implementation.title}"/>
-        <!-- impl version can be any string -->
-        <attribute name="Implementation-Version"
-                   value="${version} - ${DSTAMP} ${TSTAMP}"/>
-        <attribute name="Implementation-Vendor"
-                   value="The Apache Software Foundation"/>
-        <attribute name="X-Compile-Source-JDK" value="${javac.source}"/>
-        <attribute name="X-Compile-Target-JDK" value="${javac.target}"/>
-      </manifest>
+      <xmlproperty file="${ant.file}" collapseAttributes="true" prefix="bnd"/>
+      <property name="bndclasspath" refid="classpath"/>
+      <property name="-savemanifest" value="${common.dir}/build/MANIFEST.MF"/>
+      <property name="-output" value="${common.dir}/build"/>
+      <taskdef resource="aQute/bnd/ant/taskdef.properties" classpath="/usr/share/java/bnd.jar" />
+      <bnd
+        classpath="${bndclasspath}"
+        eclipse="false"
+        failok="true"
+        exceptions="true"
+        files="${common.dir}/debian/lucene.bnd" />
     </sequential>
   </macrodef>
 	
