From 3f4185fa60379e89c092665a7a85a825b81cc7d2 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 4 Oct 2016 14:48:29 -0400 Subject: [PATCH] Add script to help build rpms setup.py bdist_rpm is not very good. Instead, provide a script to create an rpm. Change-Id: If6773ee4938e981a14c38e4e4eabad6b5cb2b6ae --- buildrpm | 7 +++++++ python-pyghmi.spec | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 buildrpm create mode 100644 python-pyghmi.spec diff --git a/buildrpm b/buildrpm new file mode 100644 index 00000000..6cc5cdbc --- /dev/null +++ b/buildrpm @@ -0,0 +1,7 @@ +cd `dirname $0` +VERSION=`python setup.py --version` +python setup.py sdist +cp dist/pyghmi-$VERSION.tar.gz ~/rpmbuild/SOURCES +rpmbuild -bs python-pyghmi.spec +rm $1/python-pyghmi-*rpm +cp ~/rpmbuild/SRPMS/python-pyghmi-$VERSION-1.src.rpm $1/ diff --git a/python-pyghmi.spec b/python-pyghmi.spec new file mode 100644 index 00000000..4f6bab4d --- /dev/null +++ b/python-pyghmi.spec @@ -0,0 +1,37 @@ +Summary: Python General Hardware Management Initiative (IPMI and others) +Name: python-pyghmi +Version: %{?version:%{version}}%{!?version:%(python setup.py --version)} +Release: %{?release:%{release}}%{!?release:1} +Source0: pyghmi-%{version}.tar.gz +License: Apache License, Version 2.0 +Group: Development/Libraries +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot +Prefix: %{_prefix} +BuildArch: noarch +Vendor: Jarrod Johnson +Url: https://git.openstack.org/cgit/openstack/pyghmi + + +%description +This is a pure python implementation of IPMI protocol. + +pyghmicons and pyghmiutil are example scripts to show how one may incorporate +this library into python code + + + +%prep +%setup -n pyghmi-%{version} + +%build +python setup.py build + +%install +python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES --prefix=/usr + +%clean +rm -rf $RPM_BUILD_ROOT + +%files -f INSTALLED_FILES +%defattr(-,root,root) +