diff options
author | Louie Shprung <lshprung@tutanota.com> | 2024-09-06 17:04:26 -0400 |
---|---|---|
committer | Louie Shprung <lshprung@tutanota.com> | 2024-09-06 17:04:26 -0400 |
commit | a3caf7f6dddebbb3a59517c9cb803e44f9e9f5f3 (patch) | |
tree | c54cb07e179c993f793f3dc046a5d695b458c11e /actions/build_rpm.sh | |
parent | 027bf3ff497ead2ab69d1660e6928eea28530c64 (diff) |
Diffstat (limited to 'actions/build_rpm.sh')
-rwxr-xr-x | actions/build_rpm.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/actions/build_rpm.sh b/actions/build_rpm.sh new file mode 100755 index 0000000..5b1f1df --- /dev/null +++ b/actions/build_rpm.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env sh + +print_help() { + echo "Usage: $0 IMAGE_NAME IMAGE_VERSION SPEC_FILE" +} + +DEPENDENCY_LIST="gcc lua lua-devel make ncurses-devel rpmdevtools rpmlint" + +# print help if not enough arguments were passed +if [ $# -lt 3 ]; then + print_help + exit 1 +fi + +IMAGE_NAME="$1" +shift +IMAGE_VERSION="$1" +shift +SPEC_FILE="$1" +shift + +yum -y update + +if [ "$IMAGE_NAME" = "rockylinux" ] && [ "$IMAGE_VERSION" = "8" ]; then + yum -y install yum-utils + yum -y install epel-release + if [ "$IMAGE_VERSION" = "8" ]; then + yum -y config-manager --set-enabled powertools + else + yum -y config-manager --set-enabled crb + fi + yum -y update +fi + +yum -y makecache +yum install -y $DEPENDENCY_LIST +rpmdev-setuptree +rpmbuild -ba /root/rpmbuild/SPECS/"$SPEC_FILE" |