-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakedeb
executable file
·47 lines (40 loc) · 1.31 KB
/
makedeb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash -e
#
# This script uses Debhelper to build the endroid Debian package and
# optionally install it
#
# Find the location of this script
CURRENT_LOCATION="$( cd $( dirname "$0" ) && pwd )"
#
# Work out what the resulting deb file will be called
# Why doesn't debuild just have an output argument!!!
#
ENDROID_VERSION=`dpkg-parsechangelog --show-field Version`
ENDROID_DEB_FILE="endroid_${ENDROID_VERSION}_all.deb"
ENDROID_DEB="../${ENDROID_DEB_FILE}"
# Delete the file if it exists
stat ${ENDROID_DEB} || true
rm ${ENDROID_DEB} || true
# Call debuild with the following options:
# -uc -us : Don't attempt to sign anything
# -tc : Clean the source tree after building
# -I : Exclude undesired files/dirs from the package (e.g. CVS control
# files, backup files)
#
# During development it can be useful to run this command without the -tc
# option, allowing inspection of the build directory contents.
debuild -uc -us -tc -I
#
# Now install the deb if that has been requested
#
if [[ $# -ge 1 && "$1" == "install" ]] ; then
if [[ -e ${ENDROID_DEB} ]] ; then
# Go ahead and install it
echo "Installing ${ENDROID_DEB}"
stat ${ENDROID_DEB}
dpkg -i ${ENDROID_DEB}
else
echo "${ENDROID_DEB} doesn't appear to exist - aborting install"
exit 2
fi
fi