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

Remove old rpm packaging #926

Merged
merged 7 commits into from
Aug 16, 2023
Merged
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
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
yseto marked this conversation as resolved.
Show resolved Hide resolved

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

Expand Down
Loading