protonmail-bridge-docker/deb/install.sh

37 lines
858 B
Bash
Raw Normal View History

2020-04-14 22:31:20 -07:00
#!/bin/bash
2020-04-15 00:17:01 -07:00
set -ex
2020-05-31 21:16:31 -07:00
VERSION=`cat VERSION`
DEB_FILE=protonmail-bridge_${VERSION}_amd64.deb
2020-04-14 22:31:20 -07:00
# Install dependents
apt-get update
2020-04-15 00:17:01 -07:00
apt-get install -y --no-install-recommends socat pass
2020-05-31 21:16:31 -07:00
# Build time dependencies
apt-get install -y wget binutils xz-utils
# Repack deb (remove unnecessary dependencies)
2020-05-31 21:24:45 -07:00
mkdir deb
cd deb
2021-01-07 13:44:48 +08:00
wget -q https://protonmail.com/download/${DEB_FILE}
2020-05-31 21:16:31 -07:00
ar x -v ${DEB_FILE}
mkdir control
2021-01-07 13:44:48 +08:00
tar zxvf control.tar.gz -C control
sed -i "s/^Depends: .*$/Depends: libgl1, libc6, libsecret-1-0, libstdc++6, libgcc1/" control/control
2020-05-31 21:16:31 -07:00
cd control
2021-01-07 13:44:48 +08:00
tar zcvf ../control.tar.gz .
2020-05-31 21:16:31 -07:00
cd ../
2021-01-07 13:44:48 +08:00
ar rcs -v ${DEB_FILE} debian-binary control.tar.gz data.tar.gz
2020-05-31 21:24:45 -07:00
cd ../
2020-04-14 22:31:20 -07:00
# Install protonmail bridge
2020-05-31 21:24:45 -07:00
apt-get install -y --no-install-recommends ./deb/${DEB_FILE}
2020-04-14 22:31:20 -07:00
# Cleanup
2020-05-31 21:16:31 -07:00
apt-get purge -y wget binutils xz-utils
apt-get autoremove -y
2020-04-14 22:31:20 -07:00
rm -rf /var/lib/apt/lists/*
2020-05-31 21:24:45 -07:00
rm -rf deb