diff --git a/CheckLibrary.java b/CheckLibrary.java deleted file mode 100644 index 2d2e942..0000000 --- a/CheckLibrary.java +++ /dev/null @@ -1,8 +0,0 @@ -import org.apache.tomcat.jni.Library; - -public class CheckLibrary { - - public static void main(String[] a) throws Exception{ - Library.initialize(null); - } -} diff --git a/fixLibNames.patch.in b/fixLibNames.patch.in index 42627cb..812a41a 100644 --- a/fixLibNames.patch.in +++ b/fixLibNames.patch.in @@ -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 0) + if (i > 0) { err.append(", "); - err.append(t.getMessage()); + } diff --git a/i388aprFix.patch b/i388aprFix.patch deleted file mode 100644 index a0d17b4..0000000 --- a/i388aprFix.patch +++ /dev/null @@ -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) - diff --git a/netty-tcnative-1.1.30.Fork2.tar.gz b/netty-tcnative-1.1.30.Fork2.tar.gz deleted file mode 100644 index ba6f509..0000000 Binary files a/netty-tcnative-1.1.30.Fork2.tar.gz and /dev/null differ diff --git a/netty-tcnative-parent-1.1.33.Fork26.tar.gz b/netty-tcnative-parent-1.1.33.Fork26.tar.gz new file mode 100644 index 0000000..050bcff Binary files /dev/null and b/netty-tcnative-parent-1.1.33.Fork26.tar.gz differ diff --git a/netty-tcnative.spec b/netty-tcnative.spec index 2ac0358..5821a05 100644 --- a/netty-tcnative.spec +++ b/netty-tcnative.spec @@ -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 - 1.1.33-1 +- Update to 1.1.33-1 + * Fri Dec 6 2019 huyan - 1.1.30-13 - Package Initialization diff --git a/netty-tcnative.yaml b/netty-tcnative.yaml new file mode 100644 index 0000000..e8de9fd --- /dev/null +++ b/netty-tcnative.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: https://github.com/netty/netty-tcnative.git +tag_prefix: "^" +seperator: "netty-tcnative-"