From 29b0fe6e86272eb6f63a58f68e7a35386ac822fe Mon Sep 17 00:00:00 2001 From: Arnab Bose Date: Wed, 8 May 2024 22:21:40 +0530 Subject: [PATCH] Make installation work for non-root --- scripts/install-to-dest.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/install-to-dest.sh b/scripts/install-to-dest.sh index bd0b6d7..e527e38 100755 --- a/scripts/install-to-dest.sh +++ b/scripts/install-to-dest.sh @@ -27,12 +27,14 @@ cd $MY_PATH/.. readonly PKGNAME=yabsnap # This mirrors PKGBUILD with slight modifications. +readonly DEST="$PKGDIR"/usr/share/"$PKGNAME" +mkdir -p "$DEST" pushd src/ tar -cf - \ $(find -type f -not -name "*_test.py" \( -name "*.py" -o -name "*.conf" \)) | - tar -xf - -C "$PKGDIR"/usr/share/"$PKGNAME"/ -pushd "$PKGDIR"/usr/share/"$PKGNAME"/ -chown -R root:root . + tar -xf - -C "$DEST"/ +pushd "$DEST"/ +chown -R $USER:$USER . chmod -R u=rwX,go=rX . popd popd @@ -43,6 +45,6 @@ install -Dm 664 pacman/*.hook -t "$PKGDIR"/usr/share/libalpm/hooks/ install -Dm 644 yabsnap.manpage "$PKGDIR"/usr/share/man/man1/yabsnap.1 gzip -f "$PKGDIR"/usr/share/man/man1/"$PKGNAME".1 cd ../src -install -Dm 755 "$PKGNAME".sh -t "$PKGDIR"/usr/share/"$PKGNAME"/ +install -Dm 755 "$PKGNAME".sh -t "$DEST"/ install -d "$PKGDIR"/usr/bin ln -sf /usr/share/"$PKGNAME"/"$PKGNAME".sh "$PKGDIR"/usr/bin/"$PKGNAME"