aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2020-05-07 15:04:10 +0200
committerOliver Smith <osmith@sysmocom.de>2020-05-08 12:55:48 +0200
commit0cf5948f4db7cfecc991c490e0435cc35bcaf570 (patch)
tree46d40ef9564514327e815183844830aff6dbc552
parent6e2e90e5e3551fa80f00623d7308d3e4eef5f239 (diff)
rpm-local: resolve depends of previously built pkgs
-rw-r--r--rpm-local/images/centos8/Dockerfile1
-rwxr-xr-xrpm-local/scripts/build_pkg.sh17
2 files changed, 17 insertions, 1 deletions
diff --git a/rpm-local/images/centos8/Dockerfile b/rpm-local/images/centos8/Dockerfile
index d786a44..c2ea7b2 100644
--- a/rpm-local/images/centos8/Dockerfile
+++ b/rpm-local/images/centos8/Dockerfile
@@ -5,6 +5,7 @@ RUN useradd -m --uid=$UID user
# dnf-plugins-core: for "dnf builddep"
RUN dnf install -y \
+ createrepo \
dnf-plugins-core \
rpm-build
diff --git a/rpm-local/scripts/build_pkg.sh b/rpm-local/scripts/build_pkg.sh
index 86bacc8..119ef10 100755
--- a/rpm-local/scripts/build_pkg.sh
+++ b/rpm-local/scripts/build_pkg.sh
@@ -1,9 +1,24 @@
#!/bin/sh -ex
# $1: pkgname
+ARCH="x86_64"
-cd /home/user/rpmbuild/SPECS
+cd /home/user/rpmbuild/RPMS
+
+# if already built packages exist, run createrepo and add it as local repo
+if [ -d "$ARCH" ]; then
+ cd "$ARCH"
+ createrepo .
+
+ cat <<- EOF > /etc/yum.repos.d/rpmbuild-local.repo
+ [myrepo]
+ name=Local Osmocom packages
+ baseurl=file:///home/user/rpmbuild/RPMS/$ARCH
+ enabled=1
+ EOF
+fi
# keepcache: /var/cache/dnf is mounted from outside docker dir, so downloaded rpm depends are cached
+cd /home/user/rpmbuild/SPECS
dnf \
--setopt=keepcache=1 \
-y \