Add RPM build script

This commit adds a build script for creating openbmctool rpms.

Signed-off-by: Justin Thaler thalerj@us.ibm.com
diff --git a/thalerj/RPMbuildfiles/README b/thalerj/RPMbuildfiles/README
new file mode 100644
index 0000000..a260acd
--- /dev/null
+++ b/thalerj/RPMbuildfiles/README
@@ -0,0 +1,7 @@
+README for build script
+
+This script is used to simplify the build process for rpms. It must be run with root privileges. 
+simply run the script with the current directory structure. It will prompt the user for the version
+and the release number to use. It will then create a tarball for the rpm content
+and then build the rpm. Once complete the new rpm can be found in /tmp/openbmctool-{version-release)/
+directory.  
diff --git a/thalerj/RPMbuildfiles/buildOpenbmctool.sh b/thalerj/RPMbuildfiles/buildOpenbmctool.sh
new file mode 100644
index 0000000..6205fb9
--- /dev/null
+++ b/thalerj/RPMbuildfiles/buildOpenbmctool.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/bash
+echo "Version: ex 1.0"
+read version
+echo "Release: ex 4"
+read release
+mkdir -p /tmp/openbmctool-$version-$release
+rm -rf /tmp/openbmctool-$version-$release/*
+cp ../* /tmp/openbmctool-$version-$release
+tar -cvzf /root/rpmbuild/SOURCES/openbmctool-$version-$release.tgz -C /tmp openbmctool-$version-$release
+rpmbuild -ba --define "_version $version" --define "_release $release" /root/rpmbuild/SPECS/openbmctool.spec 
+cp /root/rpmbuild/RPMS/noarch/openbmctool-$version-$release.noarch.rpm /tmp/openbmctool-$version-$release/
+
diff --git a/thalerj/RPMbuildfiles/openbmctool.spec b/thalerj/RPMbuildfiles/openbmctool.spec
new file mode 100644
index 0000000..cbff322
--- /dev/null
+++ b/thalerj/RPMbuildfiles/openbmctool.spec
@@ -0,0 +1,58 @@
+# Copyright (c) 2017 International Business Machines.  All right reserved.
+%define _binaries_in_noarch_packages_terminate_build   0
+Summary: IBM OpenBMC tool
+Name: openbmctool
+Version: %{_version}
+Release: %{_release}
+License: BSD
+Group: System Environment/Base
+BuildArch: noarch
+URL: http://www.ibm.com/
+Source0: %{name}-%{version}-%{release}.tgz
+Prefix: /opt
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+
+Requires: python34 
+Requires: python34-requests
+
+#%if 0%{?_unitdir:1}
+#Requires(post): systemd-units
+#Requires(preun): systemd-units
+#Requires(postun): systemd-units
+#%endif
+
+# Turn off the brp-python-bytecompile script
+%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
+
+%description
+This package is to be applied to any linux machine that will be used to manage or interact with the IBM OpenBMC.
+It provides key functionality to easily work with the IBM OpenBMC RESTful API, making BMC management easy. 
+
+#%build
+#%{__make}
+%prep
+%setup -q -n %{name}-%{version}-%{release}
+
+%install
+#rm -rf $RPM_BUILD_ROOT
+export DESTDIR=$RPM_BUILD_ROOT/opt/ibm/ras
+mkdir -p $DESTDIR/bin
+#mkdir -p $DESTDIR/bin/ppc64le
+#mkdir -p $DESTDIR/etc
+mkdir -p $DESTDIR/lib
+#mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system
+cp openbmctool*.py $DESTDIR/bin
+cp *.json $DESTDIR/lib
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+#%defattr(-,root,root,-)
+%attr(775,root,root) /opt/ibm/ras/bin/openbmctool.py
+%attr(664,root,root)/opt/ibm/ras/lib/policyTable.json
+
+%post
+ln -s -f /opt/ibm/ras/bin/openbmctool.py /usr/bin/openbmctool
+%changelog