~opensource-subakutty/ssh-askpass-keyring/ssh-askpass-keyring-0.2

« back to all changes in this revision

Viewing changes to debianize

  • Committer: Brandon Williams
  • Date: 2009-01-29 03:04:16 UTC
  • Revision ID: opensource@subakutty.net-20090129030416-p46kas3ighebje8v
add ubuntu packaging support

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
cleanup_exit()
 
4
{
 
5
    cd ..
 
6
    if [ -e ssh-askpass-keyring-$VERSION ]; then
 
7
        mv ssh-askpass-keyring-$VERSION source || exit 1
 
8
    fi
 
9
    if [ -e source/debian ]; then
 
10
        mv source/debian packaging/debian || exit 1
 
11
    fi
 
12
 
 
13
    exit $1
 
14
}
 
15
 
 
16
if [ $# != 1 ]; then
 
17
   echo "USAGE: $0 version" >&2
 
18
   exit 1
 
19
fi
 
20
 
 
21
VERSION=$1
 
22
 
 
23
missing=0
 
24
for file in PKG-INFO README setup.py; do
 
25
    if ! egrep -q "[Vv]ersion.*$VERSION" source/$file; then
 
26
        echo "Version number in source/$file does not match $VERSION" >&2
 
27
        missing=$(( missing + 1 ))
 
28
    fi
 
29
done
 
30
 
 
31
if ! egrep -q "ssh-askpass-keyring $VERSION" source/ChangeLog; then
 
32
    echo "Version number in source/ChangeLog does not match $VERSION" >&2
 
33
    missing=$(( missing + 1 ))
 
34
fi
 
35
 
 
36
if ! egrep -q "ssh-askpass-keyring \($VERSION" packaging/debian/changelog; then
 
37
    echo "Version number in packaging/debian/changelog does not match $VERSION" >&2
 
38
    missing=$(( missing + 1 ))
 
39
fi
 
40
 
 
41
if [ $missing -ne 0 ]; then
 
42
    exit 1
 
43
fi
 
44
 
 
45
if [ -e ssh-askpass-keyring-$VERSION ] || [ ! -e source ]; then
 
46
    echo "Expected directory source and no directory ssh-askpass-keyring-$VERSION" >&2
 
47
    exit 1
 
48
fi
 
49
 
 
50
mv source ssh-askpass-keyring-$VERSION || exit 1
 
51
 
 
52
cd ssh-askpass-keyring-$VERSION
 
53
./setup.py sdist || cleanup_exit 1
 
54
 
 
55
mv dist/ssh-askpass-keyring-$VERSION.tar.gz ../ssh-askpass-keyring_$VERSION.orig.tar.gz
 
56
 
 
57
if [ ! -e debian ]; then
 
58
    mv ../packaging/debian debian || cleanup_exit 1
 
59
fi
 
60
 
 
61
debuild || cleanup_exit 1
 
62
echo "Successfully built binary package for ssh-askpass-keyring-$VERSION."
 
63
printf "Press enter to continue ..."
 
64
read line
 
65
debuild -S || cleanup_exit 1
 
66
 
 
67
cleanup_exit 0