aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/rpmbuild.sh
blob: d9823e5eda61ca0a290978e9c7769d20a76e9a0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

spec=${1:-$(dirname $0)/rhel/ndctl.spec)}

pushd $(dirname $0) >/dev/null
[ ! -d ~/rpmbuild/SOURCES ] && echo "rpmdev tree not found" && exit 1
if ./git-version | grep -q dirty; then
	echo "Uncommitted changes detected, commit or undo them to proceed"
	git status -uno --short
	exit 1
fi
if [ ! -f $spec ]; then
	meson compile -C build rhel/ndctl.spec
	spec=$(dirname $0)/build/rhel/ndctl.spec
fi
./make-git-snapshot.sh
popd > /dev/null
rpmbuild --nocheck -ba $spec