forked from sensorgnome-org/sensorgnome-support
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgen-package.sh
More file actions
executable file
·39 lines (34 loc) · 1.4 KB
/
gen-package.sh
File metadata and controls
executable file
·39 lines (34 loc) · 1.4 KB
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
#! /bin/bash -e
DESTDIR=build-temp
rm -rf $DESTDIR
mkdir $DESTDIR
# Set version in version file (goes into /etc/sensorgnome)
DEST=$DESTDIR/etc/sensorgnome
install -d $DEST
TZ=PST8PDT date +'SG %Y-%j' > $DEST/version
# Place SS flash file into gnome home dir
install -d $DESTDIR/home/gnome
install -m 755 flash-ss.sh $DESTDIR/home/gnome
# Figure out exact versions of sensorgnome dependencies
cp -r DEBIAN $DESTDIR
# get version of sg-control package 'cause it's not in this repo
wget -O Packages -q https://sensorgnome.s3.us-east-2.amazonaws.com/dists/testing/main/binary-armhf/Packages
egrep -A1 'Package: sg-control' Packages | egrep Version | sort | tail -4
version=$(egrep -A1 'Package: sg-control' Packages | egrep Version | sort | tail -1 | cut "-d " -f2)
echo "sg-control $version"
sed -ie "s/sg-control/sg-control (>= $version)/" $DESTDIR/DEBIAN/control
# handle local packages
for d in ../packages/*.deb; do
version=$(echo $d | sed -r -e 's/.*_(.*)_.*/\1/')
pkg=$(basename $d | sed -e 's/_.*//')
echo "$pkg: $version"
sed -ie "s/$pkg/$pkg (>= $version)/" $DESTDIR/DEBIAN/control
done
echo ""
echo "sensorgnome package control file:"
cat $DESTDIR/DEBIAN/control
echo ""
# Boilerplate package generation
sed -e "/^Version/s/:.*/: $(TZ=PST8PDT date +%Y.%j)/" -i $DESTDIR/DEBIAN/control # set version: YYYY.DDD
dpkg-deb -Zxz --root-owner-group --build $DESTDIR ../packages
# dpkg-deb --contents ../packages