summaryrefslogtreecommitdiffstats
path: root/pharos-validator/rpm/buildasroot.sh
diff options
context:
space:
mode:
authorTodd Gaunt <singularik@iol.unh.edu>2016-10-03 16:02:12 -0400
committerTodd Gaunt <singularik@iol.unh.edu>2016-10-03 16:02:12 -0400
commit4f0ecb702a601d122f261a134007377435e4aca1 (patch)
tree40acae3074ab4a5ec1287e282b31646d22ed55be /pharos-validator/rpm/buildasroot.sh
parent6ecb8d290c106e41d0f5a446e7aa878a219224ff (diff)
Add pharos-validator tool
Change-Id: I38e077c2c90059e39ee9871abf5d867a875827a3 Signed-off-by: Todd Gaunt <singularik@iol.unh.edu>
Diffstat (limited to 'pharos-validator/rpm/buildasroot.sh')
-rwxr-xr-xpharos-validator/rpm/buildasroot.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/pharos-validator/rpm/buildasroot.sh b/pharos-validator/rpm/buildasroot.sh
new file mode 100755
index 0000000..94076c2
--- /dev/null
+++ b/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/