forked from richardlehane/siegfried
/
debbuilder.sh
73 lines (66 loc) · 1.99 KB
/
debbuilder.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env sh
set -ev # exit early on error
VERSION=$(echo "${TRAVIS_TAG}" | tr -d 'v')
BASE="${HOME}/deb"
SFDIR="${BASE}/siegfried_${VERSION}-1_amd64"
export SFDIR
# setup dirs
mkdir -p $SFDIR/DEBIAN
mkdir -p $SFDIR/usr/bin
mkdir -p $SFDIR/usr/share/siegfried
# copy binaries and assets
cp $HOME/gopath/bin/sf $SFDIR/usr/bin/sf
cp $HOME/gopath/bin/roy $SFDIR/usr/bin/roy
cp -R $HOME/gopath/src/github.com/richardlehane/siegfried/cmd/roy/data/. $SFDIR/usr/share/siegfried
# write control file
SIZE=$(du -s "${SFDIR}/usr" | cut -f1)
cat >$SFDIR/DEBIAN/control << EOA
Package: siegfried
Version: $VERSION-1
Architecture: amd64
Maintainer: Richard Lehane <richard.lehane@gmail.com>
Installed-Size: $SIZE
Depends: libc6 (>= 2.2.5)
Section: misc
Priority: optional
Description: signature-based file identification tool
EOA
# make deb
cd $BASE
dpkg-deb --build $SFDIR
# write bintray json
DATE=`date +%Y-%m-%d`
cat >$BASE/bintray.json << EOB
{
"package": {
"name": "siegfried",
"repo": "debian",
"subject": "siegfried",
"desc": "see [CHANGELOG.md](https://github.com/richardlehane/siegfried/blob/master/CHANGELOG.md)",
"website_url": "http://www.itforarchivists.com/siegfried",
"issue_tracker_url": "https://github.com/richardlehane/siegfried/issues",
"vcs_url": "hhttps://github.com/richardlehane/siegfried.git",
"github_use_tag_release_notes": false,
"licenses": ["Apache-2.0"],
"public_download_numbers": false,
"public_stats": false
},
"version": {
"name": "${VERSION}",
"desc": "Version ${VERSION}",
"released": "${DATE}",
"vcs_tag": "v${VERSION}",
"gpgSign": false
},
"files":
[
{"includePattern": "${SFDIR}.deb", "uploadPattern": "siegfried_${VERSION}-1_amd64.deb",
"matrixParams": {
"deb_distribution": "wheezy",
"deb_component": "main",
"deb_architecture": "amd64"}
}
],
"publish": true
}
EOB