This commit is contained in:
Maksymilian Sęk 2021-01-28 13:23:48 +01:00
commit 9231a4c60b

14
spkg Normal file
View file

@ -0,0 +1,14 @@
#!/usr/bin/env sh
#sPKG via wget
source=mirror
case $1 in
remove) dirstack=$(pwd) && cd /usr/src/$2 && make uninstall ;;
install) dirstack=$(pwd) && wget $source/$2.tar.zst /usr/src/$2.tar.zst && rm ./$2.tar.zst && cd /usr/src && untar -x --zstd $2 && cd $2 && make && make install && cat $2 > /var/cache/spkg.cache && popd || echo 'Invalid package.' && popd ;;
cache) case $2 in
rm) rm -rf /usr/src/* ;;
clean) rm -rf /usr/src/$3 ;;
save) case $4 in
to) cp /usr/src/ $4
*) cp /usr/src/ /etc/spkg/cache || mkdir -P /etc/spkg && mkdir -P /etc/spkg/cache && echo 'Made a caching directory, rerun:' && echo 'spkg cache'
esac ;;
esac