aboutsummaryrefslogtreecommitdiff
path: root/build-rpm.sh
diff options
context:
space:
mode:
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