2020-04-15 05:31:20 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2020-04-15 07:17:01 +00:00
|
|
|
set -ex
|
|
|
|
|
|
2024-09-09 21:45:48 +00:00
|
|
|
VERSION=$(cat VERSION)
|
2020-06-01 04:16:31 +00:00
|
|
|
DEB_FILE=protonmail-bridge_${VERSION}_amd64.deb
|
2020-04-15 05:31:20 +00:00
|
|
|
|
2020-06-01 04:16:31 +00:00
|
|
|
# Repack deb (remove unnecessary dependencies)
|
2020-06-01 04:24:45 +00:00
|
|
|
mkdir deb
|
|
|
|
|
cd deb
|
2024-09-09 21:45:48 +00:00
|
|
|
wget https://proton.me/download/bridge/"${DEB_FILE}"
|
|
|
|
|
ar x -v "${DEB_FILE}"
|
2020-06-01 04:16:31 +00:00
|
|
|
mkdir control
|
2021-01-07 05:57:03 +00:00
|
|
|
tar zxvf control.tar.gz -C control
|
|
|
|
|
sed -i "s/^Depends: .*$/Depends: libgl1, libc6, libsecret-1-0, libstdc++6, libgcc1/" control/control
|
2020-06-01 04:16:31 +00:00
|
|
|
cd control
|
2021-01-07 05:57:03 +00:00
|
|
|
tar zcvf ../control.tar.gz .
|
2020-06-01 04:16:31 +00:00
|
|
|
cd ../
|
2024-09-09 21:45:48 +00:00
|
|
|
ar rcs -v "${DEB_FILE}" debian-binary control.tar.gz data.tar.gz
|
2020-06-01 04:24:45 +00:00
|
|
|
cd ../
|
2020-04-15 05:31:20 +00:00
|
|
|
|
|
|
|
|
# Install protonmail bridge
|
2024-09-09 21:45:48 +00:00
|
|
|
apt-get install -y --no-install-recommends ./deb/"${DEB_FILE}"
|
2020-04-15 05:31:20 +00:00
|
|
|
|
|
|
|
|
# Cleanup
|
2020-06-01 04:16:31 +00:00
|
|
|
apt-get purge -y wget binutils xz-utils
|
|
|
|
|
apt-get autoremove -y
|
2020-06-01 04:24:45 +00:00
|
|
|
rm -rf deb
|