Skip to content

Commit

Permalink
Add building amd64 RPMs for RHEL (#281)
Browse files Browse the repository at this point in the history
Add building of arm64 RPM packages
  • Loading branch information
Dean-Coakley authored Apr 12, 2023
1 parent b15b143 commit 2e75edd
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions Makefile.packaging
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ GPG_PUBLIC_KEY := .key

DEB_DISTROS?=ubuntu-jammy-22.04 ubuntu-focal-20.04 ubuntu-bionic-18.04 debian-bullseye-11 debian-buster-10
DEB_ARCHS?=arm64 amd64
RPM_DISTROS?=centos-7-x86_64 oraclelinux-7-x86_64 oraclelinux-8-x86_64 oraclelinux-9-x86_64 redhatenterprise-7-x86_64 redhatenterprise-8-x86_64 redhatenterprise-9-x86_64 suse-12-x86_64 suse-15-x86_64
RPM_DISTROS?=centos-7-x86_64 oraclelinux-7-x86_64 oraclelinux-8-x86_64 oraclelinux-9-x86_64 suse-12-x86_64 suse-15-x86_64
RPM_ARCH=x86_64
REDHAT_VERSIONS?=redhatenterprise-7 redhatenterprise-8 redhatenterprise-9
REDHAT_ARCHS?=aarch64 x86_64
ROCKY_VERSIONS?=rocky-8 rocky-9
ROCKY_ARCHS?=aarch64 x86_64
RPM_ARCH=x86_64
FREEBSD_DISTROS?="FreeBSD:12:amd64" "FreeBSD:13:amd64"
APK_VERSIONS?=3.13 3.14 3.15 3.16 3.17
APK_ARCHS?=aarch64 x86_64
Expand Down Expand Up @@ -68,6 +70,23 @@ package: gpg-key $(PACKAGES_DIR) $(GITHUB_PACKAGES_DIR) ## Create final packages
done; \
rm -rf ./build/nginx-agent


# Create redhat rpm packages

@for arch in $(REDHAT_ARCHS); do \
goarch=amd64; \
if [ "$$arch" = "aarch64" ]; then goarch="arm64"; fi; \
GOWORK=off CGO_ENABLED=0 GOARCH=$${goarch} GOOS=linux go build -ldflags=${LDFLAGS} -o ./build/nginx-agent; \
for distro in $(REDHAT_VERSIONS); do \
rpm_distro=`echo $$distro | cut -d- -f 1`; \
rpm_major=`echo $$distro | cut -d- -f 2`; \
rpm_codename="el$$rpm_major"; \
VERSION=$(shell echo ${VERSION} | tr -d 'v') ARCH=$${arch} nfpm pkg --config .nfpm.yaml --packager rpm --target $(PACKAGES_DIR)/rpm/${PACKAGE_PREFIX}-$(shell echo ${VERSION} | tr -d 'v').$${rpm_codename}.ngx.$${arch}.rpm; \
cp $(PACKAGES_DIR)/rpm/${PACKAGE_PREFIX}-$(shell echo ${VERSION} | tr -d 'v').$${rpm_codename}.ngx.$${arch}.rpm ${GITHUB_PACKAGES_DIR}/${PACKAGE_PREFIX}-$(shell echo ${VERSION} | tr -d 'v').$${rpm_codename}.ngx.$${arch}.rpm; \
done; \
rm -rf ./build/nginx-agent; \
done; \

# Create almalinux rpm packages

@for arch in $(ALMA_ARCHS); do \
Expand Down

0 comments on commit 2e75edd

Please sign in to comment.