void: xbps package

This commit is contained in:
Dmitry Shirshov 2024-01-20 01:20:28 +03:00
parent 4b2afa6154
commit 7eef84e127
2 changed files with 36 additions and 0 deletions

View File

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