arch-networkmanager-opencon.../install.sh

32 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/bash
2023-04-03 17:41:03 +00:00
contextRoot="$(mktemp -d)";
workingDir="$(pwd)";
scriptRoot="$(realpath "${BASH_SOURCE%/*}")";
patchFile="allow_insecure_crypto.patch";
patchedConfig="openssl_insecure_crypto.cnf";
2023-04-03 17:41:03 +00:00
git clone https://aur.archlinux.org/networkmanager-openconnect-useragent-git.git "$contextRoot";
cd "$contextRoot";
cp "$scriptRoot/$patchFile" .;
cp "$scriptRoot/$patchedConfig" .;
sed -i \
-e "/^depends=(/{ s/ openconnect / openconnect-git / }" \
-e "s/^\(source=(.*\)\()\)/\1 \"local:\/\/$patchFile\" \"local:\/\/$patchedConfig\"\2/" \
-e "s/^\(sha256sums=(.*\)\()\)/\1 'SKIP' 'SKIP'\2/" \
-e "/^build() {/{" \
-e 'a\' \
-e ' cd NetworkManager-openconnect\' \
-e ' git apply "${srcdir}/'"$patchFile"'"\' \
-e " cd .." \
-e "}" \
-e "/^package() {/{" \
-e 'a mkdir -p "${pkgdir}/usr/local/etc/ssl"' \
-e 'a cp "${srcdir}/'"$patchedConfig"'" "${pkgdir}/usr/local/etc/ssl/openssl_insecure_crypto.cnf"' \
-e "}" \
PKGBUILD
2023-04-03 17:41:03 +00:00
makepkg --noconfirm -si;
2023-04-03 17:41:03 +00:00
cd "$workingDir";
rm -rf "$contextRoot";