summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2024-07-10 16:36:41 -0400
committerLouie S <louie@example.com>2024-07-10 16:36:41 -0400
commit7ac67da65faf1c2ebd4e0cc0455e28c8ee18ed16 (patch)
treecd71a172f12349fed40e21ea79d1a97b9ba94fc8
parent8c1261cda51472df197c9bebfeec0e395a49d0dc (diff)
Create actions_build_rpm target
-rw-r--r--actions/Makefile.am18
-rw-r--r--actions/README.md1
2 files changed, 19 insertions, 0 deletions
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