aboutsummaryrefslogtreecommitdiff
path: root/build-rpm.sh
diff options
context:
space:
mode:
authorHristo Venev <hristo@venev.name>2024-04-14 17:38:19 +0300
committerHristo Venev <hristo@venev.name>2024-04-14 17:54:56 +0300
commitf6bf84ac789c430ef71123c35a91d70d8162e9b9 (patch)
treee6f5076174f8889b951798e8d76fb6d0bfec40a5 /build-rpm.sh
parentf3d0c748b2c259a1f19669cff67600f1a2beb256 (diff)
Package for FedoraHEADmaster
Diffstat (limited to 'build-rpm.sh')
-rwxr-xr-xbuild-rpm.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/build-rpm.sh b/build-rpm.sh
new file mode 100755
index 0000000..bd63808
--- /dev/null
+++ b/build-rpm.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+set -ex
+version=$(sed -n 's/^Version: *\([0-9.]\+\)$/\1/p' < dist/fedora/pgbak.spec)
+[[ -n "$version" ]]
+if [[ -d "build" ]]; then
+ rm -r build
+fi
+mkdir build build/{src,rpms,srpms}
+git archive --prefix="pgbak-$version/" HEAD > "build/src/pgbak-$version.tar.xz"
+rpmbuild \
+ -D"_sourcedir $PWD/build/src" \
+ -D"_srcrpmdir $PWD/build/srpms" \
+ -D"_rpmdir $PWD/build/rpms" \
+ -ba dist/fedora/pgbak.spec