[aqute-bnd] - Fixing ambiguous base64 class - fix rhbz#991985 - add source compatibility with ant 1.9 - remove a

Jaromír Cápík jcapik at fedoraproject.org
Fri May 9 17:15:25 UTC 2014


commit 0bb298621735f1e1eb02cb408933209335a75742
Author: Jaromir Capik <jcapik at redhat.com>
Date:   Fri May 9 19:15:32 2014 +0200

    - Fixing ambiguous base64 class
    - fix rhbz#991985
    - add source compatibility with ant 1.9
    - remove and rebuild from source aQute.runtime.jar
    - update to current packaging guidelines

 aqute-bnd-0.0.363-ambiguous-base64.patch |   21 +++++++++++
 aqute-bnd-0.0.363-ant19.patch            |   29 ++++++++++++++++
 aqute-bnd.spec                           |   54 ++++++++++++++++++++++++++----
 3 files changed, 97 insertions(+), 7 deletions(-)
---
diff --git a/aqute-bnd-0.0.363-ambiguous-base64.patch b/aqute-bnd-0.0.363-ambiguous-base64.patch
new file mode 100644
index 0000000..639bda4
--- /dev/null
+++ b/aqute-bnd-0.0.363-ambiguous-base64.patch
@@ -0,0 +1,21 @@
+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
new file mode 100644
index 0000000..2d72bb2
--- /dev/null
+++ b/aqute-bnd-0.0.363-ant19.patch
@@ -0,0 +1,29 @@
+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<String, String> additional)
++            File classpath[], int options, Map<String, Object> 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<String, String> additional, boolean force) {
+-        for (Iterator<Map.Entry<String, String>> i = additional.entrySet()
++    public void putAll(Map<String, Object> additional, boolean force) {
++        for (Iterator<Map.Entry<String, Object>> i = additional.entrySet()
+                 .iterator(); i.hasNext();) {
+-            Map.Entry<String, String> entry = i.next();
++            Map.Entry<String, Object> 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 a5d03f2..8c669fc 100644
--- a/aqute-bnd.spec
+++ b/aqute-bnd.spec
@@ -30,10 +30,9 @@
 
 Name:           aqute-bnd
 Version:        0.0.363
-Release:        10%{?dist}
+Release:        12%{?dist}
 Summary:        BND Tool
 License:        ASL 2.0
-Group:          Development/Tools
 URL:            http://www.aQute.biz/Code/Bnd
 
 # NOTE : sources for 0.0.363 are no longer available
@@ -43,11 +42,20 @@ Source0:        http://www.aqute.biz/repo/biz/aQute/bnd/%{version}/bnd-%{version
 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
+
+
 BuildArch:      noarch
 
 BuildRequires:  jpackage-utils
 BuildRequires:  java-devel
 BuildRequires:  ant
+BuildRequires:  felix-osgi-compendium
+BuildRequires:  felix-osgi-core
+BuildRequires:  junit
 
 Requires:       java-headless
 
@@ -65,9 +73,7 @@ The tool is capable of acting as:
 - Use of macros
 
 %package javadoc
-Requires:       jpackage-utils
 Summary:        Javadoc for %{name}
-Group:          Documentation
 
 %description javadoc
 Javadoc for %{name}.
@@ -92,15 +98,40 @@ rm -rf src/main/java/aQute/bnd/annotation/Test.java \
        aQute/bnd/classpath/messages.properties
 
 # remove bundled stuff
-for f in $(find aQute/ -type f -name "*.class"); do
-    rm -f $f
-done
+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)
 
@@ -138,6 +169,15 @@ cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
 %{_javadocdir}/%{name}
 
 %changelog
+* Fri May 09 2014 Jaromir Capik <jcapik at redhat.com> - 0.0.363-12
+- Fixing ambiguous base64 class
+
+* Fri May 09 2014 Gil Cattaneo <puntogil at libero.it> 0.0.363-11
+- fix rhbz#991985
+- add source compatibility with ant 1.9
+- remove and rebuild from source aQute.runtime.jar
+- update to current packaging guidelines
+
 * Tue Mar 04 2014 Stanislav Ochotnicky <sochotnicky at redhat.com> - 0.0.363-10
 - Use Requires: java-headless rebuild (#1067528)
 


More information about the scm-commits mailing list