~harlowja/cloud-init/fix-auto-bool

« back to all changes in this revision

Viewing changes to packages/bddeb

  • Committer: Joshua Harlow
  • Date: 2012-06-25 19:28:59 UTC
  • mto: (559.2.405 cloud-init)
  • mto: This revision was merged to the branch mainline in revision 564.
  • Revision ID: harlowja@yahoo-inc.com-20120625192859-aol3z19tjxqa0gzj
1. Moving around the packages dir.
2. Adjusting the bddep shell script
3. Starting to add a brpm

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
 
1
#!/bin/sh 
 
2
 
 
3
# Ensure we can find the setup.py file which
 
4
# should be at the root of the cloud-init tree
 
5
PKG_DIR=`pwd`
 
6
ROOT="$PKG_DIR/../"
 
7
if [ ! -e "$ROOT/setup.py" ]; then
 
8
    echo "No setup.py found at $ROOT"
 
9
    exit 1
 
10
fi
 
11
echo "Using root directory $ROOT for building your debian package"
 
12
 
 
13
# Ensure tempdir is cleaned and ready to go
3
14
TEMP_D=$(mktemp -d "${TMPDIR:-/tmp}/${0##*/}.XXXXXXX")
4
 
#TEMP_D=/tmp/my.d
5
 
start=${PWD}
 
15
echo "With $TEMP_D as a temporary workspace"
6
16
rm -Rf "${TEMP_D}"; mkdir "${TEMP_D}"
7
17
set -e
8
 
trap "rm -Rf '${TEMP_D}'" exit
 
18
 
 
19
# Ensure tempdir removed if breaks...
 
20
trap "rm -Rf '${TEMP_D}'" EXIT SIGINT SIGTERM
 
21
 
 
22
# Go to the root and start making a package!
 
23
cd $ROOT
9
24
files=$(bzr ls --versioned)
10
25
revno=$(bzr revno)
11
26
version=$(awk -F: \
12
27
   '$1 ~ /[0-9][.][0-9]+[.][0-9]+/ { print $1 ; exit(0); }' ChangeLog )
 
28
 
 
29
# Ensure that the version found in 'Changelog' is the same in the python 
 
30
# cloud-init version directory
 
31
py_version=$(python -c 'from cloudinit import version; import sys; \
 
32
sys.stdout.write(version.version_string())')
 
33
 
 
34
# Canonicalize the changelog version
 
35
ch_version=$(python -c "from distutils import version; import sys; \
 
36
sys.stdout.write(str(version.StrictVersion('$version')));")
 
37
 
 
38
if [ "$py_version" != "$ch_version" ]; then
 
39
    echo "Cloud-init python version $py_version" \
 
40
         " != changelog version $ch_version"
 
41
    echo "Please ensure they are the same!"
 
42
    exit 1
 
43
fi
 
44
 
13
45
mkdir "${TEMP_D}/cloud-init"
14
46
otar="$TEMP_D/cloud-init_$version~bzr${revno}.orig.tar.gz"
15
47
tar -czf - ${files} > "$otar"
16
 
tar -C "${TEMP_D}/cloud-init" -xzf - <"$otar"
 
48
tar -C "${TEMP_D}/cloud-init" -xzf - < "$otar"
17
49
 
18
50
if [ ! -d "${TEMP_D}/cloud-init/debian" ]; then
19
 
   rsync -a debian.trunk/ "${TEMP_D}/cloud-init/debian"
 
51
   rsync -a $PKG_DIR/debian.trunk/ "${TEMP_D}/cloud-init/debian"
20
52
fi
 
53
 
21
54
sed -i -e "s,VERSION,$version," -e "s,REVNO,bzr$revno," \
22
 
   "$TEMP_D/cloud-init/debian/changelog"
 
55
          "$TEMP_D/cloud-init/debian/changelog"
 
56
 
23
57
cd "${TEMP_D}/cloud-init"
24
58
debuild "$@"
25
 
#for x in ../*.deb; do
26
 
#   echo wrote ${x##*/}
27
 
#done
28
59
debname="cloud-init_${version}~bzr${revno}-1_all.deb"
29
 
mv "../$debname" "$start"
30
 
link="$start/cloud-init_all.deb"
31
 
echo "wrote $debname"
32
 
[ ! -e "$link" -o -L "$link" ] 
33
 
   { ln -sf "$debname" "$link" && echo "linked ${link##*/}"; }
 
60
mv "../$debname" "$PKG_DIR"
 
61
echo "Wrote $debname to $PKG_DIR"
 
62