summaryrefslogtreecommitdiff
path: root/xi_profile.sh
blob: d88ed80e198082bdb07209e218ee01dfb67393b3 (plain)
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
#!/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