2022-11-02 20:42:07 -04:00
|
|
|
#!/bin/bash
|
2023-06-16 19:58:06 -04:00
|
|
|
VERSION=23.3
|
2022-11-02 20:42:07 -04:00
|
|
|
|
|
|
|
mkdir /tmp/protoc-install
|
|
|
|
pushd /tmp/protoc-install
|
|
|
|
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v$VERSION/protoc-$VERSION-linux-x86_64.zip
|
|
|
|
unzip protoc-$VERSION-linux-x86_64.zip
|
|
|
|
if [ "$EUID" -ne 0 ]; then
|
|
|
|
if command -v checkinstall &> /dev/null; then
|
|
|
|
sudo checkinstall --pkgversion=$VERSION -y cp -r bin include /usr/local/
|
|
|
|
cp *.deb ~
|
|
|
|
else
|
2023-08-13 13:25:15 -04:00
|
|
|
sudo cp -r bin include /usr/local/
|
2022-11-02 20:42:07 -04:00
|
|
|
fi
|
|
|
|
popd
|
|
|
|
sudo rm -rf /tmp/protoc-install
|
|
|
|
else
|
|
|
|
if command -v checkinstall &> /dev/null; then
|
|
|
|
checkinstall --pkgversion=$VERSION -y cp -r bin include /usr/local/
|
|
|
|
cp *.deb ~
|
|
|
|
else
|
2023-08-13 13:25:15 -04:00
|
|
|
cp -r bin include /usr/local/
|
2022-11-02 20:42:07 -04:00
|
|
|
fi
|
|
|
|
popd
|
|
|
|
rm -rf /tmp/protoc-install
|
|
|
|
fi
|