-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathavrdude-build.bash
executable file
·49 lines (39 loc) · 1.55 KB
/
avrdude-build.bash
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
47
48
49
#!/bin/bash
# Only set variable if it's not already set.
# This allows the caller to easily override these values using env vars.
maybe_set () { eval "[ -z \${$1+set} ] && $1=$2"; }
maybe_set basedir "/home/vagrant/avrdude-build"
maybe_set debdir "/vagrant/debian"
maybe_set destdir "/vagrant/releases"
maybe_set pfsver "1pfs+$(git describe --dirty=+ | tr - .)"
maybe_set svnrev 1426
maybe_set svnurl "http://svn.savannah.nongnu.org/svn/avrdude/trunk/avrdude"
################################################################################
#
# This script will build an AVRDude Debian package from a given revision of the
# AVRDude SVN repository.
#
# It has been tested only with revision 1426 but it's possible that it would
# work with other revisions.
#
# It has only been tested on 64-bit Ubuntu, but it's possible that it would work
# on 32-bit Ubuntu as well.
#
# Written by Sam Hathaway <[email protected]>. To the extent possible under
# law, I waive all copyright and related or neighboring rights to this work.
# https://creativecommons.org/publicdomain/zero/1.0/
#
################################################################################
mkdir -p "$basedir"
cd "$basedir"
svn checkout --revision "$svnrev" "$svnurl"
cd avrdude
cp -a "$debdir" .
oldver=$(dpkg-parsechangelog --count 1 | awk '/^Version:/{print$2}')
newver="$oldver+svn$svnrev-$pfsver"
export DEBFULLNAME="Sam Hathaway"
export DEBEMAIL="[email protected]"
debchange "Build from SVN r$svnrev." --nmu
debchange "" --newversion "$newver"
dpkg-buildpackage -b
mv ../*.deb "$destdir"