From 7ac67da65faf1c2ebd4e0cc0455e28c8ee18ed16 Mon Sep 17 00:00:00 2001 From: Louie S Date: Wed, 10 Jul 2024 16:36:41 -0400 Subject: Create actions_build_rpm target --- actions/Makefile.am | 18 ++++++++++++++++++ actions/README.md | 1 + 2 files changed, 19 insertions(+) (limited to 'actions') diff --git a/actions/Makefile.am b/actions/Makefile.am index 6ce9ec2..f69759f 100644 --- a/actions/Makefile.am +++ b/actions/Makefile.am @@ -21,3 +21,21 @@ actions_build_deb: ../$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz mkdir -p "build/$@/$(IMAGE_NAME)-$(IMAGE_VERSION)" podman cp "$(CONTAINER_NAME)":/tmp/build/. "build/$@/$(IMAGE_NAME)-$(IMAGE_VERSION)/" if [ "$(SAVE_CONTAINER)" = "no" ]; then podman kill "$(CONTAINER_NAME)" && podman rm "$(CONTAINER_NAME)"; fi + +.PHONY: actions_build_rpm +actions_build_rpm: IMAGE_NAME = fedora +actions_build_rpm: IMAGE_VERSION = rawhide +actions_build_rpm: CONTAINER_NAME = $(PACKAGE_NAME)_$@_$(IMAGE_NAME)-$(IMAGE_VERSION) +actions_build_rpm: DEPENDENCY_LIST = gcc ncurses-devel rpmdevtools rpmlint +actions_build_rpm: ../$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz + podman pull docker.io/library/$(IMAGE_NAME):$(IMAGE_VERSION) + podman container exists "$(CONTAINER_NAME)" || podman run -itd --name "$(CONTAINER_NAME)" "$(IMAGE_NAME):$(IMAGE_VERSION)" + podman exec "$(CONTAINER_NAME)" yum makecache + podman exec "$(CONTAINER_NAME)" yum install -y $(DEPENDENCY_LIST) + podman exec "$(CONTAINER_NAME)" rpmdev-setuptree + podman cp "../$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz" "$(CONTAINER_NAME)":/root/rpmbuild/SOURCES/ + podman cp "../spec/$(PACKAGE_NAME).spec" "$(CONTAINER_NAME)":/root/rpmbuild/SPECS/ + podman exec "$(CONTAINER_NAME)" rpmbuild -ba /root/rpmbuild/SPECS/$(PACKAGE_NAME).spec + mkdir -p "build/$@/$(IMAGE_NAME)-$(IMAGE_VERSION)" + podman cp "$(CONTAINER_NAME)":/root/rpmbuild/. "build/$@/$(IMAGE_NAME)-$(IMAGE_VERSION)/" + if [ "$(SAVE_CONTAINER)" = "no" ]; then podman kill "$(CONTAINER_NAME)" && podman rm "$(CONTAINER_NAME)"; fi diff --git a/actions/README.md b/actions/README.md index 08a1ae0..5c23406 100644 --- a/actions/README.md +++ b/actions/README.md @@ -7,6 +7,7 @@ Usage: make TARGET [OPTIONS] targets: actions_build_deb build a deb package + actions_build_rpm build a rpm package options: CONTAINER_NAME=... specify a container name -- cgit