netty3/netty3.spec
wang--ge 2d31632a92 Fix CVE-2019-16869,CVE-2019-20444,CVE-2019-20445
(cherry picked from commit b5dcfb9cf26eebff92094854f5f6c0feec79952b)
2024-08-28 10:47:32 +08:00

130 lines
4.6 KiB
RPMSpec

%global name_reltag .Final
%global name_ver %{version}%{name_reltag}
%global bundled_jzlib_dir src/main/java/org/jboss/netty/util/internal/jzlib
%global netty_handler_dir src/main/java/org/jboss/netty/handler
Name: netty3
Version: 3.10.6
Release: 8
Summary: An asynchronous event-driven network application framework and tools for Java
License: ASL 2.0 and BSD and CC0
URL: http://netty.io/
Source0: https://github.com/netty/netty/archive/netty-%{name_ver}.tar.gz
Patch0: disableNPN.patch
Patch1: netty-3.10.6-port-to-jzlib-1.1.0.patch
# Origin: https://launchpadlibrarian.net/497549180/netty-3.9_3.9.9.Final-1_3.9.9.Final-1+deb9u1build0.18.04.1.diff.gz
Patch2: CVE-2019-16869.patch
Patch3: CVE-2019-20444.patch
Patch4: CVE-2019-20445-1.patch
Patch5: CVE-2019-20445-2.patch
BuildRequires: maven-local
BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:)
BuildRequires: mvn(org.slf4j:slf4j-api)
BuildRequires: mvn(org.jboss.marshalling:jboss-marshalling)
BuildRequires: mvn(org.jboss.logging:jboss-logging)
BuildRequires: mvn(org.bouncycastle:bcpkix-jdk15on)
BuildRequires: mvn(org.apache.maven.plugins:maven-resources-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-enforcer-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin)
BuildRequires: mvn(org.apache.felix:org.osgi.core)
BuildRequires: mvn(org.apache.felix:org.osgi.compendium)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.ant:ant-launcher)
BuildRequires: mvn(org.apache.ant:ant)
BuildRequires: mvn(log4j:log4j:12)
BuildRequires: mvn(javax.servlet:javax.servlet-api)
BuildRequires: mvn(io.netty:netty-tcnative)
BuildRequires: mvn(commons-logging:commons-logging)
BuildRequires: mvn(com.jcraft:jzlib)
BuildRequires: mvn(com.google.protobuf:protobuf-java)
BuildRequires: mvn(ant-contrib:ant-contrib)
BuildArch: noarch
Requires: netty-tcnative
Provides: bundled(java-base64)
Provides: netty3-javadoc
Obsoletes: netty3-javadoc
%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.
%prep
%autosetup -n netty-netty-%{name_ver} -p1
rm -rf jar doc license
%pom_remove_plugin :animal-sniffer-maven-plugin
%pom_remove_plugin :maven-checkstyle-plugin
%pom_remove_plugin :maven-jxr-plugin
%pom_remove_plugin org.eclipse.m2e:lifecycle-mapping
%pom_remove_dep javax.activation:activation
%pom_remove_dep :npn-api
%pom_xpath_remove "pom:dependency[pom:artifactId[text()='netty-tcnative']]/pom:classifier"
%pom_xpath_remove "pom:extension[pom:artifactId[text()='os-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"
%pom_xpath_set "pom:dependency[pom:scope[text()='compile'] and pom:optional[text()='true']]/pom:scope" provided
%pom_xpath_set "pom:dependency[pom:artifactId = 'log4j']/pom:version" 12
%pom_change_dep :servlet-api javax.servlet:javax.servlet-api:3.1.0
%pom_remove_plugin :maven-assembly-plugin
%pom_remove_plugin :maven-javadoc-plugin
%pom_remove_plugin :maven-source-plugin
%pom_remove_plugin kr.motd.maven:exec-maven-plugin
sed s/jboss-logging-spi/jboss-logging/ -i pom.xml
rm -r %{bundled_jzlib_dir}
%pom_add_dep com.jcraft:jzlib
#javafile=
sed -i s/org.jboss.netty.util.internal.jzlib/com.jcraft.jzlib/ \
`find %{netty_handler_dir}/codec -name \*.java | sort -u`
rm -v %{netty_handler_dir}/ssl/JettyNpnSslEngine.java
%mvn_compat_version : %{version} 3.9.3 %{name_ver} 3.9.3.Final 3
%mvn_alias : org.jboss.netty:
%mvn_file : %{name}
%build
%mvn_build -f
%install
%mvn_install
%files -f .mfiles
%doc README.md
%doc %{_javadocdir}/%{name}
%license LICENSE.txt NOTICE.txt
%changelog
* Wed Aug 28 2024 wangkai <13474090681@163.com> - 3.10.6-8
- Fix CVE-2019-16869,CVE-2019-20444,CVE-2019-20445
* Mon Feb 21 2022 wangkai <wangkai385@huawei.com> - 3.10.6-7
- Rebuild for fix log4j1.x cves
* Sat Dec 7 2019 huyan <hu.huyan@huawei.com> - 3.10.6-6
- Package Initialization