Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buildin on fedora set arch as fc40.x86_64 #454

Open
albfan opened this issue Jul 28, 2024 · 0 comments
Open

Buildin on fedora set arch as fc40.x86_64 #454

albfan opened this issue Jul 28, 2024 · 0 comments

Comments

@albfan
Copy link

albfan commented Jul 28, 2024

Describe the bug
rpm task fails on fedora 40 due to rpmbuild is setting arch as fc40.x86_64

To Reproduce

  1. build on fedora
$ ./gradlew linux64
> Task :linux64.min FAILED

FAILURE: Build failed with an exception.

* Where:
Build file '/home/alberto/projects/java/ipscan/build.gradle' line: 223

* What went wrong:
Execution failed for task ':linux64.min'.
> Warning: Could not find file /home/alberto/projects/java/ipscan/build/libs/rpm/RPMS/x86_64/ipscan-3.9.1.9.gff097334-1.x86_64.rpm to copy.

that file do not exists. Showing here the difference:

/home/alberto/projects/java/ipscan/build/libs/rpm/RPMS/x86_64/ipscan-3.9.1.9.gff097334-1.x86_64.rpm
/home/alberto/projects/java/ipscan/build/libs/rpm/RPMS/x86_64/ipscan-3.9.1.9.gff097334-1.fc40.x86_64.rpm

I solved with a regex match, not sure if rpmbuild can be setup to avoid that fedora specific "arch"

diff --git a/build.gradle b/build.gradle
index 9606a90f..d0a31904 100644
--- a/build.gradle
+++ b/build.gradle
@@ -220,7 +220,9 @@ def rpm(def platform, def arch) {
         ant.replacefilter(token: "VERSION", value: version)
     }
     exec(new String[] {"sh", "-c", "rpmbuild --target ${arch} --define \"_topdir ${new File(dist).absolutePath}\" --define \"platform ${platform}\" -bb SPECS/ipscan.spec"}, dist)
-    ant.move(file: "${dist}/RPMS/${arch}/ipscan-${rpmVersion}-1.${arch}.rpm", todir:'build/libs')
+    ant.move(todir:'build/libs') {
+        ant.fileset(file: "${dist}/RPMS/${arch}/ipscan-${rpmVersion}-1.*${arch}.rpm")
+    }
     ant.delete(dir: dist)
 }

Expected behavior
build on fedora

Versions (please copy from the About dialog or complete manually):

  • Version of Angry IP Scanner: master
  • OS, version, CPU architecture: linux fedora 40
  • java version:
openjdk version "21.0.3" 2024-04-16
OpenJDK Runtime Environment (Red_Hat-21.0.3.0.9-1) (build 21.0.3+9)
OpenJDK 64-Bit Server VM (Red_Hat-21.0.3.0.9-1) (build 21.0.3+9, mixed mode, sharing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant