From e54b2468122528660e37d77cf0f81155bc612f66 Mon Sep 17 00:00:00 2001
From: Juerg Haefliger <juerg.haefliger@hp.com>
Date: Thu, 8 May 2014 09:51:55 +0200
Subject: [PATCH 3/3] Split the package into two sub-packages

The cloud-utils scripts have a lot of dependencies some of which are
undesirable for guest images (size matters). Putting the guest tools
(primarily growpart) into its own sub-package significantly reduces the
dependencies pulled into a guest image. All the other tools go into
another sub-package.

And this commit also removes the following Ubuntu-specific scripts
from the package:
- cloud-publish-ubuntu
- ubuntu-cloudimg-query
- ubuntu-ec2-run
---
 debian/changelog                 |  2 ++
 debian/cloud-utils-guest.install |  3 +++
 debian/cloud-utils-image.install | 11 +++++++++
 debian/cloud-utils-image.links   |  8 +++++++
 debian/cloud-utils.links         |  8 -------
 debian/control                   | 52 ++++++++++++++++++++++++----------------
 6 files changed, 56 insertions(+), 28 deletions(-)
 create mode 100644 debian/cloud-utils-guest.install
 create mode 100644 debian/cloud-utils-image.install
 create mode 100644 debian/cloud-utils-image.links
 delete mode 100644 debian/cloud-utils.links

diff --git a/debian/changelog b/debian/changelog
index 95a68bd..d6ae3a8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
 cloud-utils (0.27-1) unstable; urgency=low
 
   * Rebase to upstream version 0.27
+  * Split the package into two sub-packages
+  * Remove Ubuntu-specific scripts
 
  -- Juerg Haefliger <juerg.haefliger@hp.com>  Wed, 07 May 2014 14:32:13 +0200
 
diff --git a/debian/cloud-utils-guest.install b/debian/cloud-utils-guest.install
new file mode 100644
index 0000000..ecc8e2c
--- /dev/null
+++ b/debian/cloud-utils-guest.install
@@ -0,0 +1,3 @@
+usr/bin/ec2metadata
+usr/bin/growpart
+usr/share/man/*/growpart*
diff --git a/debian/cloud-utils-image.install b/debian/cloud-utils-image.install
new file mode 100644
index 0000000..1438807
--- /dev/null
+++ b/debian/cloud-utils-image.install
@@ -0,0 +1,11 @@
+usr/bin/cloud-localds
+usr/bin/cloud-publish-image
+usr/bin/cloud-publish-tarball
+usr/bin/cloud-run-instances
+usr/bin/resize-part-image
+usr/bin/write-mime-multipart
+usr/share/man/*/cloud-publish-image.*
+usr/share/man/*/cloud-publish-tarball.*
+usr/share/man/*/cloud-run-instances.*
+usr/share/man/*/resize-part-image.*
+usr/share/man/*/write-mime-multipart.*
diff --git a/debian/cloud-utils-image.links b/debian/cloud-utils-image.links
new file mode 100644
index 0000000..dd6b34f
--- /dev/null
+++ b/debian/cloud-utils-image.links
@@ -0,0 +1,8 @@
+usr/bin/cloud-publish-tarball usr/bin/uec-publish-tarball 
+usr/bin/cloud-publish-image usr/bin/uec-publish-image
+usr/bin/cloud-run-instances usr/bin/uec-run-instances
+usr/bin/resize-part-image usr/bin/uec-resize-image
+usr/share/man/man1/cloud-publish-tarball.1 usr/share/man/man1/uec-publish-tarball.1
+usr/share/man/man1/cloud-publish-image.1 usr/share/man/man1/uec-publish-image.1
+usr/share/man/man1/cloud-run-instances.1 usr/share/man/man1/uec-run-instances.1
+usr/share/man/man1/resize-part-image.1 usr/share/man/man1/uec-resize-image.1
diff --git a/debian/cloud-utils.links b/debian/cloud-utils.links
deleted file mode 100644
index dd6b34f..0000000
--- a/debian/cloud-utils.links
+++ /dev/null
@@ -1,8 +0,0 @@
-usr/bin/cloud-publish-tarball usr/bin/uec-publish-tarball 
-usr/bin/cloud-publish-image usr/bin/uec-publish-image
-usr/bin/cloud-run-instances usr/bin/uec-run-instances
-usr/bin/resize-part-image usr/bin/uec-resize-image
-usr/share/man/man1/cloud-publish-tarball.1 usr/share/man/man1/uec-publish-tarball.1
-usr/share/man/man1/cloud-publish-image.1 usr/share/man/man1/uec-publish-image.1
-usr/share/man/man1/cloud-run-instances.1 usr/share/man/man1/uec-run-instances.1
-usr/share/man/man1/resize-part-image.1 usr/share/man/man1/uec-resize-image.1
diff --git a/debian/control b/debian/control
index c937c4b..3266f1b 100644
--- a/debian/control
+++ b/debian/control
@@ -4,34 +4,46 @@ Priority: extra
 Maintainer: Debian Cloud <debian-cloud@lists.debian.org>
 Uploaders: Julien Danjou <acid@debian.org>, Thomas Goirand <zigo@debian.org>
 Build-Depends: debhelper (>= 7.0.50~), python
-Standards-Version: 3.9.3
+Standards-Version: 3.9.4
 Vcs-Git: git://anonscm.debian.org/git/collab-maint/cloud-utils.git
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/cloud-utils.git
 
 Package: cloud-utils
 Architecture: all
+Depends: cloud-utils-guest,
+         cloud-utils-image,
+         ${misc:Depends}
+Description: metapackage for installation of upstream cloud-utils source
+ This meta-package will depend on all sub-packages built by the
+ upstream cloud-utils source.
+
+Package: cloud-utils-guest
+Architecture: all
+Depends: e2fsprogs (>=1.4),
+         util-linux (>= 2.17.2),
+         ${misc:Depends},
+         ${python:Depends}
+Recommends: gdisk
+Conflicts: cloud-utils (<< 0.27-1)
+Replaces: cloud-utils (<< 0.27-1)
+Description: cloud guest utilities
+ This package contains programs useful inside cloud instances.
+ It contains 'growpart' for resizing a partition during boot.
+
+Package: cloud-utils-image
+Architecture: all
 Depends: ca-certificates,
-         e2fsprogs (>=1.4),
          euca2ools,
          file,
-         gnupg,
-         python,
-         python-paramiko,
-         python-yaml,
-         util-linux (>= 2.17.2),
+         genisoimage,
+         qemu-utils,
          wget,
-         ${misc:Depends}
-Recommends: distro-info, python-distro-info, gdisk
-Suggests: mtools
+         ${misc:Depends},
+         ${python:Depends}
+Conflicts: cloud-utils (<< 0.27-1)
+Replaces: cloud-utils (<< 0.27-1)
+Recommends: distro-info, python-distro-info
 Description: cloud image management utilities
  This package provides a useful set of utilities for managing cloud
- images.
- .
- The euca2ools package (a dependency of cloud-utils) provides an
- Amazon EC2 API compatible set of utilities for bundling kernels,
- ramdisks, and root filesystems, and uploading them to either EC2
- or UEC.
- .
- 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.
+ images.  It contains tools to help in publishing and modifying
+ cloud images, and querying data related to cloud-images.
-- 
1.8.3.2

