dd46d15
# Disable the growpart subpackage in EPEL, as RHEL ships it on its own
dd46d15
%if 0%{?epel}
dd46d15
%bcond_with growpart
dd46d15
%else
dd46d15
%bcond_without growpart
dd46d15
%endif
dd46d15
a9a20d0
Summary:	Cloud image management utilities
a9a20d0
Name:		cloud-utils
97581c1
Version:	0.33
13aacd8
Release:	%autorelease
6744a39
License:	GPL-3.0-only
97581c1
URL:		https://github.com/canonical/%{name}
a9a20d0
97581c1
Source:		%{url}/archive/%{version}/%{name}-%{version}.tar.gz
a9a20d0
a9a20d0
BuildArch:	noarch
a9a20d0
5ac25ec
Requires:	%{name}-growpart
e569868
Requires:	%{name}-cloud-localds
e569868
Requires:	%{name}-write-mime-multipart
e569868
Requires:	%{name}-ec2metadata
e569868
Requires:	%{name}-resize-part-image
e569868
Requires:	%{name}-mount-image-callback
e569868
Requires:	%{name}-vcs-run
a9a20d0
a9a20d0
%description
a9a20d0
This package provides a useful set of utilities for managing cloud images.
a9a20d0
a9a20d0
The tasks associated with image bundling are often tedious and repetitive. The
a9a20d0
cloud-utils package provides several scripts that wrap the complicated tasks
a9a20d0
with a much simpler interface.
a9a20d0
a9a20d0
dd46d15
%if %{with growpart}
2e4dd41
%package growpart
e569868
Summary:	A script for growing a partition
2e4dd41
2e4dd41
Requires:	gawk
f75aa9d
Requires:	util-linux
cdc44f5
# gdisk is only required for resizing GPT partitions and depends on libicu
cdc44f5
# (25MB). We don't make this a hard requirement to save some space in non-GPT
cdc44f5
# systems.
dfbec48
Recommends:	gdisk
f75aa9d
Recommends:	lvm2
2e4dd41
2e4dd41
2e4dd41
%description growpart
2e4dd41
This package provides the growpart script for growing a partition. It is
2e4dd41
primarily used in cloud images in conjunction with the dracut-modules-growroot
2e4dd41
package to grow the root partition on first boot.
dd46d15
%endif
2e4dd41
2e4dd41
e569868
%package cloud-localds
e569868
Summary:	A script for creating a nocloud configuration disk for cloud-init
e569868
e569868
Recommends:	tar
e569868
Recommends:	dosfstools
e569868
Recommends:	mtools
e569868
Recommends:	genisoimage
e569868
Recommends:	qemu-img
e569868
e569868
e569868
%description cloud-localds
e569868
This package provides the cloud-localds script, which creates a disk-image
e569868
with user-data and/or meta-data for cloud-init.
e569868
e569868
e569868
%package write-mime-multipart
e569868
Summary:	A utilty for creating mime-multipart files
e569868
e569868
e569868
%description write-mime-multipart
e569868
This package provides the write-mime-multipart script, which creates
e569868
mime multipart files that can be consumed by cloud-init as user-data.
e569868
e569868
e569868
%package ec2metadata
e569868
Summary:	A script to query and display EC2 AMI instance metadata
e569868
e569868
e569868
%description ec2metadata
e569868
This package provides the ec2metadata script, which can be used to query and
e569868
display EC2 instance metadata rekated to an AMI instance.
e569868
e569868
e569868
%package resize-part-image
e569868
Summary:	A script for resizing cloud images
e569868
e569868
Requires:	file
e569868
Requires:	gzip
e569868
Requires:	e2fsprogs
e569868
Requires:	gawk
e569868
Requires:	tar
e569868
e569868
e569868
%description resize-part-image
e569868
This package provides the resize-part-image script, which can be used to
e569868
resize a partition image and the contained filesystem to a new size.
e569868
e569868
e569868
%package mount-image-callback
e569868
Summary:	A script to run commands over cloud image contents
e569868
e569868
Requires:	gawk
e569868
Requires:	util-linux
e569868
Recommends:	qemu-img
e569868
e569868
e569868
%description mount-image-callback
e569868
This package provides the mount-image-callback script, which mounts a cloud
e569868
image to a temporary mountpoint and runs a specified command on the contents.
e569868
e569868
e569868
%package vcs-run
e569868
Summary:	Script to run commands over a VCS repository contents
e569868
e569868
Recommends:	breezy
e569868
Recommends:	git-core
e569868
Recommends:	mercurial
e569868
Recommends:	wget
e569868
e569868
e569868
%description vcs-run
e569868
This package provides the vcs-run script, which fetches a code repository
e569868
into a temporary directory and runs a user-specified command in it.
e569868
e569868
a9a20d0
%prep
11b4602
%setup -q
a9a20d0
a9a20d0
%build
a9a20d0
a9a20d0
%install
a9a20d0
b54a90e
# Create the target directories
089f936
install -d %{buildroot}%{_bindir}
089f936
install -d %{buildroot}%{_mandir}/man1
b54a90e
b54a90e
# Install binaries and manpages
089f936
install -pm 0755 bin/* %{buildroot}%{_bindir}/
089f936
install -pm 0644 man/* %{buildroot}%{_mandir}/man1/
b54a90e
a9a20d0
# Exclude Ubuntu-specific tools
bf66d96
rm %{buildroot}%{_bindir}/*ubuntu*
f3d1617
f3d1617
# Exclude the cloud-run-instances manpage
bf66d96
rm -f %{buildroot}%{_mandir}/man1/cloud-run-instances.*
356b145
356b145
# Exclude euca2ools wrappers and manpages
bf66d96
rm -f %{buildroot}%{_bindir}/cloud-publish-*
bf66d96
rm -f %{buildroot}%{_mandir}/man1/cloud-publish-*
a9a20d0
dd46d15
%if %{without growpart}
dd46d15
rm -f %{buildroot}%{_bindir}/growpart
dd46d15
rm -f %{buildroot}%{_mandir}/man1/growpart.*
dd46d15
%endif
dd46d15
a9a20d0
a9a20d0
%files
5140ddb
%doc ChangeLog
5140ddb
%license LICENSE
e569868
e569868
dd46d15
%if %{with growpart}
e569868
%files growpart
e569868
%doc ChangeLog
e569868
%license LICENSE
e569868
%{_bindir}/growpart
e569868
%doc %{_mandir}/man1/growpart.*
dd46d15
%endif
e569868
e569868
e569868
%files cloud-localds
e569868
%doc ChangeLog
e569868
%license LICENSE
2e4dd41
%{_bindir}/cloud-localds
e569868
%doc %{_mandir}/man1/cloud-localds.*
e569868
e569868
e569868
%files write-mime-multipart
e569868
%doc ChangeLog
e569868
%license LICENSE
2e4dd41
%{_bindir}/write-mime-multipart
e569868
%doc %{_mandir}/man1/write-mime-multipart.*
e569868
e569868
e569868
%files ec2metadata
e569868
%doc ChangeLog
e569868
%license LICENSE
2e4dd41
%{_bindir}/ec2metadata
e569868
e569868
e569868
%files resize-part-image
e569868
%doc ChangeLog
e569868
%license LICENSE
2e4dd41
%{_bindir}/resize-part-image
2e4dd41
%doc %{_mandir}/man1/resize-part-image.*
2e4dd41
2e4dd41
e569868
%files mount-image-callback
5140ddb
%doc ChangeLog
5140ddb
%license LICENSE
e569868
%{_bindir}/mount-image-callback
e569868
e569868
e569868
%files vcs-run
e569868
%doc ChangeLog
e569868
%license LICENSE
e569868
%{_bindir}/vcs-run
a9a20d0
a9a20d0
a9a20d0
%changelog
13aacd8
%autochangelog