-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.sh
executable file
·52 lines (42 loc) · 1.21 KB
/
build.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
#!/bin/bash
#
# build lantern for raspberry pi
#
set -xe
VERSION=${1:?version is empty}
git clone https://github.com/getlantern/lantern.git
cd lantern
VERSION=$VERSION HEADLESS=true make docker-linux-arm
mv lantern_linux_arm lantern-$VERSION-armv7h
sed -i 's/GOARM=7/GOARM=6/' Makefile
VERSION=$VERSION HEADLESS=true make docker-linux-arm
mv lantern_linux_arm lantern-$VERSION-armv6h
mkdir -p lantern/{DEBIAN,lib/systemd/system,usr/bin}/
cp lantern-$VERSION-armv6h lantern/usr/bin/lantern
cat > lantern/DEBIAN/control <<_EOF_
Package: lantern
Version: $VERSION-1
Maintainer: [email protected]
Homepage: https://getlantern.org
Architecture: armhf
Priority: optional
Section: net
Description: Open Internet for Everyone
_EOF_
cat > lantern/lib/systemd/system/lantern.service <<_EOF_
[Unit]
Description=Open Internet for Everyone
Documentation=https://getlantern.org
After=network.target
[Service]
ExecStart=/usr/bin/lantern -addr=0.0.0.0:8787
StandardOutput=null
StandardError=null
Restart=always
[Install]
WantedBy=multi-user.target
_EOF_
dpkg -b lantern lantern_$VERSION-1_armhf.deb
sudo mv lantern-$VERSION-armv[67]h lantern_$VERSION-1_armhf.deb ..
cd ..
sudo chmod a+rw lantern-$VERSION-armv[67]h lantern_$VERSION-1_armhf.deb