build.sh 1.15 KB
Newer Older
1 2 3 4 5
#!/bin/bash

set -e
set -o pipefail  # Bashism

EclipseSpark's avatar
EclipseSpark committed
6
export variant=$2
7
export myarch=$3
EclipseSpark's avatar
EclipseSpark committed
8
export version=$4
EclipseSpark's avatar
EclipseSpark committed
9

10 11 12 13 14 15
if [ $myarch == "x64" ]; then
	export arch=amd64
fi
if [ $myarch == "x32" ]; then
	export arch=i386
fi
EclipseSpark's avatar
EclipseSpark committed
16

EclipseSpark's avatar
EclipseSpark committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30
function helper() {
	echo -e "Parrot Build System


USAGE
 	 ./build.sh <action> [<variant> <arch> <version>]

EXPLAINATION

      action  - help, build
                the action to be performed by this program
                help will show this message, build will start
                the build if correctly combined with variant, arch and version

31
      variant - home, security, kde, studio
EclipseSpark's avatar
EclipseSpark committed
32 33 34 35

                the edition of parrot that is going to
                be taken from the templates folder

Lorenzo Faletra's avatar
Lorenzo Faletra committed
36
      arch    - i386, amd64, armhf, arm64
EclipseSpark's avatar
EclipseSpark committed
37 38 39 40
                the architecture that will be built

      version - the version of parrot that has to be
                written in the live boot menu
Lorenzo Faletra's avatar
Lorenzo Faletra committed
41

EclipseSpark's avatar
EclipseSpark committed
42
EXAMPLE
43
 	 ./build.sh build home x64 4.6-CUSTOM
EclipseSpark's avatar
EclipseSpark committed
44 45 46 47 48
"
}

function build() {
	lb clean
49
	rm -rf config || true
EclipseSpark's avatar
EclipseSpark committed
50
	lb config
51
	lb build
52
	mv live-image-*.hybrid.iso ../Parrot-$variant-$version\_$myarch.iso
EclipseSpark's avatar
EclipseSpark committed
53 54 55 56 57 58 59 60 61 62 63 64 65
}

case $1 in
	build)
		build
	;;
	help)
		helper
	;;
	*)
		helper
	;;
esac