From 490ea97235864abe1540ab771e0fc007df75cecc Mon Sep 17 00:00:00 2001 From: Marek Goldmann Date: Jan 16 2014 13:44:28 +0000 Subject: Initial import --- diff --git a/.gitignore b/.gitignore index e69de29..d2c0d1d 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/netty-3.6.6.Final-dist.tar.bz2 diff --git a/netty-port-to-jzlib-1.1.0.patch b/netty-port-to-jzlib-1.1.0.patch new file mode 100644 index 0000000..90fd7b2 --- /dev/null +++ b/netty-port-to-jzlib-1.1.0.patch @@ -0,0 +1,104 @@ +From 423dc10334f211db7256944a0a9f40c8ca82359b Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Thu, 13 Dec 2012 04:20:46 +0100 +Subject: [PATCH] Port netty to jzlib 1.1.0 + +--- + .../netty/handler/codec/compression/ZlibDecoder.java | 2 +- + .../netty/handler/codec/compression/ZlibEncoder.java | 6 ++---- + .../netty/handler/codec/compression/ZlibUtil.java | 18 ++++++++++-------- + .../codec/spdy/SpdyHeaderBlockJZlibCompressor.java | 2 +- + 4 files changed, 14 insertions(+), 14 deletions(-) + +diff --git a/src/main/java/org/jboss/netty/handler/codec/compression/ZlibDecoder.java b/src/main/java/org/jboss/netty/handler/codec/compression/ZlibDecoder.java +index f31a430..e93efd8 100644 +--- a/src/main/java/org/jboss/netty/handler/codec/compression/ZlibDecoder.java ++++ b/src/main/java/org/jboss/netty/handler/codec/compression/ZlibDecoder.java +@@ -77,7 +77,7 @@ public class ZlibDecoder extends OneToOneDecoder { + + synchronized (z) { + int resultCode; +- resultCode = z.inflateInit(JZlib.W_ZLIB); ++ resultCode = z.inflateInit(); + if (resultCode != JZlib.Z_OK) { + ZlibUtil.fail(z, "initialization failure", resultCode); + } +diff --git a/src/main/java/org/jboss/netty/handler/codec/compression/ZlibEncoder.java b/src/main/java/org/jboss/netty/handler/codec/compression/ZlibEncoder.java +index 46f711e..88e7342 100644 +--- a/src/main/java/org/jboss/netty/handler/codec/compression/ZlibEncoder.java ++++ b/src/main/java/org/jboss/netty/handler/codec/compression/ZlibEncoder.java +@@ -144,8 +144,7 @@ public class ZlibEncoder extends OneToOneStrictEncoder implements LifeCycleAware + } + + synchronized (z) { +- int resultCode = z.deflateInit(compressionLevel, windowBits, memLevel, +- ZlibUtil.convertWrapperType(wrapper)); ++ int resultCode = z.deflateInit(compressionLevel, ZlibUtil.convertWrapperType(wrapper), memLevel); + if (resultCode != JZlib.Z_OK) { + ZlibUtil.fail(z, "initialization failure", resultCode); + } +@@ -230,8 +229,7 @@ public class ZlibEncoder extends OneToOneStrictEncoder implements LifeCycleAware + + synchronized (z) { + int resultCode; +- resultCode = z.deflateInit(compressionLevel, windowBits, memLevel, +- JZlib.W_ZLIB); // Default: ZLIB format ++ resultCode = z.deflateInit(compressionLevel, windowBits, memLevel); + if (resultCode != JZlib.Z_OK) { + ZlibUtil.fail(z, "initialization failure", resultCode); + } else { +diff --git a/src/main/java/org/jboss/netty/handler/codec/compression/ZlibUtil.java b/src/main/java/org/jboss/netty/handler/codec/compression/ZlibUtil.java +index 954edde..93d204f 100644 +--- a/src/main/java/org/jboss/netty/handler/codec/compression/ZlibUtil.java ++++ b/src/main/java/org/jboss/netty/handler/codec/compression/ZlibUtil.java +@@ -32,25 +32,27 @@ final class ZlibUtil { + (z.msg != null? ": " + z.msg : "")); + } + +- static Enum convertWrapperType(ZlibWrapper wrapper) { +- Enum convertedWrapperType; +- switch (wrapper) { ++ static int convertWrapperType(ZlibWrapper wrapper, int windowBits) { ++ switch (wrapper) { + case NONE: +- convertedWrapperType = JZlib.W_NONE; ++ windowBits = -windowBits; + break; + case ZLIB: +- convertedWrapperType = JZlib.W_ZLIB; + break; + case GZIP: +- convertedWrapperType = JZlib.W_GZIP; ++ windowBits += 16; + break; + case ZLIB_OR_NONE: +- convertedWrapperType = JZlib.W_ZLIB_OR_NONE; + break; + default: + throw new Error(); + } +- return convertedWrapperType; ++ ++ return windowBits; ++ } ++ ++ static int convertWrapperType(ZlibWrapper wrapper) { ++ return convertWrapperType(wrapper, 15); + } + + private ZlibUtil() { +diff --git a/src/main/java/org/jboss/netty/handler/codec/spdy/SpdyHeaderBlockJZlibCompressor.java b/src/main/java/org/jboss/netty/handler/codec/spdy/SpdyHeaderBlockJZlibCompressor.java +index 612419d..957649b 100644 +--- a/src/main/java/org/jboss/netty/handler/codec/spdy/SpdyHeaderBlockJZlibCompressor.java ++++ b/src/main/java/org/jboss/netty/handler/codec/spdy/SpdyHeaderBlockJZlibCompressor.java +@@ -46,7 +46,7 @@ class SpdyHeaderBlockJZlibCompressor extends SpdyHeaderBlockCompressor { + } + + int resultCode = z.deflateInit( +- compressionLevel, windowBits, memLevel, JZlib.W_ZLIB); ++ compressionLevel, windowBits, memLevel); + if (resultCode != JZlib.Z_OK) { + throw new CompressionException( + "failed to initialize an SPDY header block deflater: " + resultCode); +-- +1.7.11.7 diff --git a/netty3.spec b/netty3.spec new file mode 100644 index 0000000..82910b1 --- /dev/null +++ b/netty3.spec @@ -0,0 +1,102 @@ +%global namedreltag .Final +%global namedversion %{version}%{?namedreltag} + +Name: netty3 +Version: 3.6.6 +Release: 1%{?dist} +Summary: An asynchronous event-driven network application framework and tools for Java +License: ASL 2.0 and BSD +URL: https://netty.io/ +Source0: http://netty.googlecode.com/files/netty-%{namedversion}-dist.tar.bz2 +Patch0: netty-port-to-jzlib-1.1.0.patch + +BuildArch: noarch + +BuildRequires: maven-local +BuildRequires: maven-antrun-plugin +BuildRequires: maven-assembly-plugin +BuildRequires: maven-compiler-plugin +BuildRequires: maven-enforcer-plugin +BuildRequires: maven-javadoc-plugin +BuildRequires: maven-plugin-bundle +BuildRequires: maven-resources-plugin +BuildRequires: maven-source-plugin +BuildRequires: maven-surefire-plugin +BuildRequires: ant-contrib + +BuildRequires: felix-osgi-compendium +BuildRequires: felix-osgi-core +BuildRequires: jboss-logging +BuildRequires: jboss-marshalling +BuildRequires: protobuf-java +BuildRequires: slf4j +BuildRequires: sonatype-oss-parent +BuildRequires: tomcat-servlet-3.0-api + +%description +Netty is a NIO client server framework which enables quick and easy +development of network applications such as protocol servers and +clients. It greatly simplifies and streamlines network programming +such as TCP and UDP socket server. + +'Quick and easy' doesn't mean that a resulting application will suffer +from a maintainability or a performance issue. Netty has been designed +carefully with the experiences earned from the implementation of a lot +of protocols such as FTP, SMTP, HTTP, and various binary and +text-based legacy protocols. As a result, Netty has succeeded to find +a way to achieve ease of development, performance, stability, and +flexibility without a compromise. + + +%package javadoc +Summary: API documentation for %{name} +Group: Documentation + +%description javadoc +%{summary}. + +%prep +%setup -q -n netty-%{namedversion} +# just to be sure, but not used anyway +rm -rf jar doc license + +%pom_remove_plugin :maven-jxr-plugin +%pom_remove_plugin :maven-checkstyle-plugin +%pom_remove_plugin org.eclipse.m2e:lifecycle-mapping +%pom_remove_dep javax.activation:activation +%pom_remove_plugin :animal-sniffer-maven-plugin +%pom_xpath_remove "pom:execution[pom:id[text()='remove-examples']]" +%pom_xpath_remove "pom:plugin[pom:artifactId[text()='maven-javadoc-plugin']]/pom:configuration" +# Set scope of optional compile dependencies to 'provided' +%pom_xpath_set "pom:dependency[pom:scope[text()='compile'] + and pom:optional[text()='true']]/pom:scope" provided + +sed s/jboss-logging-spi/jboss-logging/ -i pom.xml + +# Remove bundled jzlib and use system jzlib +rm -rf src/main/java/org/jboss/netty/util/internal/jzlib +%pom_add_dep com.jcraft:jzlib +sed -i s/org.jboss.netty.util.internal.jzlib/com.jcraft.jzlib/ \ + $(find src/main/java/org/jboss/netty/handler/codec -name \*.java | sort -u) +%patch0 -p1 + +%build +%mvn_compat_version : %{version} %{namedversion} 3 +%mvn_alias : org.jboss.netty: +%mvn_file : %{name} +# skipping tests because we don't have easymockclassextension +%mvn_build -f + +%install +%mvn_install + +%files -f .mfiles +%doc LICENSE.txt NOTICE.txt + +%files javadoc -f .mfiles-javadoc +%doc LICENSE.txt NOTICE.txt + +%changelog +* Mon Dec 30 2013 Marek Goldmann - 3.6.6-1 +- Initial packaging of compat version 3 as a compat package + diff --git a/sources b/sources index e69de29..d6c3144 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +b07b7b2fbc9d79a13f9b7da386018836 netty-3.6.6.Final-dist.tar.bz2