[azureus] - Unbundle json (Sérgio Basto <sergio at serjux.com>) (Bz 820117)
David Juran
djuran at fedoraproject.org
Mon Feb 10 20:09:38 UTC 2014
commit c220c2c8d9aff45192640e3031bbac6fca379c13
Author: David Juran <djuran at redhat.com>
Date: Mon Feb 10 21:08:42 2014 +0100
- Unbundle json (Sérgio Basto <sergio at serjux.com>) (Bz 820117)
azureus-5.2-no-bundled-json.patch | 42 +++++++++++++++++++++++++++++++++++
azureus-5.2.0.0-startupScript.patch | 4 +-
azureus.spec | 23 ++++++++++++++++--
3 files changed, 64 insertions(+), 5 deletions(-)
---
diff --git a/azureus-5.2-no-bundled-json.patch b/azureus-5.2-no-bundled-json.patch
new file mode 100644
index 0000000..622c6b2
--- /dev/null
+++ b/azureus-5.2-no-bundled-json.patch
@@ -0,0 +1,42 @@
+--- azureus-5.2.0.0/com/aelitis/azureus/util/ImportExportUtils.java.orig 2014-02-09 17:34:09.214700559 +0000
++++ azureus-5.2.0.0/com/aelitis/azureus/util/ImportExportUtils.java 2014-02-09 17:34:19.114801052 +0000
+@@ -360,7 +360,7 @@ public final class ImportExportUtils {
+
+ throws IOException
+ {
+- List l = new JSONArray(data.length);
++ List l = new JSONArray();
+
+ map.put( key, l );
+
+--- azureus-5.2.0.0/com/aelitis/azureus/util/JSONUtils.java.orig 2014-02-09 17:36:41.882250193 +0000
++++ azureus-5.2.0.0/com/aelitis/azureus/util/JSONUtils.java 2014-02-09 17:36:49.410326603 +0000
+@@ -74,7 +74,7 @@ public class JSONUtils
+ * @since 3.0.1.5
+ */
+ public static JSONObject encodeToJSONObject(Map map) {
+- JSONObject newMap = new JSONObject((int)(map.size()*1.5));
++ JSONObject newMap = new JSONObject();
+
+ for (Map.Entry<String, Object> entry: ((Map<String,Object>)map).entrySet()){
+ String key = entry.getKey();
+@@ -105,9 +105,7 @@ public class JSONUtils
+ */
+ public static String encodeToJSON(Map map) {
+ JSONObject jobj = encodeToJSONObject(map);
+- StringBuilder sb = new StringBuilder(8192);
+- jobj.toString( sb );
+- return( sb.toString());
++ return( jobj.toString());
+ }
+
+ public static String encodeToJSON(Collection list) {
+@@ -138,7 +136,7 @@ public class JSONUtils
+ * @since 3.0.1.5
+ */
+ private static JSONArray encodeToJSONArray(Collection list) {
+- JSONArray newList = new JSONArray(list.size());
++ JSONArray newList = new JSONArray();
+
+ for ( Object value: list ){
+
diff --git a/azureus-5.2.0.0-startupScript.patch b/azureus-5.2.0.0-startupScript.patch
index 0ca32a7..4810f97 100644
--- a/azureus-5.2.0.0-startupScript.patch
+++ b/azureus-5.2.0.0-startupScript.patch
@@ -1,6 +1,6 @@
diff -up azureus-5.2.0.0/org/gudy/azureus2/platform/unix/startupScript.startupScript azureus-5.2.0.0/org/gudy/azureus2/platform/unix/startupScript
--- azureus-5.2.0.0/org/gudy/azureus2/platform/unix/startupScript.startupScript 2012-09-17 19:51:24.000000000 +0200
-+++ azureus-5.2.0.0/org/gudy/azureus2/platform/unix/startupScript 2014-02-06 19:36:09.000000000 +0100
++++ azureus-5.2.0.0/org/gudy/azureus2/platform/unix/startupScript 2014-02-10 20:34:25.000000000 +0100
@@ -1,10 +1,25 @@
#!/bin/bash
@@ -27,7 +27,7 @@ diff -up azureus-5.2.0.0/org/gudy/azureus2/platform/unix/startupScript.startupSc
+esac
+
+
-+export LD_LIBRARY_PATH=$LIBDIR/eclipse/plugins/:$LIBDIR/eclipse/:$LIBDIR CLASSPATH=$SWT:`build-classpath bcprov apache-commons-cli log4j`:/usr/share/azureus/Azureus2.jar
++export LD_LIBRARY_PATH=$LIBDIR/eclipse/plugins/:$LIBDIR/eclipse/:$LIBDIR CLASSPATH=$SWT:`build-classpath json_simple bcprov apache-commons-cli log4j`:/usr/share/azureus/Azureus2.jar
#export MOZILLA_FIVE_HOME="/path/to/gre" # Full path to GRE/Mozilla. When commenting out this line, also comment out the next line
#if [ "$LD_LIBRARY_PATH x" = " x" ]; then export LD_LIBRARY_PATH=$MOZILLA_FIVE_HOME; else export LD_LIBRARY_PATH=$MOZILLA_FIVE_HOME:$LD_LIBRARY_PATH; fi
diff --git a/azureus.spec b/azureus.spec
index 3e736c0..2a70ff7 100644
--- a/azureus.spec
+++ b/azureus.spec
@@ -2,7 +2,7 @@
Name: azureus
Version: 5.2.0.0
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: A BitTorrent Client
Group: Applications/Internet
License: GPLv2+
@@ -31,16 +31,21 @@ Patch9: azureus-4.8.1.2-no-bundled-apache-commons.patch
Patch10: azureus-5.2.0.0-startupScript.patch
+Patch11: azureus-5.2-no-bundled-json.patch
+
BuildRequires: ant, jpackage-utils >= 1.5, xml-commons-apis
BuildRequires: apache-commons-cli, log4j
BuildRequires: apache-commons-lang
BuildRequires: bouncycastle >= 1.33-3
+BuildRequires: json_simple
BuildRequires: eclipse-swt >= 3.5
BuildRequires: junit
Requires: apache-commons-cli, log4j
+Requires: apache-commons-lang
Requires: eclipse-swt >= 3.5
Requires: bouncycastle >= 1.33-3
Requires: java >= 1:1.6.0
+Requires: json_simple
BuildRequires: java-devel >= 1:1.6.0
BuildRequires: desktop-file-utils
Requires(post): desktop-file-utils
@@ -67,7 +72,6 @@ cp %{SOURCE4} .
%patch3 -p1 -b .nobcprov
-
rm org/gudy/azureus2/ui/swt/osx/CarbonUIEnhancer.java
rm org/gudy/azureus2/ui/swt/osx/Start.java
rm org/gudy/azureus2/ui/swt/win32/Win32UIEnhancer.java
@@ -81,6 +85,8 @@ rm org/gudy/azureus2/ui/swt/win32/Win32UIEnhancer.java
%patch10 -p1 -b .startupScript
+%patch11 -p1 -b .no-bundled-json
+
#hacks to org.eclipse.swt.widgets.Tree2 don't compile.
rm -fR org/eclipse
@@ -91,10 +97,18 @@ chmod 644 *.txt
#remove bundled libs
rm -fR org/apache
+# requires org.bouncycastle.jce.provider
+# http://www.cs.berkeley.edu/~jonah/bc/org/bouncycastle/jce/provider/JCEECDHKeyAgreement.html
+# Bouncy Castle Cryptography Library 1.37
+#rm -fR org/bouncycastle
+rm -fR org/json
+# http://www.programmers-friend.org/download/ not found in fedora repos
+#rm -fR org/pf
+
%build
mkdir -p build/libs
build-jar-repository -p build/libs bcprov apache-commons-cli log4j \
- junit apache-commons-lang
+ junit apache-commons-lang json_simple
#ppc seems to have eclipse-swt.ppc64 installed so libdir can't be used
if [ -e /usr/lib/eclipse/swt.jar ];then
@@ -154,6 +168,9 @@ fi
%{_datadir}/azureus
%changelog
+* Sun Feb 09 2014 Sérgio Basto <sergio at serjux.com> - 5.2.0.0-4
+- Unbundle json (Bz 820117)
+
* Thu Feb 06 2014 David Juran <djuran at redhat.com> - 5.2.0.0-3
- Fix warning re: /usr/share/azureus not beeing writable (Sergio Monteiro Basto)
- Revert limiting java heap size (Bz1040625)
More information about the scm-commits
mailing list