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
117 changes: 33 additions & 84 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
---
version: 2.1

orbs:
cloudsmith: cloudsmith/cloudsmith@1.0.5
sign-packages: opennms/sign-packages@3.0.0
sign-packages: opennms/sign-packages@3.0.1

parameters:
debian-version:
type: string
default: buster
default: bookworm
maven-version:
type: string
default: 3.6.3
default: 3.8.9
Comment on lines 8 to +14
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debian-version is defined as a pipeline parameter but is no longer referenced anywhere in this config. This can confuse future changes (e.g., expecting do-docker-build to honor it). Either remove the unused parameter or wire it back in (for example, use it when selecting the Debian base image/tag).

Copilot uses AI. Check for mistakes.
# use the oldest version
xcode-version:
type: string
default: 11.7.0
default: 26.2.0

executors:
java-executor:
docker:
- image: cimg/openjdk:8.0
- image: cimg/openjdk:17.0
package-executor:
machine:
image: ubuntu-2004:current
image: ubuntu-2404:current
debian-executor:
docker:
- image: opennms/build-env:debian-jdk8
- image: opennms/build-env:circleci-ubuntu-jdk17-b10832

commands:
cache-restore:
Expand Down Expand Up @@ -131,19 +132,13 @@ commands:
fi

sudo apt -q update
sudo apt -y -q install gnupg2 software-properties-common

echo "deb http://deb.debian.org/debian << pipeline.parameters.debian-version >>-backports main" | sudo tee /etc/apt/sources.list.d/<< pipeline.parameters.debian-version >>-backports.list
echo "deb http://deb.debian.org/debian-security << pipeline.parameters.debian-version >>/updates main" | sudo tee /etc/apt/sources.list.d/<< pipeline.parameters.debian-version >>-security.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC 648ACFD622F3D138 0E98404D386FA1D9 AA8E81B4331F7F50 112695A0E562B32A
sudo apt -q update
sudo apt -y -q -t << pipeline.parameters.debian-version >>-backports install apt-transport-https ca-certificates
sudo apt -y -q install gnupg2 software-properties-common apt-transport-https ca-certificates
- cache-restore:
key: debian-<< parameters.type >>
path: /var/cache/apt
- run:
name: download jdk
command: sudo apt -y --download-only -q -t << pipeline.parameters.debian-version >>-backports install openjdk-8-jdk-headless
command: sudo apt -y --download-only -q install openjdk-17-jdk-headless
- run:
name: download other dependencies
command: sudo apt -y --download-only -q install autotools-dev autoconf automake cdbs curl debhelper debianutils devscripts dpkg-dev git software-properties-common
Expand All @@ -152,7 +147,10 @@ commands:
path: /var/cache/apt
- run:
name: install jdk
command: sudo apt -y -q -t << pipeline.parameters.debian-version >>-backports install openjdk-8-jdk-headless
command: |
sudo rm -rf /etc/ssl/certs/java/cacerts
sudo update-ca-certificates
sudo apt -y -q install openjdk-17-jdk-headless
- run:
name: install other dependencies
command: sudo apt -y -q install autotools-dev autoconf automake cdbs curl debhelper debianutils devscripts dpkg-dev git software-properties-common
Expand Down Expand Up @@ -257,28 +255,22 @@ commands:
parameters:
platform:
type: enum
enum: ["arm32v7", "arm64v8", "i386", "amd64"]
enum: ["arm64v8", "amd64"]
steps:
- run:
name: build << parameters.platform >>
command: |
case "<< parameters.platform >>" in
arm32v7)
PLATFORM="linux/arm/v7"
;;
arm64)
PLATFORM="linux/arm64"
;;
i386)
PLATFORM="linux/i386"
;;
amd64)
PLATFORM="linux/amd64"
;;
esac
Comment on lines 263 to 270
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In do-docker-build, the case statement matches arm64) but the platform parameter enum (and workflow matrices) use arm64v8. This leaves PLATFORM unset for the arm64 build, so the subsequent docker run --platform "${PLATFORM}" ... will fail. Update the case label to arm64v8) (or change the enum/value passed in) and consider adding a default case that errors when an unexpected platform is provided.

Copilot uses AI. Check for mistakes.
set | grep CIRCLE > /tmp/build-env.txt
docker run --rm --privileged tonistiigi/binfmt:latest --install all
docker run --env-file /tmp/build-env.txt --rm -it --platform "${PLATFORM}" -v "$(pwd):/workdir" -w /workdir "<< parameters.platform >>/debian:buster" ./build-all.sh "<< parameters.platform >>"
docker run --env-file /tmp/build-env.txt --rm -it --platform "${PLATFORM}" -v "$(pwd):/workdir" -w /workdir "<< parameters.platform >>/debian:bookworm" ./build-all.sh "<< parameters.platform >>"

jobs:
build-from-source:
Expand Down Expand Up @@ -338,13 +330,14 @@ jobs:
- attach_workspace:
at: ~/
- run:
name: install OpenJDK 8
name: install OpenJDK 17
command: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install "openjdk@8"
sudo ln -sfn /usr/local/opt/openjdk@8/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-8.jdk
HOMEBREW_NO_AUTO_UPDATE=1 brew install "openjdk@17"
sudo ln -sfn /usr/local/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk
- run:
name: configure and build
command: |
export JAVA_HOME="$(/usr/libexec/java_home -v 17)"
export PATH="$HOME/maven/bin:$PATH"
./configure
make
Expand Down Expand Up @@ -399,15 +392,9 @@ jobs:
steps:
- attach_workspace:
at: ~/
- fetch-artifacts:
path: ~/artifacts/rpm/
location: arm32v7-rpm
- fetch-artifacts:
path: ~/artifacts/rpm/
location: arm64v8-rpm
- fetch-artifacts:
path: ~/artifacts/rpm/
location: i386-rpm
- fetch-artifacts:
path: ~/artifacts/rpm/
location: amd64-rpm
Expand All @@ -418,42 +405,28 @@ jobs:
sudo apt-get -y install gnupg2 rpm
- sign-packages/setup-env:
gnupg_home: ~/tmp/gpg
- run:
name: prepare artifacts
command: |
cd ~
mkdir -p artifacts/rpm-signed/
find artifacts/rpm -name \*.rpm | while read -r INFILE; do
OUTFILE="$(echo "$INFILE" | sed -e 's,artifacts/rpm,artifacts/rpm-signed,g')"
docker run -v `pwd`:/workspace -w /workspace opennms/rpm-add-checksum -- "${INFILE}" "${OUTFILE}"
done
- sign-packages/sign-rpms:
gnupg_home: ~/tmp/gpg
gnupg_key: opennms@opennms.org
packages: ~/artifacts/rpm-signed/*.rpm
packages: ~/artifacts/rpm/*.rpm
- save-artifacts:
path: ~/artifacts/rpm-signed
location: rpm-signed
path: ~/artifacts/rpm
location: rpm

sign-debs:
executor: debian-executor
resource_class: small
steps:
- attach_workspace:
at: ~/
- fetch-artifacts:
path: ~/artifacts/deb
location: arm32v7-deb
- fetch-artifacts:
path: ~/artifacts/deb
location: arm64v8-deb
- fetch-artifacts:
path: ~/artifacts/deb
location: i386-deb
- fetch-artifacts:
path: ~/artifacts/deb
location: amd64-deb
- sign-packages/install-deb-dependencies
- sign-packages/install-deb-dependencies:
use_sudo: true
- sign-packages/setup-env:
gnupg_home: ~/tmp/gpg
- sign-packages/sign-debs:
Expand Down Expand Up @@ -496,8 +469,8 @@ jobs:
- attach_workspace:
at: ~/
- fetch-artifacts:
path: ~/artifacts/rpm-signed
location: rpm-signed
path: ~/artifacts/rpm
location: rpm
- fetch-artifacts:
path: ~/artifacts/debian-signed
location: debian-signed
Expand All @@ -508,43 +481,19 @@ jobs:
cloudsmith-repository: << parameters.target_repository >>
package-format: rpm
package-distribution: any-distro/any-version
package-path: ~/artifacts/rpm-signed/jicmp-*.armv7hl.rpm
- cloudsmith/publish:
allow-republish: true
cloudsmith-repository: << parameters.target_repository >>
package-format: rpm
package-distribution: any-distro/any-version
package-path: ~/artifacts/rpm-signed/jicmp-*.aarch64.rpm
- cloudsmith/publish:
allow-republish: true
cloudsmith-repository: << parameters.target_repository >>
package-format: rpm
package-distribution: any-distro/any-version
package-path: ~/artifacts/rpm-signed/jicmp-*.i686.rpm
package-path: ~/artifacts/rpm/jicmp-*.aarch64.rpm
- cloudsmith/publish:
allow-republish: true
cloudsmith-repository: << parameters.target_repository >>
package-format: rpm
package-distribution: any-distro/any-version
package-path: ~/artifacts/rpm-signed/jicmp-*.x86_64.rpm
- cloudsmith/publish:
allow-republish: true
cloudsmith-repository: << parameters.target_repository >>
package-format: deb
package-distribution: any-distro/any-version
package-path: ~/artifacts/debian-signed/jicmp_*_armhf.deb
package-path: ~/artifacts/rpm/jicmp-*.x86_64.rpm
- cloudsmith/publish:
allow-republish: true
cloudsmith-repository: << parameters.target_repository >>
package-format: deb
package-distribution: any-distro/any-version
package-path: ~/artifacts/debian-signed/jicmp_*_arm64.deb
- cloudsmith/publish:
allow-republish: true
cloudsmith-repository: << parameters.target_repository >>
package-format: deb
package-distribution: any-distro/any-version
package-path: ~/artifacts/debian-signed/jicmp_*_i386.deb
- cloudsmith/publish:
allow-republish: true
cloudsmith-repository: << parameters.target_repository >>
Expand All @@ -554,7 +503,7 @@ jobs:

build-docs:
docker:
- image: cimg/openjdk:8.0-node
- image: cimg/openjdk:17.0-node
resource_class: small
steps:
- fetch-maven
Expand Down Expand Up @@ -586,7 +535,7 @@ jobs:

publish-docs:
docker:
- image: cimg/openjdk:8.0-node
- image: cimg/openjdk:17.0-node
resource_class: small
steps:
- checkout
Expand Down Expand Up @@ -634,7 +583,7 @@ workflows:
matrix:
alias: build-packages-arm
parameters:
platform: ["arm32v7", "arm64v8"]
platform: ["arm64v8"]
resource: ["arm.medium"]
requires:
- build-from-source
Expand All @@ -645,7 +594,7 @@ workflows:
matrix:
alias: build-packages-intel
parameters:
platform: ["i386","amd64"]
platform: ["amd64"]
resource: ["medium"]
requires:
- build-from-source
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,5 @@ package-lock.json
/win32/ipch
/win32/Release
/win32/x86

.idea/
3 changes: 1 addition & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,11 @@ java-classes: java.built

java.built: $(JAVA_FILES) pom.xml
-mkdir -p $(classdir)
$(JAVAC) $(JAVACFLAGS) -source $(JAVA_TARGET_VERSION) -target $(JAVA_TARGET_VERSION) -d $(classdir) $(JAVA_FILES) && touch java.built
$(JAVAC) $(JAVACFLAGS) --release $(JAVA_TARGET_VERSION) -h . -d $(classdir) $(JAVA_FILES) && touch java.built

IcmpSocket.c: org_opennms_protocols_icmp_IcmpSocket.h

org_opennms_protocols_icmp_IcmpSocket.h: java.built
$(JAVAH) -classpath $(classdir) org.opennms.protocols.icmp.IcmpSocket

Comment on lines 47 to 54
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

org_opennms_protocols_icmp_IcmpSocket.h now has no recipe and relies on being generated as a side-effect of the java.built rule. If the header is deleted while java.built remains up-to-date, make may not re-run javac -h and the build can fail later when compiling IcmpSocket.c. Consider making the header an explicit output of the rule (e.g., include it in the stamp rule’s targets / use BUILT_SOURCES, or add a small recipe that verifies the header exists and forces regeneration when it doesn’t).

Copilot uses AI. Check for mistakes.
jicmp.jar: java.built
cd $(classdir) && \
Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ _JICMP_ is a small library to allow the use of _IPv4_ _ICMP_ (raw) packets in Ja
* automake
* autoconf
* libtool
* Java JDK 1.8+
* Java JDK 17

The repository has a _git_ submodule which contains _Macros_ required to compile from source code.

Expand Down
5 changes: 3 additions & 2 deletions build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ apt-get -y --no-install-recommends install \
software-properties-common \
wget

apt-add-repository --yes 'deb http://archive.debian.org/debian-security stretch/updates main'
apt-get update
apt-get -y install openjdk-8-jdk-headless
rm -rf /etc/ssl/certs/java/cacerts
update-ca-certificates
apt-get -y install openjdk-17-jdk-headless
Comment on lines 37 to +40
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update-ca-certificates is invoked here but the script does not install the ca-certificates package (which provides that command) in the earlier apt-get ... install list. On minimal Debian images this can fail and break package builds. Install ca-certificates (and, if needed, openssl) before calling update-ca-certificates, or guard the call when the command is unavailable.

Copilot uses AI. Check for mistakes.

# build tarball and binaries from source
make clean >/dev/null 2>&1 || :
Expand Down
3 changes: 1 addition & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ AC_PROG_INSTALL
AC_C_BIGENDIAN
AX_LIB_SOCKET_NSL
CL_AS_NOEXECSTACK
ONMS_CHECK_JDK([1.8])
ONMS_CHECK_JDK([17])
ONMS_CHECK_SUNCC
ONMS_SET_CC_ARCH_CFLAGS
ONMS_SET_CC_WARNING_CFLAGS
Expand All @@ -36,7 +36,6 @@ AM_CONDITIONAL(MAKE_RPMS, test x$make_rpms = xtrue)
PRINT_VAR(JAVA_HOME)
PRINT_VAR(JAVA)
PRINT_VAR(JAVAC)
PRINT_VAR(JAVAH)
PRINT_VAR(JAR)
PRINT_VAR(JNI_INCLUDES)

Expand Down
2 changes: 1 addition & 1 deletion docs-src/modules/installation/pages/source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To be able to build JICMP, you need:
* https://www.gnu.org/software/autoconf/[Autoconf]
* https://www.gnu.org/software/automake/[Automake]
* https://www.gnu.org/software/libtool/[Libtool]
* https://adoptopenjdk.net/[Java JDK] version 1.8 or higher
* https://adoptopenjdk.net/[Java JDK] version 17

== Clone the Repository

Expand Down
2 changes: 1 addition & 1 deletion m4
Submodule m4 updated 1 files
+0 −3 java.m4
Loading