summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-07-18 13:06:02 +0100
committerdavidovski <david@davidovski.xyz>2022-07-18 13:06:02 +0100
commitd20a2478df0a5a5f48d64c52af510bfa30bd004a (patch)
treec9e972ae3d656d090da740ef150306f79a26ccd8
parent786633be3f57f66eecaa5534f0a9703373439138 (diff)
added build.shmk1.7
-rw-r--r--Makefile18
-rwxr-xr-xbuild.shmk7
-rwxr-xr-xsrc/xi.sh38
3 files changed, 33 insertions, 30 deletions
diff --git a/Makefile b/Makefile
index 251d39b..3289a2c 100644
--- a/Makefile
+++ b/Makefile
@@ -3,15 +3,19 @@ SOURCE=src
PREFIX=/usr
CONFDIR=/etc
-install: install-config
- mkdir -p ${DESTDIR}${PREFIX}/bin
- mkdir -p ${DESTDIR}${PREFIX}/lib/xipkg
- install -m755 ${SOURCE}/*.sh ${DESTDIR}${PREFIX}/lib/xipkg/
- install -m755 ${SOURCE}/xi.sh ${DESTDIR}${PREFIX}/bin/xipkg
- ln -sf xipkg ${DESTDIR}${PREFIX}/bin/xi
- git describe --always > ${DESTDIR}${PREFIX}/lib/xipkg/VERSION
+#install: install-config
+# mkdir -p ${DESTDIR}${PREFIX}/bin
+# mkdir -p ${DESTDIR}${PREFIX}/lib/xipkg
+# install -m755 ${SOURCE}/*.sh ${DESTDIR}${PREFIX}/lib/xipkg/
+# install -m755 ${SOURCE}/xi.sh ${DESTDIR}${PREFIX}/bin/xipkg
+# git describe --always > ${DESTDIR}${PREFIX}/lib/xipkg/VERSION
install-config:
mkdir -p $(DESTDIR)${CONFDIR}/xipkg.d/
cp default.conf $(DESTDIR)${CONFDIR}/xipkg.d/
cp xipkg.conf $(DESTDIR)${CONFDIR}/xipkg.conf
+
+
+install: install-config
+ ./build.shmk
+ ln -sf xipkg ${DESTDIR}${PREFIX}/bin/xi
diff --git a/build.shmk b/build.shmk
new file mode 100755
index 0000000..dc723f6
--- /dev/null
+++ b/build.shmk
@@ -0,0 +1,7 @@
+#!/usr/bin/env shmk
+
+LIBS="src/*.sh"
+
+PROGS="
+src/xi.sh
+"
diff --git a/src/xi.sh b/src/xi.sh
index eca3141..93d4c36 100755
--- a/src/xi.sh
+++ b/src/xi.sh
@@ -1,5 +1,20 @@
#!/bin/sh
+#include xilib
+#include profile.sh
+#include util.sh
+#include validate.sh
+
+#include query.sh
+#include sync.sh
+#include install.sh
+#include build.sh
+#include get.sh
+#include remove.sh
+#include stats.sh
+#include bootstrap.sh
+#>echo "VERSION=$(git describe --always)"
+
usage () {
cat << EOF
${LIGHT_WHITE}XiPkg Version $VERSION
@@ -74,13 +89,6 @@ ${RED}Usage: xi [options] command...
EOF
}
-
-[ -z "${LIBDIR}" ] && LIBDIR=/usr/lib/xipkg
-[ -f "/usr/lib/xilib.sh" ] && . /usr/lib/xilib.sh
-
-[ -f ${LIBDIR}/VERSION ] && VERSION=$(cat ${LIBDIR}/VERSION) || VERSION=
-export VERSION
-
export SYSROOT=/
export CONF_FILE="/etc/xipkg.conf"
export VERBOSE=false
@@ -123,22 +131,9 @@ while getopts ":r:c:qnluyvh" opt; do
esac
done
-# TODO only load these modules when needed
-. ${LIBDIR}/profile.sh
-. ${LIBDIR}/util.sh
-. ${LIBDIR}/validate.sh
-
-. ${LIBDIR}/query.sh
-. ${LIBDIR}/sync.sh
-. ${LIBDIR}/install.sh
-. ${LIBDIR}/build.sh
-. ${LIBDIR}/get.sh
-. ${LIBDIR}/remove.sh
-
shift $((OPTIND-1))
if [ "$#" = "0" ]; then
- . ${LIBDIR}/stats.sh
show_xipkg_stats
else
case "$1" in
@@ -192,7 +187,6 @@ else
"clean")
shift
checkroot
- . ${LIBDIR}/remove.sh
clean $@
;;
"list")
@@ -243,14 +237,12 @@ else
"bootstrap")
shift
checkroot
- . ${LIBDIR}/bootstrap.sh
bootstrap $@
;;
"help")
usage
;;
*)
-
sudo $0 ${DEFAULT_OPTION:-install} $@
;;
esac