# # spec file for package netty # # Copyright (c) 2025 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %global namedreltag .Final %global namedversion %{version}%{?namedreltag} Name: netty Version: 4.1.124 Release: 0 Summary: An asynchronous event-driven network application framework and tools for Java License: Apache-2.0 URL: https://netty.io/ Source0: https://github.com/netty/netty/archive/netty-%{namedversion}.tar.gz # Upsteam uses a simple template generator script written in groovy and run with gmaven # We don't have the plugin and want to avoid groovy dependency # This script is written in bash+sed and performs the same task Source1: codegen.bash Source2: https://repo1.maven.org/maven2/io/netty/netty-jni-util/0.0.9.Final/netty-jni-util-0.0.9.Final-sources.jar Patch0: 0001-Remove-optional-dep-Blockhound.patch Patch1: 0002-Remove-optional-dep-conscrypt.patch Patch2: 0003-Remove-optional-deps-jetty-alpn-and-npn.patch Patch3: 0004-Disable-Brotli-and-ZStd-compression.patch Patch4: no-werror.patch Patch5: reproducible.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: fdupes BuildRequires: gcc BuildRequires: jurand BuildRequires: libtool BuildRequires: make BuildRequires: maven-local BuildRequires: unzip BuildRequires: mvn(com.fasterxml:aalto-xml) BuildRequires: mvn(com.jcraft:jzlib) BuildRequires: mvn(commons-logging:commons-logging) BuildRequires: mvn(io.netty:netty-tcnative) >= 2.0.60 BuildRequires: mvn(io.netty:netty-tcnative-classes) >= 2.0.60 BuildRequires: mvn(kr.motd.maven:os-maven-plugin) BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) BuildRequires: mvn(org.apache.logging.log4j:log4j-1.2-api) BuildRequires: mvn(org.apache.logging.log4j:log4j-api) BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-dependency-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-remote-resources-plugin) BuildRequires: mvn(org.bouncycastle:bcpkix-jdk15on) BuildRequires: mvn(org.bouncycastle:bctls-jdk15on) BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin) BuildRequires: mvn(org.codehaus.mojo:exec-maven-plugin) BuildRequires: mvn(org.codehaus.mojo:flatten-maven-plugin) BuildRequires: mvn(org.fusesource.hawtjni:hawtjni-maven-plugin) BuildRequires: mvn(org.jctools:jctools-core) >= 4 BuildRequires: mvn(org.slf4j:slf4j-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 bom Summary: POM-only artifacts for %{name} Obsoletes: %{name}-poms BuildArch: noarch %description bom %{summary}. %package parent Summary: POM-only artifacts for %{name} Obsoletes: %{name}-poms BuildArch: noarch %description parent %{summary}. %package javadoc Summary: API documentation for %{name} BuildArch: noarch %description javadoc %{summary}. %prep %setup -q -n netty-netty-%{namedversion} %patch -P 0 -p1 %patch -P 1 -p1 %patch -P 2 -p1 %patch -P 3 -p1 %patch -P 4 -p1 %patch -P 5 -p1 # remove annotations for which we have no dependencies # Graal annotations %{java_remove_annotations} common -p "com.oracle.svm.core.annotate" # Jetbrains annotation %{java_remove_annotations} common -p "org.jetbrains.annotations" # remove unnecessary dependency on parent POM %pom_remove_parent . bom # Not needed for RPM builds %pom_disable_module "example" %pom_disable_module "microbench" %pom_remove_plugin :maven-antrun-plugin %pom_remove_plugin :maven-dependency-plugin %pom_remove_plugin :xml-maven-plugin %pom_remove_plugin :japicmp-maven-plugin %pom_remove_plugin -r :maven-checkstyle-plugin %pom_remove_plugin -r :animal-sniffer-maven-plugin %pom_remove_plugin -r :maven-enforcer-plugin %pom_remove_plugin -r :maven-shade-plugin %pom_remove_plugin -r :maven-release-plugin %pom_remove_plugin -r :maven-clean-plugin %pom_remove_plugin -r :maven-source-plugin %pom_remove_plugin -r :maven-deploy-plugin %pom_remove_plugin -r :maven-jxr-plugin %pom_remove_plugin -r :maven-javadoc-plugin %pom_remove_plugin -r :forbiddenapis %pom_remove_plugin -r :revapi-maven-plugin %pom_remove_plugin -r :bom-helper-maven-plugin %pom_remove_plugin -r :central-publishing-maven-plugin %pom_remove_plugin -r :nexus-staging-maven-plugin %pom_remove_plugin :duplicate-finder-maven-plugin all cp %{SOURCE1} common/codegen.bash chmod +x common/codegen.bash %pom_add_plugin org.codehaus.mojo:exec-maven-plugin common ' generate-collections generate-sources exec common/codegen.bash ' %pom_remove_plugin :groovy-maven-plugin common # We don't have com.oracle.substratevm %pom_remove_dep "org.graalvm.nativeimage:" common rm common/src/main/java/io/netty/util/internal/svm/* # The protobuf-javanano API was discontinued upstream # so disable support for protobuf in the codecs module %pom_remove_dep -r "com.google.protobuf:protobuf-java" %pom_remove_dep -r "com.google.protobuf.nano:protobuf-javanano" rm codec/src/main/java/io/netty/handler/codec/protobuf/* sed -i '/import.*protobuf/d' codec/src/main/java/io/netty/handler/codec/DatagramPacket*.java %pom_remove_dep -r "org.jboss.marshalling:jboss-marshalling" rm codec/src/main/java/io/netty/handler/codec/marshalling/* # Various compression codecs %pom_remove_dep -r com.github.jponge:lzma-java rm codec/src/*/java/io/netty/handler/codec/compression/Lzma*.java %pom_remove_dep -r com.ning:compress-lzf rm codec/src/*/java/io/netty/handler/codec/compression/Lzf*.java %pom_remove_dep -r org.lz4:lz4-java rm codec/src/*/java/io/netty/handler/codec/compression/Lz4*.java %pom_remove_dep -r com.aayushatharva.brotli4j: rm codec/src/*/java/io/netty/handler/codec/compression/Brotli*.java %pom_remove_dep -r com.github.luben:zstd-jni rm codec/src/*/java/io/netty/handler/codec/compression/Zstd*.java # Disable unneeded transport artifacts %pom_disable_module transport-rxtx %pom_remove_dep -r :netty-transport-rxtx %pom_disable_module transport-udt %pom_remove_dep -r :netty-transport-udt %pom_remove_dep -r :netty-build-common %pom_remove_dep :netty-dev-tools # Disable macos native bit %pom_disable_module resolver-dns-native-macos %pom_remove_dep -r :netty-resolver-dns-native-macos # Disable test suites %pom_disable_module testsuite %pom_disable_module testsuite-autobahn %pom_disable_module testsuite-http2 %pom_disable_module testsuite-native %pom_disable_module testsuite-native-image %pom_disable_module testsuite-native-image-client %pom_disable_module testsuite-native-image-client-runtime-init %pom_disable_module testsuite-osgi %pom_disable_module testsuite-shading %pom_disable_module transport-native-unix-common-tests %pom_remove_dep io.netty:netty-jni-util transport-native-unix-common %pom_remove_plugin :maven-dependency-plugin transport-native-unix-common mkdir -p transport-native-unix-common/target/netty-jni-util unzip %{SOURCE2} -d transport-native-unix-common/target/netty-jni-util # Upstream has jctools bundled. %pom_xpath_remove "pom:build/pom:plugins/pom:plugin[pom:artifactId = 'maven-bundle-plugin']/pom:executions/pom:execution[pom:id = 'generate-manifest']/pom:configuration/pom:instructions/pom:Import-Package" common/pom.xml %pom_xpath_inject "pom:project" ' io.netty.dev.tools ' dev-tools %pom_remove_dep -r :annotations-java5 %pom_xpath_remove "pom:profiles/pom:profile[pom:id = 'staging']" all %pom_xpath_remove "pom:plugins/pom:plugin/pom:configuration/pom:flattenDependencyMode" all # Tell xmvn to install attached artifact, which it does not # do by default. In this case install all attached artifacts with # the linux classifier. %{mvn_package} ":::linux*:" %{mvn_package} ":netty-parent" parent %{mvn_package} ":netty-bom" bom %{mvn_package} ':*-tests' __noinstall %build %{mvn_build} -f -- \ -Dsource=8 %install %mvn_install %fdupes -s %{buildroot}%{_javadocdir} %files -f .mfiles %license LICENSE.txt NOTICE.txt %files parent -f .mfiles-parent %license LICENSE.txt NOTICE.txt %files bom -f .mfiles-bom %files javadoc -f .mfiles-javadoc %license LICENSE.txt NOTICE.txt %changelog