File: debbuild.sh

package info (click to toggle)
powerman 2.4.4-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,432 kB
  • sloc: ansic: 19,458; sh: 7,225; yacc: 694; makefile: 455; lex: 272
file content (41 lines) | stat: -rwxr-xr-x 1,041 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
PACKAGE=powerman
USER=$(git config --get user.name)
DEBFULLNAME=$USER
EMAIL=$(git config --get user.email)
DEBEMAIL=$EMAIL

SRCDIR=${1:-$(pwd)}

die() { echo "debbuild: $@" >&2; exit 1; }
log() { echo "debbuild: $@"; }

test -z "$USER" && die "User name not set in git-config"
test -z "$EMAIL" && die "User email not set in git-config"

log "Running make dist"
make dist >/dev/null || exit 1

log "Building package from latest dist tarball"
tarball=$(ls -tr *.tar.gz | tail -1)
version=$(echo $tarball | sed "s/${PACKAGE}-\(.*\)\.tar\.gz/\1/")

rm -rf debbuild
mkdir -p debbuild && cd debbuild

mv ../$tarball .

log "Unpacking $tarball"
tar xvfz $tarball >/dev/null

log "Creating debian directory and files"
cd ${PACKAGE}-${version}
cp -a ${SRCDIR}/debian . || die "failed to copy debian dir"

export DEBEMAIL DEBFULLNAME
log "Creating debian/changelog"
dch --create --package=$PACKAGE --newversion $version build tree release

log "Running debian-buildpackage -b"
dpkg-buildpackage -b
log "Check debbuild directory for results"