forked from indigo-astronomy/indigo_imager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuilddeb.sh
executable file
·36 lines (25 loc) · 1.17 KB
/
builddeb.sh
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
#!/bin/sh
VERSION=${1}
DEBFULLNAME="Rumen Bogdanovski"
EMAIL="[email protected]"
__check_file_exits() {
[ ! -f ${1} ] && { echo "file '${1}' not found"; exit 1; }
}
# Check for files where version number shall be replaced.
__check_file_exits "common_src/version.h"
# Make sure debian/changelog does not exists because we will genrate it.
rm -f debian/changelog
# Check for Debian package building executables and tools.
[ ! $(which dch) ] && { echo "executable 'dch' not found install package: 'devscripts'"; exit 1; }
[ ! $(which dpkg-buildpackage) ] && { echo "executable 'dpkg-buildpackage' not found install package: 'dpkg-dev'"; exit 1; }
[ ! $(which cdbs-edit-patch) ] && { echo "executable 'cdbs' not found install package: 'cdbs'"; exit 1; }
# Build dependencies
./build_libs.sh
# Create entry in debian/changelog.
dch --create --package "ain-imager" --newversion ${VERSION} --distribution unstable --nomultimaint -t "Build from official upstream."
# Update version.h.
sed -i "s/\(AIN_VERSION \).*/\1\"${VERSION}\"/g" version.h
# Finally build the package.
dpkg-buildpackage \-us \-uc \-I.git \-I\*.out[0-9]\* \-I\*.swp
# Cleanup debian/changelog.
rm -f debian/changelog