Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions SPECS-EXTENDED/hawtjni-runtime/hawtjni-runtime.spec
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ Distribution: Azure Linux
%global debug_package %{nil}
Name: hawtjni-runtime
Version: 1.17
Release: 2%{?dist}
Release: 3%{?dist}
Summary: HawtJNI Runtime
License: Apache-2.0 AND EPL-1.0 AND BSD-3-Clause
URL: https://github.com/fusesource/hawtjni
Source0: https://github.com/fusesource/hawtjni/archive/hawtjni-project-%{version}.tar.gz
Patch0: use-commons-lang3.patch
BuildRequires: apache-commons-cli
BuildRequires: apache-commons-lang
BuildRequires: apache-commons-lang3
BuildRequires: fdupes
BuildRequires: java-devel
BuildRequires: javapackages-local-bootstrap
Expand All @@ -48,7 +49,7 @@ This package contains the API documentation for hawtjni.
Summary: Code generator that produces the JNI code
Requires: %{name} = %{version}
Requires: apache-commons-cli
Requires: apache-commons-lang
Requires: apache-commons-lang3
Requires: javapackages-tools
Requires: objectweb-asm >= 5
Requires: xbean
Expand All @@ -62,14 +63,15 @@ JNI code which powers the eclipse platform.

%prep
%setup -q -n hawtjni-hawtjni-project-%{version}
%patch -P 0 -p1

%pom_disable_module hawtjni-example
%pom_disable_module hawtjni-maven-plugin
%pom_remove_plugin -r :maven-shade-plugin
%pom_remove_plugin -r :maven-eclipse-plugin

# this dependency seems to be missing
%pom_add_dep commons-lang:commons-lang hawtjni-generator
%pom_add_dep commons-lang:commons-lang3 hawtjni-generator

for mod in runtime generator; do
%pom_remove_parent hawtjni-${mod}
Expand All @@ -80,19 +82,19 @@ done

%build
mkdir -p hawtjni-runtime/build/classes
javac -d hawtjni-runtime/build/classes -source 6 -target 6 \
javac -d hawtjni-runtime/build/classes -source 8 -target 8 \
$(find hawtjni-runtime/src/main/java/ -name *.java | xargs)
jar cf hawtjni-runtime.jar -C hawtjni-runtime/build/classes .
mkdir -p hawtjni-generator/build/classes
javac -d hawtjni-generator/build/classes \
-source 6 -target 6 \
-cp $(build-classpath commons-cli commons-lang objectweb-asm/asm objectweb-asm/asm-commons xbean/xbean-finder xbean/xbean-asm-util):hawtjni-runtime.jar \
-source 8 -target 8 \
-cp $(build-classpath commons-cli commons-lang3 objectweb-asm/asm objectweb-asm/asm-commons xbean/xbean-finder xbean/xbean-asm-util):hawtjni-runtime.jar \
$(find hawtjni-generator/src/main/java/ -name *.java | xargs)
jar cf hawtjni-generator.jar -C hawtjni-generator/build/classes .
jar uf hawtjni-generator.jar -C hawtjni-generator/src/main/resources .
mkdir -p hawtjni-runtime/build/apidoc
javadoc -d hawtjni-runtime/build/apidoc -source 6 \
-classpath $(build-classpath commons-cli commons-lang objectweb-asm/asm objectweb-asm/asm-commons xbean/xbean-finder xbean/xbean-asm-util) \
javadoc -d hawtjni-runtime/build/apidoc -source 8 \
-classpath $(build-classpath commons-cli commons-lang3 objectweb-asm/asm objectweb-asm/asm-commons xbean/xbean-finder xbean/xbean-asm-util) \
$(find hawtjni-runtime/src/main/java/ -name *.java && \
find hawtjni-generator/src/main/java/ -name *.java| xargs)

Expand All @@ -113,9 +115,18 @@ install -m 0644 hawtjni-generator/pom.xml %{buildroot}%{_mavenpomdir}/hawtjni/ha
# javadoc
install -dm 755 %{buildroot}%{_javadocdir}/hawtjni
cp -pr hawtjni-runtime/build/apidoc/* %{buildroot}%{_javadocdir}/hawtjni/
# to remove license warnings
install -Dm 0644 hawtjni-runtime/build/apidoc/legal/LICENSE \
%{buildroot}%{_licensedir}/hawtjni/LICENSE.javadoc

install -Dm 0644 hawtjni-runtime/build/apidoc/legal/ADDITIONAL_LICENSE_INFO \
%{buildroot}%{_licensedir}/hawtjni/ADDITIONAL_LICENSE_INFO.javadoc

rm -rf %{buildroot}%{_javadocdir}/hawtjni/legal

%fdupes -s %{buildroot}%{_javadocdir}/hawtjni/

%{jpackage_script org.fusesource.hawtjni.generator.HawtJNI "" "" commons-cli:commons-lang:objectweb-asm/asm:objectweb-asm/asm-commons:xbean/xbean-finder:xbean/xbean-asm-util:hawtjni/hawtjni-runtime:hawtjni/hawtjni-generator hawtjni-generator true}
%{jpackage_script org.fusesource.hawtjni.generator.HawtJNI "" "" commons-cli:commons-lang3:objectweb-asm/asm:objectweb-asm/asm-commons:xbean/xbean-finder:xbean/xbean-asm-util:hawtjni/hawtjni-runtime:hawtjni/hawtjni-generator hawtjni-generator true}

%files -f .mfiles
%license license.txt
Expand All @@ -127,8 +138,13 @@ cp -pr hawtjni-runtime/build/apidoc/* %{buildroot}%{_javadocdir}/hawtjni/
%files -n hawtjni-javadoc
%{_javadocdir}/hawtjni
%license license.txt
%license %{_licensedir}/hawtjni/*

%changelog
* Wed Dec 24 2025 Aninda Pradhan <v-anindap@microsoft.com> - 1.17-3
- Updated dependencies to use commons-lang3
- License verified

* Thu Oct 14 2021 Pawel Winogrodzki <pawelwi@microsoft.com> - 1.17-2
- Converting the 'Release' tag to the '[number].[distribution]' format.

Expand Down
11 changes: 11 additions & 0 deletions SPECS-EXTENDED/hawtjni-runtime/use-commons-lang3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectField.java
+++ b/hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectField.java
@@ -14,7 +14,7 @@
import java.util.Arrays;
import java.util.HashSet;

-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.fusesource.hawtjni.runtime.FieldFlag;
import org.fusesource.hawtjni.runtime.JniField;
import org.fusesource.hawtjni.runtime.T32;
Loading