This commit is contained in:
Dmitry 2024-01-19 22:22:03 +03:00 committed by GitHub
commit 0ae312ae04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 41 additions and 0 deletions

View File

@ -7,5 +7,7 @@ if [[ -f "/etc/os-release" ]]; then
sudo apt install wireguard-tools libgtk-3-dev libayatana-appindicator3-dev golang-go resolvconf
elif [[ "${ID}" == "debian" ]]; then
sudo apt install wireguard-tools libgtk-3-dev libayatana-appindicator3-dev golang-go resolvconf
elif [[ "${ID}" == "void" ]]; then
sudo xbps-install -S gtk+3-devel wireguard-dkms wireguard-tools libayatana-appindicator-devel go
fi
fi

View File

@ -5,6 +5,9 @@ if [[ -f "/etc/os-release" ]]; then
#sudo rpm
elif [[ "${ID}" == "ubuntu" ]]; then
sudo dpkg -i ./build/wireguird_amd64.deb
elif [[ "${ID}" == "void" ]]; then
xbps-rindex -a *.xbps
sudo xbps-install --repository=$PWD wireguird
fi
fi

View File

@ -7,5 +7,8 @@ if [[ -f "/etc/os-release" ]]; then
elif [[ "${ID}" == "ubuntu" ]]; then
echo "deb package"
./package_deb.sh
elif [[ "${ID}" == "void" ]]; then
echo "xbps package"
./package_xbps.sh
fi
fi

33
package_xbps.sh Executable file
View File

@ -0,0 +1,33 @@
echo "wireguird: cleaning..."
opt_w_dir="./deb/opt/wireguird/"
if [ -e "$opt_w_dir" ]; then
rm -r "$opt_w_dir"
fi
mkdir -p "$opt_w_dir"
echo "wireguird: building go binary..."
time {
go generate
go build -ldflags "-s -w" -trimpath -o "$opt_w_dir""wireguird" -p $(nproc) -v -x
}
echo "wireguird: copying icons..."
cp -r ./Icon/ "$opt_w_dir"
echo "wireguird: building xbps package..."
touch "$opt_w_dir""wireguird.settings"
if [ ! -d "./build/" ]; then
mkdir ./build/
fi
xbps-create \
-A noarch \
-n wireguird-1.0_1 \
-s "wireguard gtk gui for linux" \
./deb
echo "wireguird: done"