acceptance/lib/puppet/acceptance/rpm_util.rb
# Utilities for creating a basic rpm package and using it in tests
Utilities for creating a basic rpm package and using it in tests
Utilities for creating a basic rpm package and using it in tests
def send_rpm(agent, o={})
        setup(agent)
        o = @@defaults.merge(o)
        on agent, "mkdir -p #{o[:repo]}/#{o[:pkg]}-#{o[:version]}/usr/bin"
        on agent, "cat <<EOF > #{o[:repo]}/#{o[:pkg]}
#!/bin/bash
echo Hello World
EOF
"
        pkg_name = "#{o[:pkg]}-#{o[:version]}"
        on agent, "install -m 755 #{o[:repo]}/#{o[:pkg]} #{o[:repo]}/#{pkg_name}/usr/bin"
        on agent, "tar -zcvf #{o[:repo]}/SOURCES/#{pkg_name}.tar.gz -C #{o[:repo]} #{pkg_name}"
        on agent, "cat <<EOF > #{o[:repo]}/SPECS/#{o[:pkg]}.spec
# Don't try fancy stuff like debuginfo, which is useless on binary-only packages. Don't strip binary too
# Be sure buildpolicy set to do nothing
%define        __spec_install_post %{nil}
%define          debug_package %{nil}
%define        __os_install_post %{_dbpath}/brp-compress
Summary: A very simple toy bin rpm package
Name: #{o[:pkg]}
Version: #{o[:version]}
Release: 1
License: GPL+
Group: Development/Tools
SOURCE0 : %{name}-%{version}.tar.gz
URL: http://www.puppetlabs.com/
BuildRoot: %{_topdir}/BUILD/%{name}-%{version}-%{release}-root
%description
%{summary}
%prep
%setup -q
%build
# Empty section.
%install
rm -rf %{buildroot}
mkdir -p  %{buildroot}
# in builddir
cp -a * %{buildroot}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%{_bindir}/*
%changelog
* Mon Dec 01 2014  Michael Smith <michael.smith@puppetlabs.com> #{o[:version]}-1
- First Build
EOF
"
        on agent, "rpmbuild -ba #{o[:repo]}/SPECS/#{o[:pkg]}.spec"
        on agent, "createrepo --update #{o[:repo]}"
      end
def send_rpm ( agent , o = { } ) setup ( agent ) o = @@defaults . merge ( o ) on agent , "mkdir -p #{o[:repo]}/#{o[:pkg]}-#{o[:version]}/usr/bin" on agent , "cat <<EOF > #{o[:repo]}/#{o[:pkg]}
#!/bin/bash
echo Hello World
EOF
" pkg_name = "#{o[:pkg]}-#{o[:version]}" on agent , "install -m 755 #{o[:repo]}/#{o[:pkg]} #{o[:repo]}/#{pkg_name}/usr/bin" on agent , "tar -zcvf #{o[:repo]}/SOURCES/#{pkg_name}.tar.gz -C #{o[:repo]} #{pkg_name}" on agent , "cat <<EOF > #{o[:repo]}/SPECS/#{o[:pkg]}.spec
# Don't try fancy stuff like debuginfo, which is useless on binary-only packages. Don't strip binary too
# Be sure buildpolicy set to do nothing
%define        __spec_install_post %{nil}
%define          debug_package %{nil}
%define        __os_install_post %{_dbpath}/brp-compress

Summary: A very simple toy bin rpm package
Name: #{o[:pkg]}
Version: #{o[:version]}
Release: 1
License: GPL+
Group: Development/Tools
SOURCE0 : %{name}-%{version}.tar.gz
URL: http://www.puppetlabs.com/

BuildRoot: %{_topdir}/BUILD/%{name}-%{version}-%{release}-root

%description
%{summary}

%prep
%setup -q

%build
# Empty section.

%install
rm -rf %{buildroot}
mkdir -p  %{buildroot}

# in builddir
cp -a * %{buildroot}


%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%{_bindir}/*

%changelog
* Mon Dec 01 2014  Michael Smith <michael.smith@puppetlabs.com> #{o[:version]}-1
- First Build

EOF
" on agent , "rpmbuild -ba #{o[:repo]}/SPECS/#{o[:pkg]}.spec" on agent , "createrepo --update #{o[:repo]}" end
Utilities for creating a basic rpm package and using it in tests
Utilities for creating a basic rpm package and using it in tests
agent
<not_specific>
o
<not_specific>