~jconti/recent-notifications/trunk

67 by Jason Conti
Adding quick bash script to build deb packages in dist/deb. Should be incorporated into setup.py eventually.
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"
125 by Jason Conti
Cleaned up lintian warnings when building a package and adding code to build packages for maverick.
6
ORIG="recent-notifications_${VERSION}.orig.tar.gz"
67 by Jason Conti
Adding quick bash script to build deb packages in dist/deb. Should be incorporated into setup.py eventually.
7
87.1.1 by Jason Conti
Adding a switch to build (unsigned) binary instead of (signed) source packages.
8
# Get command line arguments
9
BUILD_BINARY=0
92 by Jason Conti
Adding more switches to build-package.sh to control what should be built, attempting to allow automatic building of source packages for both karmic and lucid (using a bit of sed magic).
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
}
87.1.1 by Jason Conti
Adding a switch to build (unsigned) binary instead of (signed) source packages.
22
23
for ARG in $*
24
do
92 by Jason Conti
Adding more switches to build-package.sh to control what should be built, attempting to allow automatic building of source packages for both karmic and lucid (using a bit of sed magic).
25
  case "${ARG}" in
26
    "-b" | "--binary") BUILD_BINARY=1;;
27
    "-c" | "--clean" ) CLEAN=1;;
28
    "-h" | "--help"  ) PRINT_HELP=1;;
29
  esac
87.1.1 by Jason Conti
Adding a switch to build (unsigned) binary instead of (signed) source packages.
30
done
31
92 by Jason Conti
Adding more switches to build-package.sh to control what should be built, attempting to allow automatic building of source packages for both karmic and lucid (using a bit of sed magic).
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
67 by Jason Conti
Adding quick bash script to build deb packages in dist/deb. Should be incorporated into setup.py eventually.
46
mkdir -p "dist/deb"
47
48
echo "Building source distribution for ${SDIST}"
49
python setup.py sdist
110 by Jason Conti
Importing updated ru translation and new es translation.
50
rm "MANIFEST"
125 by Jason Conti
Cleaned up lintian warnings when building a package and adding code to build packages for maverick.
51
cd "dist"
52
tar xzf "${SDIST}"
53
rm -rf "${NAME}/debian"
54
tar czf "deb/${ORIG}" "${NAME}"
55
cd "deb"
67 by Jason Conti
Adding quick bash script to build deb packages in dist/deb. Should be incorporated into setup.py eventually.
56
57
echo "Unpacking source distribution in deb directory"
125 by Jason Conti
Cleaned up lintian warnings when building a package and adding code to build packages for maverick.
58
tar xzf "../${SDIST}"
67 by Jason Conti
Adding quick bash script to build deb packages in dist/deb. Should be incorporated into setup.py eventually.
59
cd "${NAME}"
60
125 by Jason Conti
Cleaned up lintian warnings when building a package and adding code to build packages for maverick.
61
export DEBUILD_LINTIAN=yes
62
export DEBUILD_LINTIAN_OPTS="-i -I --show-overrides"
63
67 by Jason Conti
Adding quick bash script to build deb packages in dist/deb. Should be incorporated into setup.py eventually.
64
echo "Building deb package"
87.1.1 by Jason Conti
Adding a switch to build (unsigned) binary instead of (signed) source packages.
65
if [ "${BUILD_BINARY}" -eq "1" ]
66
then
67
  dpkg-buildpackage -us -uc
68
else
125 by Jason Conti
Cleaned up lintian warnings when building a package and adding code to build packages for maverick.
69
  # Build the lucid source package
70
  #dpkg-buildpackage -S
126 by Jason Conti
Adding an experimental, hacked-together appindicator version of recent notifications. Currently adds an icon to the indicator applet showing the last 5 message summaries, and an inactive Show Message Window menu item.
71
  debuild -S
92 by Jason Conti
Adding more switches to build-package.sh to control what should be built, attempting to allow automatic building of source packages for both karmic and lucid (using a bit of sed magic).
72
  # Update the changelog for lucid
125 by Jason Conti
Cleaned up lintian warnings when building a package and adding code to build packages for maverick.
73
  sed -i -e 's/lucid/maverick/g' debian/changelog
74
  # Build the maverick source package
113 by Jason Conti
Adding new panel icons to better match the ubuntu humanity theme. Moved to lucid so removed the code to build karmic packages, since I can't test them at the moment.
75
  #dpkg-buildpackage -S
126 by Jason Conti
Adding an experimental, hacked-together appindicator version of recent notifications. Currently adds an icon to the indicator applet showing the last 5 message summaries, and an inactive Show Message Window menu item.
76
  debuild -S
87.1.1 by Jason Conti
Adding a switch to build (unsigned) binary instead of (signed) source packages.
77
fi