angryip / ipscan

Angry IP Scanner - fast and friendly network scanner
angryip.org
GNU General Public License v2.0
4.15k stars 718 forks source link

Buildin on fedora set arch as fc40.x86_64 #454

Open albfan opened 3 months ago

albfan commented 3 months ago

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):