%define _current_dir %(echo $PWD)
%define _package_tar_dir %{_current_dir}/SOURCES
%define _package_dir /opt/nutanix-neo
%define _package_file nutanix-neo.tar.gz
%define _service_dir /etc/init.d
%define _service_file nutanix-neo
Name: nutanix-neo
Version: 0.1
Release: 0.1%{?dist}
Summary: Mellanox Nutanix-NEO plugin
License: BSD license
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Requires: python-requests
%description
Mellanox Nutanix-NEO plugin
%install
if [ `pip show web.py --disable-pip-version-check | wc -l` -eq 0 ];
then
echo 'python library "web.py" is required'
echo 'please run "pip install web.py"'
exit 1;
fi
install --directory $RPM_BUILD_ROOT%{_package_dir}
install -m 0644 %{_package_tar_dir}/%{_package_file} $RPM_BUILD_ROOT%{_package_dir}
%files
%attr(0644, root, root) %{_package_dir}/%{_package_file}
%post
tar -xzf %{_package_dir}/%{_package_file} -C %{_package_dir}
cp $RPM_BUILD_ROOT%{_package_dir}%{_service_dir}/%{_service_file} %{_service_dir}
chmod a+x %{_service_dir}/%{_service_file}
%clean
rm -rf $RPM_BUILD_ROOT
%postun
rm -rf %{_package_dir}
rm -rf %{_service_dir}/%{_service_file}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.