%global uname jigawatts %global uversion c15dd4c19e81cbcefe419a99ebaa3af7c5c60c5e %global dversion %(echo %{uversion} | sed s/-/_/) %global aarch64 aarch64 arm64 armv8 %global shortcommit %(c=%{uversion}; echo ${c:0:7}) %global commitdate 20210701 Name: %{uname} Version: 0.2 Release: 0.1.%{commitdate}%{shortcommit}%{?dist} Summary: Java CRIU helper License: GPLv2 with exceptions URL: https://github.com/chflood/%{uname} Source0: https://github.com/chflood/jigawatts/archive/%{uversion}.zip # Pathces to move library out of the jar. This must be usptreamed in one or another way Patch0: output_loc.patch Patch1: load_library.patch BuildRequires: java-devel BuildRequires: criu-devel BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: maven-local BuildRequires: maven-surefire-provider-junit BuildRequires: maven-surefire-provider-junit5 BuildRequires: maven-surefire BuildRequires: maven-surefire-plugin BuildRequires: maven-clean-plugin BuildRequires: exec-maven-plugin BuildRequires: maven-shade-plugin BuildRequires: mvn(org.apache.commons:commons-lang3) Requires: java-headless #Requires: criu-libs the depndence shhould be generated by rpmbuild # criu is only available on these architectures # https://bugzilla.redhat.com/show_bug.cgi?id=902875 ExclusiveArch: x86_64 %{arm} ppc64le aarch64 s390x %description CRIU is a Linux utility that allows the checkpointing and restoring of processes.You can read more about CRIU at criu.org. CRIU for Java is a package which makes it more convenient to use CRIU from Java. %package javadoc Summary: Javadoc for %{name} %description javadoc Javadoc for %{name} %prep %setup -q -n %{uname}-%{uversion} %patch0 -p1 %patch1 -p1 %pom_add_dep org.apache.commons:commons-lang3:3.12.0:test %pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId='exec-maven-plugin']/pom:executions/pom:execution/pom:configuration/pom:arguments" '-g' # Work-around for RHBZ#1977671, /usr/lib64 missing on default java.library.path on aarch64 %ifarch %{aarch64} %pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-surefire-plugin']/pom:configuration" '1 /usr/lib64:${project.build.directory} ' %else %pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-surefire-plugin']/pom:configuration" '1 ${project.build.directory} ' %endif %build %mvn_build --xmvn-javadoc %install %mvn_install mkdir -p %{buildroot}/%{_libdir} cp ./target/libJigawatts.so %{buildroot}/%{_libdir}/ %files -f .mfiles %doc README.md %license LICENSE.md %{_libdir}/libJigawatts.so %files javadoc -f .mfiles-javadoc %changelog * Thu Jul 01 2021 Jiri Vanek - 0.2-0.1.20210701c15dd4c - criu-devel moved to BR - now requires criu-libs - enabled debuginfo generation - excluded i686 build as criu is 64b only - .so file moved out of jar. Required teo patches: - added and applied patch0 output_loc.patch - added and applied patch1 load_library.patch - on aarch64 workarounded missing lib64 on /usr/LD_LIBRARY_PATH * Wed Apr 14 2021 Jiri Vanek - 0.2-0.1.20210701c15dd4c - initial build - added requires of criu-devel