Hash :
fb71e8af
Author :
Thomas de Grivel
Date :
2023-02-03T18:59:01
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
#!/bin/sh
# Copyright 2023 Thomas de Grivel
set -e
# Config
: ${SHPKG_DIR:=~/shpkg}
SHPKG_SHARE_DIR="${SHPKG_DIR}/share/shpkg"
# SHPKG
. ${SHPKG_SHARE_DIR}/shpkg.subr
# CLI
if [ "x$1" = "xbuild" ]; then
shift
verbose 2 shpkg_build "$@"
exit
elif [ "x$1" = "xclean-all" ]; then
shift
verbose 2 shpkg_clean_all "$@"
exit
elif [ "x$1" = "xclean-sources" ]; then
shift
verbose 2 shpkg_clean_sources "$@"
exit
elif [ "x$1" = "xclean-build" ]; then
shift
verbose 2 shpkg_clean_build "$@"
exit
elif [ "x$1" = "xclean-configure" ]; then
shift
verbose 2 shpkg_clean_configure "$@"
exit
elif [ "x$1" = "xclean-fake" ]; then
shift
verbose 2 shpkg_clean_fake "$@"
exit
elif [ "x$1" = "xclean-package" ]; then
shift
verbose 2 shpkg_clean_package "$@"
exit
elif [ "x$1" = "xclean-sources" ]; then
shift
verbose 2 shpkg_clean_sources "$@"
exit
elif [ "x$1" = "xclone" ]; then
shift
verbose 2 shpkg_clone "$@"
exit
elif [ "x$1" = "xconfigure" ]; then
shift
verbose 2 shpkg_configure "$@"
exit
elif [ "x$1" = "xfake" ]; then
shift
verbose 2 shpkg_fake "$@"
exit
elif [ "x$1" = "xfetch" ] ||
[ "x$1" = "xf" ]; then
shift
verbose 2 shpkg_fetch "$@"
exit
elif [ "x$1" = "xinstall" ] ||
[ "x$1" = "xi" ]; then
shift
verbose 2 shpkg_install "$@"
exit
elif [ "x$1" = "xpackage" ] ||
[ "x$1" = "xpkg" ]; then
shift
verbose 2 shpkg_package "$@"
exit
elif [ "x$1" = "xpull" ] ||
[ "x$1" = "xp" ]; then
shift
verbose 2 shpkg_pull "$@"
exit
elif [ "x$1" = "xuninstall" ]; then
shift
verbose 2 shpkg_uninstall "$@"
exit
elif [ "x$1" = "xupdate" ]; then
verbose 2 shpkg_update
exit
elif [ "x$1" = "xupgrade" ]; then
shift
verbose 2 shpkg_upgrade "$@"
exit
fi
echo "Usage: shpkg OPERATION PKG ...
Source directory operations :
clone shortcut for git clone
fetch shortcut for git fetch
pull shortcut for git pull
clean-sources remove source directory
Compilation operations :
autogen shortcut for ./autogen
configure shortcut for ./configure
build shortcut for make
clean-configure remove configured and object files
clean-build remove object files
Package operations :
fake install compiled sources into fake directory
package build package from sources
install install package
upgrade pull sources, build package and install
uninstall uninstall package
clean-fake remove fake installation directory
clean-package remove built packages
" >&2
exit 1