summaryrefslogtreecommitdiff
path: root/xi_profile.sh
diff options
context:
space:
mode:
Diffstat (limited to 'xi_profile.sh')
-rw-r--r--xi_profile.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/xi_profile.sh b/xi_profile.sh
new file mode 100644
index 0000000..d88ed80
--- /dev/null
+++ b/xi_profile.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+cd $1
+
+prepare () {
+ echo "passing prepare"
+}
+
+build () {
+ echo "passing build"
+}
+
+check () {
+ echo "passing check"
+}
+
+package () {
+ echo "passing package"
+}
+
+for xibuild in *.xibuild; do
+ PKG_NAME=$(basename $xibuild .xibuild)
+ export PKG_DEST=./xipkg/$PKG_NAME
+ mkdir -p $PKG_DEST
+
+ . ./$xibuild
+
+ echo "==========================PREPARE STAGE=========================="
+ prepare || exit 1
+ echo "==========================BUILD STAGE=========================="
+ build || exit 1
+ echo "==========================CHECK STAGE=========================="
+ check || exit 1
+ echo "==========================PACKAGE STAGE=========================="
+ package || exit 1
+
+ printf "checking for postinstall... "
+ if command -v postinstall > /dev/null; then
+ echo "adding postinstall"
+ POST_DIR=$PKG_DEST/var/lib/xipkg/postinstall
+ mkdir -p $POST_DIR
+ cat /build/$PKG_NAME.xibuild > $POST_DIR/$PKG_NAME.sh
+ echo "" >> $POST_DIR/$PKG_NAME.sh
+ echo "postinstall" >> $POST_DIR/$PKG_NAME.sh
+ else
+ echo "no postinstall"
+ fi
+
+done