From 6d74afcd0e11de5cb56623d9121472e9212e8481 Mon Sep 17 00:00:00 2001
From: Joshua Harlow <harlowja@yahoo-inc.com>
Date: Mon, 25 Jun 2012 12:28:59 -0700
Subject: 1. Moving around the packages dir. 2. Adjusting the bddep shell
 script 3. Starting to add a brpm

---
 packages/bddeb                  | 62 +++++++++++++++++++++++++++++++++++++++++
 packages/brpm                   |  3 ++
 packages/debian.trunk/changelog |  5 ++++
 packages/debian.trunk/compat    |  1 +
 packages/debian.trunk/control   | 31 +++++++++++++++++++++
 packages/debian.trunk/copyright | 51 +++++++++++++++++++++++++++++++++
 packages/debian.trunk/dirs      |  5 ++++
 packages/debian.trunk/pycompat  |  1 +
 packages/debian.trunk/rules     | 28 +++++++++++++++++++
 packages/make-dist-tarball      | 25 +++++++++++++++++
 10 files changed, 212 insertions(+)
 create mode 100755 packages/bddeb
 create mode 100755 packages/brpm
 create mode 100644 packages/debian.trunk/changelog
 create mode 100644 packages/debian.trunk/compat
 create mode 100644 packages/debian.trunk/control
 create mode 100644 packages/debian.trunk/copyright
 create mode 100644 packages/debian.trunk/dirs
 create mode 100644 packages/debian.trunk/pycompat
 create mode 100755 packages/debian.trunk/rules
 create mode 100755 packages/make-dist-tarball

(limited to 'packages')

diff --git a/packages/bddeb b/packages/bddeb
new file mode 100755
index 00000000..74932985
--- /dev/null
+++ b/packages/bddeb
@@ -0,0 +1,62 @@
+#!/bin/sh 
+
+# Ensure we can find the setup.py file which
+# should be at the root of the cloud-init tree
+PKG_DIR=`pwd`
+ROOT="$PKG_DIR/../"
+if [ ! -e "$ROOT/setup.py" ]; then
+    echo "No setup.py found at $ROOT"
+    exit 1
+fi
+echo "Using root directory $ROOT for building your debian package"
+
+# Ensure tempdir is cleaned and ready to go
+TEMP_D=$(mktemp -d "${TMPDIR:-/tmp}/${0##*/}.XXXXXXX")
+echo "With $TEMP_D as a temporary workspace"
+rm -Rf "${TEMP_D}"; mkdir "${TEMP_D}"
+set -e
+
+# Ensure tempdir removed if breaks...
+trap "rm -Rf '${TEMP_D}'" EXIT SIGINT SIGTERM
+
+# Go to the root and start making a package!
+cd $ROOT
+files=$(bzr ls --versioned)
+revno=$(bzr revno)
+version=$(awk -F: \
+   '$1 ~ /[0-9][.][0-9]+[.][0-9]+/ { print $1 ; exit(0); }' ChangeLog )
+
+# Ensure that the version found in 'Changelog' is the same in the python 
+# cloud-init version directory
+py_version=$(python -c 'from cloudinit import version; import sys; \
+sys.stdout.write(version.version_string())')
+
+# Canonicalize the changelog version
+ch_version=$(python -c "from distutils import version; import sys; \
+sys.stdout.write(str(version.StrictVersion('$version')));")
+
+if [ "$py_version" != "$ch_version" ]; then
+    echo "Cloud-init python version $py_version" \
+         " != changelog version $ch_version"
+    echo "Please ensure they are the same!"
+    exit 1
+fi
+
+mkdir "${TEMP_D}/cloud-init"
+otar="$TEMP_D/cloud-init_$version~bzr${revno}.orig.tar.gz"
+tar -czf - ${files} > "$otar"
+tar -C "${TEMP_D}/cloud-init" -xzf - < "$otar"
+
+if [ ! -d "${TEMP_D}/cloud-init/debian" ]; then
+   rsync -a $PKG_DIR/debian.trunk/ "${TEMP_D}/cloud-init/debian"
+fi
+
+sed -i -e "s,VERSION,$version," -e "s,REVNO,bzr$revno," \
+          "$TEMP_D/cloud-init/debian/changelog"
+
+cd "${TEMP_D}/cloud-init"
+debuild "$@"
+debname="cloud-init_${version}~bzr${revno}-1_all.deb"
+mv "../$debname" "$PKG_DIR"
+echo "Wrote $debname to $PKG_DIR"
+
diff --git a/packages/brpm b/packages/brpm
new file mode 100755
index 00000000..829303ea
--- /dev/null
+++ b/packages/brpm
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+
diff --git a/packages/debian.trunk/changelog b/packages/debian.trunk/changelog
new file mode 100644
index 00000000..a36d00d6
--- /dev/null
+++ b/packages/debian.trunk/changelog
@@ -0,0 +1,5 @@
+cloud-init (VERSION~REVNO-1) UNRELEASED; urgency=low
+
+  * build
+
+ -- Scott Moser <smoser@ubuntu.com>  Fri, 16 Dec 2011 11:50:25 -0500
diff --git a/packages/debian.trunk/compat b/packages/debian.trunk/compat
new file mode 100644
index 00000000..7ed6ff82
--- /dev/null
+++ b/packages/debian.trunk/compat
@@ -0,0 +1 @@
+5
diff --git a/packages/debian.trunk/control b/packages/debian.trunk/control
new file mode 100644
index 00000000..f0dcef6a
--- /dev/null
+++ b/packages/debian.trunk/control
@@ -0,0 +1,31 @@
+Source: cloud-init
+Section: admin
+Priority: extra
+Maintainer: Scott Moser <smoser@ubuntu.com>
+Build-Depends: cdbs, 
+               debhelper (>= 5.0.38), 
+               python (>= 2.6.6-3~),
+               python-nose,
+               pyflakes,
+               pylint,
+               python-mocker,
+XS-Python-Version: all
+Standards-Version: 3.9.3
+
+Package: cloud-init
+Architecture: all
+Depends: cloud-utils,
+         procps,
+         python,
+         python-boto (>=2.0),
+         python-cheetah,
+         python-configobj,
+         python-oauth,
+         python-software-properties,
+         python-yaml,
+         ${misc:Depends},
+         ${python:Depends}
+XB-Python-Version: ${python:Versions}
+Description: Init scripts for cloud instances
+ Cloud instances need special scripts to run during initialisation
+ to retrieve and install ssh keys and to let the user run various scripts.
diff --git a/packages/debian.trunk/copyright b/packages/debian.trunk/copyright
new file mode 100644
index 00000000..dc993525
--- /dev/null
+++ b/packages/debian.trunk/copyright
@@ -0,0 +1,51 @@
+Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
+Name: cloud-init
+Maintainer: Scott Moser <scott.moser@canonical.com>
+Source: https://launchpad.net/cloud-init
+
+This package was debianized by Soren Hansen <soren@ubuntu.com> on
+Thu, 04 Sep 2008 12:49:15 +0200 as ec2-init.  It was later renamed to
+cloud-utils by Scott Moser <scott.moser@canonical.com>
+
+Upstream Author: Scott Moser <smoser@canonical.com>
+    Soren Hansen <soren@canonical.com>
+    Chuck Short <chuck.short@canonical.com>
+
+Copyright: 2010, Canonical Ltd. 
+License: GPL-3
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License version 3, as
+ published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+ The complete text of the GPL version 3 can be seen in
+ /usr/share/common-licenses/GPL-3.
+
+Files: cloudinit/boto_utils.py
+Copyright: 2006,2007, Mitch Garnaat http://garnaat.org/
+License: MIT
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish, dis-
+ tribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the fol-
+ lowing conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+ ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+ SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ IN THE SOFTWARE.
diff --git a/packages/debian.trunk/dirs b/packages/debian.trunk/dirs
new file mode 100644
index 00000000..f3de468d
--- /dev/null
+++ b/packages/debian.trunk/dirs
@@ -0,0 +1,5 @@
+var/lib/cloud
+usr/bin
+etc/init
+usr/share/doc/cloud
+etc/cloud
diff --git a/packages/debian.trunk/pycompat b/packages/debian.trunk/pycompat
new file mode 100644
index 00000000..0cfbf088
--- /dev/null
+++ b/packages/debian.trunk/pycompat
@@ -0,0 +1 @@
+2
diff --git a/packages/debian.trunk/rules b/packages/debian.trunk/rules
new file mode 100755
index 00000000..0f79136c
--- /dev/null
+++ b/packages/debian.trunk/rules
@@ -0,0 +1,28 @@
+#!/usr/bin/make -f
+
+DEB_PYTHON2_MODULE_PACKAGES = cloud-init
+
+binary-install/cloud-init::cloud-init-fixups
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/python-distutils.mk
+
+DEB_DH_INSTALL_SOURCEDIR := debian/tmp
+
+cloud-init-fixups:
+	for x in $(DEB_DESTDIR)/usr/bin/*.py; do mv "$$x" "$${x%.py}"; done
+	install -d $(DEB_DESTDIR)/etc/rsyslog.d
+	cp tools/21-cloudinit.conf $(DEB_DESTDIR)/etc/rsyslog.d/21-cloudinit.conf
+
+# You only need to run this immediately after checking out the package from
+# revision control.
+# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572204
+quilt-setup:
+	@[ ! -d .pc ] || { echo ".pc exists. remove it and re-run to start fresh"; exit 1; }
+	set -e; for patch in $$(quilt series | tac); do \
+		patch -p1 -R --no-backup-if-mismatch <"debian/patches/$$patch"; \
+	done
+	quilt push -a
+
+.PHONY: quilt-setup
+
diff --git a/packages/make-dist-tarball b/packages/make-dist-tarball
new file mode 100755
index 00000000..622283bd
--- /dev/null
+++ b/packages/make-dist-tarball
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+Usage() {
+   cat <<EOF
+Usage: ${0##*/} version
+   make a tarball of 'version'
+   must be in a bzr directory, and 'version' must be a tag
+
+EOF
+}
+
+topdir="../$PWD"
+tag=${1}
+
+[ -n "$tag" ] || { Usage 1>&2 ; exit 1; }
+
+tmpd=$(mktemp -d ); 
+trap "rm -Rf '${tmpd}'" 0
+
+out=${topdir}/cloud-init-${tag}.tar.gz
+
+cd ${tmpd} && 
+   bzr branch -r "tag:${tag}" "${topdir}" ./cloud-init-${tag} &&
+   tar czf "${out}" cloud-init-${tag}/ --exclude cloud-init-${tag}/.bzr &&
+   echo "Wrote ${out}"
-- 
cgit v1.2.3