aboutsummaryrefslogtreecommitdiffstats
path: root/rpm-local
diff options
context:
space:
mode:
Diffstat (limited to 'rpm-local')
-rwxr-xr-xrpm-local/install_test.sh20
-rwxr-xr-xrpm-local/scripts/build_pkg.sh2
-rwxr-xr-xrpm-local/scripts/install_test.sh19
3 files changed, 40 insertions, 1 deletions
diff --git a/rpm-local/install_test.sh b/rpm-local/install_test.sh
new file mode 100755
index 0000000..0aa04ee
--- /dev/null
+++ b/rpm-local/install_test.sh
@@ -0,0 +1,20 @@
+#!/bin/sh -ex
+DIR="$(cd "$(dirname "$0")" && pwd -P)"
+IMAGE="centos8"
+
+if ! [ -e ".build.docker.$IMAGE" ]; then
+ echo "ERROR: run build.sh first, to generate the docker img"
+ exit 1
+fi
+
+
+docker run \
+ -it \
+ --rm \
+ -v "$DIR/rpmbuild:/home/user/rpmbuild" \
+ -v "$DIR/scripts:/scripts" \
+ -v "$DIR/cache/$IMAGE/dnf:/var/cache/dnf" \
+ -v "$DIR/cache/yum_repos:/root/yum_repos" \
+ -v "$DIR/cache/distfiles:/home/user/distfiles" \
+ "$IMAGE:latest" \
+ /scripts/install_test.sh
diff --git a/rpm-local/scripts/build_pkg.sh b/rpm-local/scripts/build_pkg.sh
index 5d94a76..d7e83d3 100755
--- a/rpm-local/scripts/build_pkg.sh
+++ b/rpm-local/scripts/build_pkg.sh
@@ -29,7 +29,7 @@ cd /home/user/rpmbuild/SPECS
# Install systemd-rpm-macros if needed, so the .spec can be parsed
if grep "^BuildRequires:" "$1.spec" | grep -q systemd-rpm-macros; then
- dnf -y install systemd-rpm-macros
+ dnf --setopt=keepcache=1 -y install systemd-rpm-macros
fi
# keepcache: /var/cache/dnf is mounted from outside docker dir, so downloaded rpm depends are cached
diff --git a/rpm-local/scripts/install_test.sh b/rpm-local/scripts/install_test.sh
new file mode 100755
index 0000000..28b66b1
--- /dev/null
+++ b/rpm-local/scripts/install_test.sh
@@ -0,0 +1,19 @@
+#!/bin/sh -ex
+REPO_FILE="home:osmith42.repo"
+
+# Download repo file
+cd /root/yum_repos
+if ! [ -e "$REPO_FILE" ]; then
+ dnf --setopt=keepcache=1 -y install wget
+ wget https://download.opensuse.org/repositories/home:osmith42/CentOS_8_Stream/home:osmith42.repo
+fi
+
+# Enable repo
+cp "/root/yum_repos/$REPO_FILE" "/etc/yum.repos.d/$REPO_FILE"
+
+# update index
+dnf --setopt=keepcache=1 -y check-update /etc/yum.repos.d/$REPO_FILE
+
+# install packages
+# somehow -y is not enough
+yes | dnf --setopt=keepcache=1 -y install osmo-trx-uhd