diff options
author | 2016-10-25 11:45:14 +0000 | |
---|---|---|
committer | 2016-10-25 11:45:14 +0000 | |
commit | 688948508e373829cdcd7bb1e4ebb7f55e43cdac (patch) | |
tree | 8e071efa549c859579bb4753451880a4a36537da /tools/pharos-validator/rpm/buildasroot.sh | |
parent | af9b7ddeb637278a7705964ba98c8e6a2e7307f4 (diff) | |
parent | d863ee1a888954aa9863c33f95e636466b4025a8 (diff) |
Merge "Add pharos-validator tool"
Diffstat (limited to 'tools/pharos-validator/rpm/buildasroot.sh')
-rwxr-xr-x | tools/pharos-validator/rpm/buildasroot.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/pharos-validator/rpm/buildasroot.sh b/tools/pharos-validator/rpm/buildasroot.sh new file mode 100755 index 00000000..94076c26 --- /dev/null +++ b/tools/pharos-validator/rpm/buildasroot.sh @@ -0,0 +1,32 @@ +#! /usr/bin/env bash +# Builds the pharosvalidator package as root (it must be built as root) +# then copies the finished package to /tmp. The script can either be called +# as root or with sudo + +tarball=pharos-validator-1.tar.gz +specfile=pharosvalidator.spec +arch=x86_64 + +if [ "$(id -u)" != 0 ]; then + echo "This script must be run as root (or with sudo)" + exit 1 +fi; + +rpmdev-setuptree + +cp "$specfile" ~/rpmbuild/SPECS/ + +# Prepare the "source package" for the rpm build process using .spec file +pushd ../../ +tar -cvf "$tarball" pharos-validator +cp "$tarball" ~/rpmbuild/SOURCES +popd + + +cd ~/rpmbuild/ + +rpmlint SPECS/"$specfile" +printf "\n\nRPM BUILD PROCESS\n\n" +rpmbuild -ba SPECS/"$specfile" + +cp -rfv RPMS/"$arch"/* /tmp/ |