Skip to content

Commit

Permalink
Merge pull request #926 from mackerelio/remove-old-rpm-packaging
Browse files Browse the repository at this point in the history
Remove old rpm packaging
  • Loading branch information
yseto authored Aug 16, 2023
2 parents 23d2279 + a517642 commit 1472711
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1,027 deletions.
64 changes: 15 additions & 49 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,112 +103,78 @@ crossbuild-package-stage:
make crossbuild-package MACKEREL_AGENT_NAME=mackerel-agent-stage MACKEREL_API_BASE=http://0.0.0.0

.PHONY: rpm
rpm: rpm-v1 rpm-v2

.PHONY: rpm-v1
rpm-v1: crossbuild-package
MACKEREL_AGENT_NAME=$(MACKEREL_AGENT_NAME) _tools/packaging/prepare-rpm-build.sh
docker run --rm -v "$(PWD)":/workspace -v "$(PWD)/rpmbuild":/rpmbuild mackerel/docker-mackerel-rpm-builder:c7 \
--define "_sourcedir /workspace/packaging/rpm-build/src" --define "_builddir /workspace/build-linux-386" \
--define "_version ${VERSION}" --define "buildarch noarch" --target noarch \
-bb packaging/rpm-build/$(MACKEREL_AGENT_NAME).spec
MACKEREL_AGENT_NAME=$(MACKEREL_AGENT_NAME) _tools/packaging/prepare-rpm-build.sh
docker run --rm -v "$(PWD)":/workspace -v "$(PWD)/rpmbuild":/rpmbuild mackerel/docker-mackerel-rpm-builder:c7 \
--define "_sourcedir /workspace/packaging/rpm-build/src" --define "_builddir /workspace/build-linux-amd64" \
--define "_version ${VERSION}" --define "buildarch x86_64" --target x86_64 \
-bb packaging/rpm-build/$(MACKEREL_AGENT_NAME).spec
rpm: rpm-v2

.PHONY: rpm-v2
rpm-v2: rpm-v2-x86 rpm-v2-arm

.PHONY: rpm-v2-x86
rpm-v2-x86: crossbuild-package
BUILD_SYSTEMD=1 MACKEREL_AGENT_NAME=$(MACKEREL_AGENT_NAME) _tools/packaging/prepare-rpm-build.sh
MACKEREL_AGENT_NAME=$(MACKEREL_AGENT_NAME) _tools/packaging/prepare-rpm-build.sh
docker run --rm -v "$(PWD)":/workspace -v "$(PWD)/rpmbuild":/rpmbuild mackerel/docker-mackerel-rpm-builder:c7 \
--define "_sourcedir /workspace/packaging/rpm-build/src" --define "_builddir /workspace/build-linux-amd64" \
--define "_version ${VERSION}" --define "buildarch x86_64" --target x86_64 --define "dist .el7.centos" \
-bb packaging/rpm-build/$(MACKEREL_AGENT_NAME).spec
BUILD_SYSTEMD=1 MACKEREL_AGENT_NAME=$(MACKEREL_AGENT_NAME) _tools/packaging/prepare-rpm-build.sh
MACKEREL_AGENT_NAME=$(MACKEREL_AGENT_NAME) _tools/packaging/prepare-rpm-build.sh
docker run --rm -v "$(PWD)":/workspace -v "$(PWD)/rpmbuild":/rpmbuild mackerel/docker-mackerel-rpm-builder:c7 \
--define "_sourcedir /workspace/packaging/rpm-build/src" --define "_builddir /workspace/build-linux-amd64" \
--define "_version ${VERSION}" --define "buildarch x86_64" --target x86_64 --define "dist .amzn2" \
-bb packaging/rpm-build/$(MACKEREL_AGENT_NAME).spec

.PHONY: rpm-v2-arm
rpm-v2-arm: crossbuild-package
BUILD_SYSTEMD=1 MACKEREL_AGENT_NAME=$(MACKEREL_AGENT_NAME) _tools/packaging/prepare-rpm-build.sh
MACKEREL_AGENT_NAME=$(MACKEREL_AGENT_NAME) _tools/packaging/prepare-rpm-build.sh
docker run --rm -v "$(PWD)":/workspace -v "$(PWD)/rpmbuild":/rpmbuild mackerel/docker-mackerel-rpm-builder:c7 \
--define "_sourcedir /workspace/packaging/rpm-build/src" --define "_builddir /workspace/build-linux-arm64" \
--define "_version ${VERSION}" --define "buildarch aarch64" --target aarch64 --define "dist .el7.centos" \
-bb packaging/rpm-build/$(MACKEREL_AGENT_NAME).spec
BUILD_SYSTEMD=1 MACKEREL_AGENT_NAME=$(MACKEREL_AGENT_NAME) _tools/packaging/prepare-rpm-build.sh
MACKEREL_AGENT_NAME=$(MACKEREL_AGENT_NAME) _tools/packaging/prepare-rpm-build.sh
docker run --rm -v "$(PWD)":/workspace -v "$(PWD)/rpmbuild":/rpmbuild mackerel/docker-mackerel-rpm-builder:c7 \
--define "_sourcedir /workspace/packaging/rpm-build/src" --define "_builddir /workspace/build-linux-arm64" \
--define "_version ${VERSION}" --define "buildarch aarch64" --target aarch64 --define "dist .amzn2" \
-bb packaging/rpm-build/$(MACKEREL_AGENT_NAME).spec

.PHONY: deb
deb: crossbuild-package
BUILD_DIRECTORY=build-linux-amd64 BUILD_SYSTEMD=1 MACKEREL_AGENT_NAME=$(MACKEREL_AGENT_NAME) _tools/packaging/prepare-deb-build.sh
BUILD_DIRECTORY=build-linux-amd64 MACKEREL_AGENT_NAME=$(MACKEREL_AGENT_NAME) _tools/packaging/prepare-deb-build.sh
cd packaging/deb-build && debuild --no-tgz-check -rfakeroot -uc -us
BUILD_DIRECTORY=build-linux-arm64 BUILD_SYSTEMD=1 MACKEREL_AGENT_NAME=$(MACKEREL_AGENT_NAME) _tools/packaging/prepare-deb-build.sh
BUILD_DIRECTORY=build-linux-arm64 MACKEREL_AGENT_NAME=$(MACKEREL_AGENT_NAME) _tools/packaging/prepare-deb-build.sh
cd packaging/deb-build && debuild --no-tgz-check -rfakeroot -uc -us -aarm64
BUILD_DIRECTORY=build-linux-mips BUILD_SYSTEMD=1 MACKEREL_AGENT_NAME=$(MACKEREL_AGENT_NAME) _tools/packaging/prepare-deb-build.sh
BUILD_DIRECTORY=build-linux-mips MACKEREL_AGENT_NAME=$(MACKEREL_AGENT_NAME) _tools/packaging/prepare-deb-build.sh
cd packaging/deb-build && debuild --no-tgz-check -rfakeroot -uc -us -amips
BUILD_DIRECTORY=build-linux-armhf BUILD_SYSTEMD=1 MACKEREL_AGENT_NAME=$(MACKEREL_AGENT_NAME) _tools/packaging/prepare-deb-build.sh
BUILD_DIRECTORY=build-linux-armhf MACKEREL_AGENT_NAME=$(MACKEREL_AGENT_NAME) _tools/packaging/prepare-deb-build.sh
cd packaging/deb-build && debuild --no-tgz-check -rfakeroot -uc -us -aarmhf

.PHONY: rpm-kcps
rpm-kcps: rpm-kcps-v1 rpm-kcps-v2

.PHONY: rpm-kcps-v1
rpm-kcps-v1: crossbuild-package-kcps
MACKEREL_AGENT_NAME=mackerel-agent-kcps _tools/packaging/prepare-rpm-build.sh
docker run --rm -v "$(PWD)":/workspace -v "$(PWD)/rpmbuild":/rpmbuild mackerel/docker-mackerel-rpm-builder:c7 \
--define "_sourcedir /workspace/packaging/rpm-build/src" --define "_builddir /workspace/build-linux-386" \
--define "_version ${VERSION}" --define "buildarch noarch" --target noarch \
-bb packaging/rpm-build/mackerel-agent-kcps.spec
MACKEREL_AGENT_NAME=mackerel-agent-kcps _tools/packaging/prepare-rpm-build.sh
docker run --rm -v "$(PWD)":/workspace -v "$(PWD)/rpmbuild":/rpmbuild mackerel/docker-mackerel-rpm-builder:c7 \
--define "_sourcedir /workspace/packaging/rpm-build/src" --define "_builddir /workspace/build-linux-amd64" \
--define "_version ${VERSION}" --define "buildarch x86_64" --target x86_64 \
-bb packaging/rpm-build/mackerel-agent-kcps.spec
rpm-kcps: rpm-kcps-v2

.PHONY: rpm-kcps-v2
rpm-kcps-v2: crossbuild-package-kcps
BUILD_SYSTEMD=1 MACKEREL_AGENT_NAME=mackerel-agent-kcps _tools/packaging/prepare-rpm-build.sh
MACKEREL_AGENT_NAME=mackerel-agent-kcps _tools/packaging/prepare-rpm-build.sh
docker run --rm -v "$(PWD)":/workspace -v "$(PWD)/rpmbuild":/rpmbuild mackerel/docker-mackerel-rpm-builder:c7 \
--define "_sourcedir /workspace/packaging/rpm-build/src" --define "_builddir /workspace/build-linux-amd64" \
--define "_version ${VERSION}" --define "buildarch x86_64" --target x86_64 --define "dist .el7.centos" \
-bb packaging/rpm-build/mackerel-agent-kcps.spec

.PHONY: deb-kcps
deb-kcps: crossbuild-package-kcps
MACKEREL_AGENT_NAME=mackerel-agent-kcps BUILD_SYSTEMD=1 BUILD_DIRECTORY=build-linux-amd64 _tools/packaging/prepare-deb-build.sh
MACKEREL_AGENT_NAME=mackerel-agent-kcps BUILD_DIRECTORY=build-linux-amd64 _tools/packaging/prepare-deb-build.sh
cd packaging/deb-build && debuild --no-tgz-check -rfakeroot -uc -us

.PHONY: rpm-stage
rpm-stage: rpm-stage-v1 rpm-stage-v2

.PHONY: rpm-stage-v1
rpm-stage-v1: crossbuild-package-stage
MACKEREL_AGENT_NAME=mackerel-agent-stage _tools/packaging/prepare-rpm-build.sh
docker run --rm -v "$(PWD)":/workspace -v "$(PWD)/rpmbuild":/rpmbuild mackerel/docker-mackerel-rpm-builder:c7 \
--define "_sourcedir /workspace/packaging/rpm-build/src" --define "_builddir /workspace/build-linux-386" \
--define "_version ${VERSION}" --define "buildarch noarch" --target noarch \
-bb packaging/rpm-build/mackerel-agent-stage.spec
rpm-stage: rpm-stage-v2

.PHONY: rpm-stage-v2
rpm-stage-v2: crossbuild-package-stage
BUILD_SYSTEMD=1 MACKEREL_AGENT_NAME=mackerel-agent-stage _tools/packaging/prepare-rpm-build.sh
MACKEREL_AGENT_NAME=mackerel-agent-stage _tools/packaging/prepare-rpm-build.sh
docker run --rm -v "$(PWD)":/workspace -v "$(PWD)/rpmbuild":/rpmbuild mackerel/docker-mackerel-rpm-builder:c7 \
--define "_sourcedir /workspace/packaging/rpm-build/src" --define "_builddir /workspace/build-linux-amd64" \
--define "_version ${VERSION}" --define "buildarch x86_64" --target x86_64 --define "dist .el7.centos" \
-bb packaging/rpm-build/mackerel-agent-stage.spec

.PHONY: deb-stage
deb-stage: crossbuild-package-stage
MACKEREL_AGENT_NAME=mackerel-agent-stage BUILD_SYSTEMD=1 BUILD_DIRECTORY=build-linux-amd64 _tools/packaging/prepare-deb-build.sh
MACKEREL_AGENT_NAME=mackerel-agent-stage BUILD_DIRECTORY=build-linux-amd64 _tools/packaging/prepare-deb-build.sh
cd packaging/deb-build && debuild --no-tgz-check -rfakeroot -uc -us

tgz_dir = "build/tgz/$(MACKEREL_AGENT_NAME)"
Expand Down
6 changes: 1 addition & 5 deletions _tools/packaging/prepare-deb-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ pwd=`dirname $0`
MACKEREL_AGENT_NAME=${MACKEREL_AGENT_NAME:-mackerel-agent}
BUILD_DIRECTORY=${BUILD_DIRECTORY:-build}

orig_dir="packaging/deb"
orig_dir="packaging/deb-systemd"
build_dir="packaging/deb-build"

if [ "$BUILD_SYSTEMD" != "" ]; then
orig_dir="packaging/deb-systemd"
fi

MACKEREL_AGENT_VERSION=$(grep -o -e "[0-9]\+.[0-9]\+.[0-9]\+-[0-9]" "$orig_dir/debian/changelog" | head -1 | sed 's/-.*$//')

rm -rf "$build_dir"
Expand Down
6 changes: 1 addition & 5 deletions _tools/packaging/prepare-rpm-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ pwd=`dirname $0`
. "$pwd/common.sh"

MACKEREL_AGENT_NAME=${MACKEREL_AGENT_NAME:-mackerel-agent}
spec_filename="mackerel-agent.spec"
if [ "$BUILD_SYSTEMD" != "" ]; then
spec_filename="mackerel-agent-systemd.spec"
fi

spec_filename="mackerel-agent-systemd.spec"
orig_dir="packaging/rpm"
build_dir="packaging/rpm-build"

Expand Down
Loading

0 comments on commit 1472711

Please sign in to comment.