/
cloud-utils.spec
81 lines (67 loc) · 2.14 KB
/
cloud-utils.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Summary: Cloud image management utilities
Name: cloud-utils
Version: 0.33
Release: 3
License: GPLv3
URL: https://github.com/canonical/cloud-utils
Source0: https://github.com/canonical/cloud-utils/archive/refs/tags/%{version}.tar.gz
BuildArch: noarch
Requires: growpart
Requires: gawk
Requires: e2fsprogs
Requires: file
Requires: python
Requires: qemu-img
Requires: util-linux
%description
This package provides a useful set of utilities for managing cloud images.
The tasks associated with image bundling are often tedious and repetitive. The
cloud-utils package provides several scripts that wrap the complicated tasks
with a much simpler interface.
%package -n growpart
Summary: Script for growing a partition
Requires: gawk
Requires: gptfdisk
Requires: util-linux
%rename %{name}-growpart
%description -n growpart
This package provides the growpart script for growing a partition. It is
primarily used in cloud images and development boards where an image has
to be DD-ed to an SD card to grow the root or home partition on first boot.
%prep
%autosetup -p1
%build
%install
# Create the target directories
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1
# Install binaries and manpages
cp bin/* $RPM_BUILD_ROOT/%{_bindir}/
cp man/* $RPM_BUILD_ROOT/%{_mandir}/man1/
# Exclude Ubuntu-specific tools
rm $RPM_BUILD_ROOT/%{_bindir}/*ubuntu*
# Exclude the cloud-run-instances manpage
rm -f $RPM_BUILD_ROOT/%{_mandir}/man1/cloud-run-instances.*
# Exclude euca2ools wrappers and manpages
rm -f $RPM_BUILD_ROOT/%{_bindir}/cloud-publish-*
rm -f $RPM_BUILD_ROOT/%{_mandir}/man1/cloud-publish-*
# Install the growpart binary and man page
cp bin/growpart $RPM_BUILD_ROOT/%{_bindir}/
cp man/growpart.* $RPM_BUILD_ROOT/%{_mandir}/man1/
%files
%doc ChangeLog
%license LICENSE
%{_bindir}/cloud-localds
%{_bindir}/write-mime-multipart
%{_bindir}/ec2metadata
%{_bindir}/resize-part-image
%{_bindir}/mount-image-callback
%{_bindir}/vcs-run
%doc %{_mandir}/man1/resize-part-image.*
%doc %{_mandir}/man1/write-mime-multipart.*
%doc %{_mandir}/man1/cloud-localds.*
%files -n growpart
%doc ChangeLog
%license LICENSE
%{_bindir}/growpart
%doc %{_mandir}/man1/growpart.*