-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuildDeb.sh
executable file
·54 lines (43 loc) · 1.33 KB
/
buildDeb.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
#!/bin/bash
rpi_tools=$HOME/programming/git/rpi-tools/
toolchain_file=Toolchain-rpi.cmake
build_target=rpi
web_config=webpage/config_rpi.json
install_root=$HOME/programming/git/cross-OmniThing/deb/omnithing
package_version="0.8-2"
cmake . -DCMAKE_TOOLCHAIN_FILE="$toolchain_file" -DRPI_TOOLS="$rpi_tools" -DBUILD_TARGET="$build_target" \
-DWEB_CONFIG="$web_config" -DINSTALL_ROOT="$install_root" || exit
make install || exit
cd deb/omnithing || exit
mkdir -p DEBIAN
cd DEBIAN || exit
cat <<EOF > control
Package: omnithing
Architecture: all
Maintainer: Daniel Ogorchock
Priority: optional
Version: $package_version
Description: Creates SmartThings devices on raspberry pi
Depends: nodejs, pigpio
EOF
cat <<EOF > conffiles
/opt/omnithing/webpage_config.json
/opt/omnithing/config.json
EOF
cat <<EOF > postinst
#!/bin/bash
echo "Enabling and starting omnithing services..."
systemctl enable omnithing
systemctl enable omnithing-webserver
systemctl restart omnithing
systemctl restart omnithing-webserver
EOF
chmod 755 postinst
cd ../..
fakeroot dpkg-deb --build omnithing || exit
dpkg-scanpackages ./ /dev/null > Packages &&
gzip -k -f Packages &&
apt-ftparchive release . > Release &&
rm -fr KEY.gpg; gpg --output KEY.gpg --armor --export &&
rm -fr Release.gpg; gpg -abs -o Release.gpg Release &&
rm -fr InRelease; gpg --clearsign -o InRelease Release