31 lines
1 KiB
Bash
31 lines
1 KiB
Bash
|
#!/bin/bash
|
||
|
|
||
|
if [ -z "$STORAGE" ]; then
|
||
|
echo "\$STORAGE is empty, please set it as a directory"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
set -e
|
||
|
|
||
|
# Install stow to ~/.local
|
||
|
curl https://ftp.gnu.org/gnu/stow/stow-latest.tar.gz | tar xz
|
||
|
cd stow-*
|
||
|
./configure --prefix=$HOME/.local
|
||
|
make
|
||
|
make install
|
||
|
|
||
|
# Move installation to $STORAGE
|
||
|
mkdir -p $STORAGE/stowed/stow/.local/{bin,share/{doc,info,man/man8,perl5}}
|
||
|
|
||
|
mv $HOME/.local/bin/{stow,chkstow} $STORAGE/stowed/stow/.local/bin
|
||
|
mv $HOME/.local/share/doc/stow $STORAGE/stowed/stow/.local/share/doc
|
||
|
mv $HOME/.local/share/info/{dir,stow.info} $STORAGE/stowed/stow/.local/share/info
|
||
|
mv $HOME/.local/share/man/man8/stow.8 $STORAGE/stowed/stow/.local/share/man/man8
|
||
|
mv $HOME/.local/share/perl5/{Stow,Stow.pm} $STORAGE/stowed/stow/.local/share/perl5
|
||
|
|
||
|
ln -s $STORAGE/stowed/stow/.local/bin/stow $HOME/.local/bin
|
||
|
ln -s $STORAGE/stowed/stow/.local/bin/chkstow $HOME/.local/bin
|
||
|
ln -s $STORAGE/stowed/stow/.local/share/perl5/Stow $HOME/.local/share/perl5
|
||
|
ln -s $STORAGE/stowed/stow/.local/share/perl5/Stow.pm $HOME/.local/share/perl5
|
||
|
|