~jconti/recent-notifications/trunk

« back to all changes in this revision

Viewing changes to scripts/build-package.sh

  • Committer: Jason Conti
  • Date: 2011-05-18 21:17:09 UTC
  • Revision ID: jason.conti@gmail.com-20110518211709-inr5d289rvcabeor
Removing the indicator directory. indicator-notifications is now hosted at lp:recent-notifications/indicator. Also cleaned up the root directory a bit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
VERSION=`python -c "from recent_notifications.Globals import VERSION; print VERSION"`
 
4
NAME="recent-notifications-${VERSION}"
 
5
SDIST="${NAME}.tar.gz"
 
6
ORIG="recent-notifications_${VERSION}.orig.tar.gz"
 
7
 
 
8
# Get command line arguments
 
9
BUILD_BINARY=0
 
10
CLEAN=0
 
11
PRINT_HELP=0
 
12
 
 
13
usage () {
 
14
  echo "usage: build-package.sh [options]"
 
15
  echo ""
 
16
  echo "Options:"
 
17
  echo "-b, --binary  only build an unsigned binary package"
 
18
  echo "-c, --clean   delete everything in the dist directory"
 
19
  echo "-h, --help    print this help message and exit"
 
20
  echo ""
 
21
}
 
22
 
 
23
for ARG in $*
 
24
do
 
25
  case "${ARG}" in
 
26
    "-b" | "--binary") BUILD_BINARY=1;;
 
27
    "-c" | "--clean" ) CLEAN=1;;
 
28
    "-h" | "--help"  ) PRINT_HELP=1;;
 
29
  esac
 
30
done
 
31
 
 
32
# Print the usage and exit
 
33
if [ "${PRINT_HELP}" -eq "1" ]
 
34
then
 
35
  usage
 
36
  exit
 
37
fi
 
38
 
 
39
# Clean the dist directory
 
40
if [ "${CLEAN}" -eq "1" ]
 
41
then
 
42
  echo "Cleaning the dist directory"
 
43
  rm -rf dist/*
 
44
fi
 
45
 
 
46
mkdir -p "dist/deb"
 
47
 
 
48
echo "Building source distribution for ${SDIST}"
 
49
python setup.py sdist
 
50
rm "MANIFEST"
 
51
cd "dist"
 
52
tar xzf "${SDIST}"
 
53
rm -rf "${NAME}/debian"
 
54
tar czf "deb/${ORIG}" "${NAME}"
 
55
cd "deb"
 
56
 
 
57
echo "Unpacking source distribution in deb directory"
 
58
tar xzf "../${SDIST}"
 
59
cd "${NAME}"
 
60
 
 
61
export DEBUILD_LINTIAN=yes
 
62
export DEBUILD_LINTIAN_OPTS="-i -I --show-overrides"
 
63
 
 
64
echo "Building deb package"
 
65
if [ "${BUILD_BINARY}" -eq "1" ]
 
66
then
 
67
  dpkg-buildpackage -us -uc
 
68
else
 
69
  # Build the lucid source package
 
70
  #dpkg-buildpackage -S
 
71
  debuild -S
 
72
  # Update the changelog for lucid
 
73
  sed -i -e 's/lucid/maverick/g' debian/changelog
 
74
  # Build the maverick source package
 
75
  #dpkg-buildpackage -S
 
76
  debuild -S
 
77
fi