Update to 1.1.33

This commit is contained in:
yaokai13 2020-06-29 10:25:02 +08:00
parent 176bba57a9
commit 9f3d2ebbd2
7 changed files with 60 additions and 76 deletions

View File

@ -1,8 +0,0 @@
import org.apache.tomcat.jni.Library;
public class CheckLibrary {
public static void main(String[] a) throws Exception{
Library.initialize(null);
}
}

View File

@ -1,16 +1,16 @@
--- netty-tcnative-netty-tcnative-1.1.30.Fork2/src/main/java/org/apache/tomcat/jni/Library (copy).java
+++ netty-tcnative-netty-tcnative-1.1.30.Fork2/src/main/java/org/apache/tomcat/jni/Library.java
@@ -24,7 +24,7 @@
--- netty-tcnative-netty-tcnative-parent-1.1.33.Fork26/openssl-dynamic/src/main/java/org/apache/tomcat/jni/Library.java.orig 2020-01-09 11:01:40.309218963 +0100
+++ netty-tcnative-netty-tcnative-parent-1.1.33.Fork26/openssl-dynamic/src/main/java/org/apache/tomcat/jni/Library.java 2020-01-09 11:04:45.202196578 +0100
@@ -26,7 +26,7 @@
public final class Library {
/* Default library names */
- private static final String [] NAMES = {"tcnative-1", "libtcnative-1"};
+ private static final String [] NAMES = {"netty-tcnative", "libnetty-tcnative", "netty-tcnative-1", "libnetty-tcnative-1"};
- private static final String [] NAMES = {"netty-tcnative", "libnetty-tcnative", "netty-tcnative-1", "libnetty-tcnative-1"};
+ private static final String [] NAMES = {"netty-tcnative", "libnetty-tcnative", "netty-tcnative-1", "libnetty-tcnative-1", "tcnative-1", "libtcnative-1"};
/*
* A handle to the unique Library singleton instance.
*/
@@ -36,8 +36,9 @@
boolean loaded = false;
@@ -38,22 +38,20 @@
String [] paths = path.split(File.pathSeparator);
StringBuilder err = new StringBuilder();
for (int i = 0; i < NAMES.length; i++) {
+ String name = "@PATH@/" + NAMES[i] + ".so";
@ -18,23 +18,20 @@
- System.loadLibrary(NAMES[i]);
+ System.load(name);
loaded = true;
}
catch (Throwable t) {
@@ -47,16 +48,10 @@
if (t instanceof VirtualMachineError) {
throw (VirtualMachineError) t;
}
} catch (ThreadDeath t) {
throw t;
} catch (VirtualMachineError t) {
throw t;
} catch (Throwable t) {
- String name = System.mapLibraryName(NAMES[i]);
- String path = System.getProperty("java.library.path");
- String sep = System.getProperty("path.separator");
- String [] paths = path.split(sep);
- for (int j=0; j<paths.length; j++) {
- for (int j = 0; j < paths.length; j++) {
- java.io.File fd = new java.io.File(paths[j] , name);
+ java.io.File fd = new java.io.File(name);
+ java.io.File fd = new java.io.File(name);
if (fd.exists()) {
t.printStackTrace();
// File exists but failed to load
throw new RuntimeException(t);
}
- }
if ( i > 0)
if (i > 0) {
err.append(", ");
err.append(t.getMessage());
}

View File

@ -1,12 +0,0 @@
--- netty-tcnative-netty-tcnative-1.1.30.Fork2/src/main/native-package/m4/custom.m4
+++ netty-tcnative-netty-tcnative-1.1.30.Fork2/src/main/native-package/m4/custom.m4
@@ -47,7 +47,7 @@
fi
dnl Update the compiler/linker flags to add APR and OpenSSL to the build path.
- CFLAGS="$CFLAGS $TCN_OPENSSL_INC $APR_INCLUDES"
+ CFLAGS="$CFLAGS $TCN_OPENSSL_INC $APR_INCLUDES -D_LARGEFILE64_SOURCE"
CXXFLAGS="$CXXFLAGS $TCN_OPENSSL_INC $APR_INCLUDES"
LDFLAGS="$LDFLAGS $TCN_OPENSSL_LIBS $APR_LIBS"
AC_SUBST(CFLAGS)

Binary file not shown.

Binary file not shown.

View File

@ -1,26 +1,24 @@
%global name_reltag .Fork2
%global name_ver %{version}%{name_reltag}
%global namedreltag .Fork26
%global namedversion %{version}%{?namedreltag}
%global debug_package %{nil}
Name: netty-tcnative
Version: 1.1.30
Release: 13
Version: 1.1.33
Release: 1
Summary: Fork of Tomcat Native with improved OpenSSL and mavenized build
License: ASL 2.0
License: Apache-2.0
URL: https://github.com/netty/netty/wiki/Forked-Tomcat-Native
Source0: https://github.com/netty/netty-tcnative/archive/%{name}-%{name_ver}.tar.gz
Source1: CheckLibrary.java
Patch1: i388aprFix.patch
Patch2: fixLibNames.patch.in
BuildRequires: apr-devel autoconf automake compat-openssl10-devel glibc-devel
BuildRequires: libtool maven-antrun-plugin maven-hawtjni-plugin maven-local
BuildRequires: maven-plugin-build-helper maven-plugin-bundle
BuildRequires: maven-remote-resources-plugin maven-source-plugin netty
BuildRequires: sonatype-oss-parent
Source0: https://github.com/netty/netty-tcnative/archive/%{name}-parent-%{namedversion}.tar.gz
Source1: fixLibNames.patch.in
BuildRequires: fdupes
BuildRequires: libtcnative-1-0
BuildRequires: maven-local
BuildRequires: mvn(io.netty:netty-parent:pom:)
BuildRequires: mvn(kr.motd.maven:os-maven-plugin)
Provides: netty-tcnative-javadoc
Obsoletes: netty-tcnative-javadoc
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-remote-resources-plugin)
BuildRequires: sonatype-oss-parent maven-plugin-build-helper python3-lxml python3 python3-cssselect
Requires: libtcnative-1-0
%description
netty-tcnative is a fork of Tomcat Native. It includes a set of changes
@ -32,37 +30,42 @@ To minimize the maintenance burden, we create a dedicated branch for each stable
upstream release and apply our own changes on top of it, while keeping the
number of maintained branches to minimum
%package javadoc
Summary: API documentation for %{name}
BuildArch: noarch
%description javadoc
%{summary}.
%prep
%setup -q -n %{name}-%{name}-%{name_ver}
%patch1 -p1
%setup -q -n %{name}-%{name}-parent-%{namedversion}
patch=`mktemp`
sed "s;@PATH@;%{_libdir}/%{name};g" < %{PATCH2} > $patch
sed "s;@PATH@;%{_libdir};g" < %{SOURCE1} > $patch
patch -p1 < $patch
%pom_disable_module openssl-static
%pom_disable_module boringssl-static
%pom_disable_module libressl-static
%pom_remove_plugin :maven-enforcer-plugin .
%pom_remove_plugin :maven-antrun-plugin . openssl-dynamic
%pom_remove_plugin :maven-hawtjni-plugin openssl-dynamic
%pom_xpath_remove pom:project/pom:profiles openssl-dynamic
%build
%set_build_flags
%mvn_build -f
%{mvn_build} -f -- -Dsource=7
%install
%mvn_install
mkdir -p %{buildroot}%{_libdir}/%{name}/
cp target/native-build/target/lib/lib%{name}-%{name_ver}.so %{buildroot}%{_libdir}/%{name}/lib%{name}.so
%check
javac -d . -cp %{buildroot}%{_jnidir}/%{name}/%{name}.jar %{SOURCE1}
%fdupes -s %{buildroot}%{_javadocdir}
%files -f .mfiles
%doc %{_javadocdir}/%{name}
%dir %{_jnidir}/%{name}
%dir %{_libdir}/%{name}
%dir %{_mavenpomdir}/%{name}
%{_libdir}/%{name}/lib%{name}.so
%files javadoc -f .mfiles-javadoc
%changelog
* Sun Jun 28 2020 yaokai13 <yaokai13@huawei.com> - 1.1.33-1
- Update to 1.1.33-1
* Fri Dec 6 2019 huyan <hu.huyan@huawei.com> - 1.1.30-13
- Package Initialization

4
netty-tcnative.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: https://github.com/netty/netty-tcnative.git
tag_prefix: "^"
seperator: "netty-tcnative-"