aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2020-05-08 10:33:00 +0200
committerOliver Smith <osmith@sysmocom.de>2020-05-08 12:55:48 +0200
commit6701755d08ab3c81af895b82bccb22e39ddfeb8a (patch)
treee2659e327131fb962eeaf5f0f20404dff97736b0
parentf31913d64a430bfa81c4f3af955abe91ace09a57 (diff)
rpm-local/build.sh: use additional source files
Clear the SOURCES dir before building, and copy all additional source files (e.g. patches, or that macro file for the systemd-rpm-macros package) to SOURCES before building. Change-Id: I39def515e3ceb24e92d66d56b51731df4852f336
-rwxr-xr-xrpm-local/build.sh19
1 files changed, 18 insertions, 1 deletions
diff --git a/rpm-local/build.sh b/rpm-local/build.sh
index 01168d2..a71ede0 100755
--- a/rpm-local/build.sh
+++ b/rpm-local/build.sh
@@ -32,6 +32,11 @@ spec_version() {
}
mkdir_rpmbuild() {
+ # Clean previous sources
+ if [ -d "rpmbuild/SOURCES" ]; then
+ rm -rf "rpmbuild/SOURCES"
+ fi
+
mkdir -p \
"rpmbuild/RPMS" \
"rpmbuild/SOURCES" \
@@ -54,9 +59,21 @@ _build_pkg() {
local pkgname="$1"
local specfile="spec/$pkgname/$pkgname.spec"
+ # Copy spec file
require_path "$specfile"
cp "$specfile" "rpmbuild/SPECS/$pkgname.spec"
+ # Copy source files (patches etc.)
+ for i in "spec/$pkgname/"*; do
+ case "$i" in
+ *.spec)
+ ;;
+ *)
+ echo "add source: $i"
+ cp "$i" "rpmbuild/SOURCES/"
+ esac
+ done
+
# Install depends and build
mkdir -p "cache/$IMAGE/dnf"
docker run \
@@ -82,7 +99,7 @@ build_pkg_osmo() {
version="$(spec_version "$specfile")"
tarball="rpmbuild/SOURCES/$pkgname-$version.tar.xz"
- echo "creating tarball from git HEAD: $tarball"
+ echo "add source: git HEAD tarball: $tarball"
require_path "$SRCDIR/$pkgname"
git -C "$SRCDIR/$pkgname" archive \