-
Notifications
You must be signed in to change notification settings - Fork 35
/
debbuild.sh
executable file
·64 lines (48 loc) · 1.3 KB
/
debbuild.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
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright(c) 2021 Intel Corporation. All rights reserved.
set -e
[ -z "${DEBEMAIL}" ] || [ -z "${DEBFULLNAME}" ] && {
echo
echo "Please set following environment variables"
echo
echo 'DEBEMAIL="[email protected]"'
echo 'DEBFULLNAME="Firstname Lastname"'
echo
exit
}
NAME=accel-config
REPODIR=idxd-config
REFDIR=$(pwd)
UPSTREAM=$REFDIR #TODO update once we have a public upstream
PKGDIR=debpkg
WORKDIR="$(mktemp -d --tmpdir "$NAME.XXXXXXXXXX")"
trap 'rm -rf $WORKDIR' exit
[ -d "$REFDIR" ] && REFERENCE="--reference $REFDIR"
echo
ch_entry=$(grep accel-config debian/changelog | head -n1)
echo Last entry in debian/changelog = \"$ch_entry\"
read -r -p 'Build package for this version? [y/N)] ' res
if [[ ! "$res" =~ [yY](es)* ]]
then
echo
echo "Please run ./debdch.sh or dch -r to update debian/changelog"
echo
exit
fi
dch -r ""
pushd $WORKDIR
git clone $REFERENCE "$UPSTREAM" $REPODIR
cp -r $REFDIR/deb* $REPODIR #temporary till initial commit
cd $REPODIR
debmake -t
DEB_BUILD_OPTIONS=nocheck debuild -us -uc
popd
rm -rf $PKGDIR
mkdir $PKGDIR
rm -rf $WORKDIR/*/
cp -r $WORKDIR/* $PKGDIR
echo
echo "!!!Debian package created in ./$PKGDIR and is ready for upload!!!"
echo "***debian/changelog was updated - please commit the changes***"
echo