2018-04-26 11:23:51 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# at the moment only generate dir structure in /build
|
|
|
|
|
2018-05-06 17:26:21 +00:00
|
|
|
####################
|
|
|
|
## set enviroment ##
|
|
|
|
####################
|
2018-04-26 18:58:19 +00:00
|
|
|
|
2018-05-06 17:26:21 +00:00
|
|
|
[ -n "$1" ] && mode=debug
|
|
|
|
# install | clean | debug
|
|
|
|
|
2018-05-06 23:09:19 +00:00
|
|
|
function clean() {
|
2018-05-06 23:11:25 +00:00
|
|
|
echo "clear build"
|
|
|
|
[ -d build ] && rm -v -R build
|
|
|
|
mkdir build
|
2018-05-06 23:09:19 +00:00
|
|
|
}
|
2018-04-26 18:58:19 +00:00
|
|
|
|
2018-05-06 23:09:19 +00:00
|
|
|
function build() {
|
2018-05-06 23:11:25 +00:00
|
|
|
echo "build ..."
|
|
|
|
## skripte copieren ##
|
|
|
|
# remaster
|
|
|
|
mkdir -p build/usr/bin/
|
|
|
|
cp -v src/remaster.sh build/usr/bin/remaster
|
|
|
|
chmod +x build/usr/bin/remaster
|
|
|
|
|
|
|
|
# modules
|
|
|
|
mkdir -p build/usr/lib/remaster/
|
|
|
|
for i in proj func mods; do
|
|
|
|
mkdir -p build/usr/lib/remaster/$i
|
|
|
|
cp -v src/$i/* build/usr/lib/remaster/$i/
|
|
|
|
done
|
|
|
|
|
|
|
|
# setting
|
|
|
|
mkdir -p build/etc/remaster/
|
|
|
|
cp -v src/config.sample.cfg build/etc/remaster/config.sample.cfg
|
2018-04-26 18:58:19 +00:00
|
|
|
|
2018-05-06 23:09:19 +00:00
|
|
|
}
|
2018-05-06 17:26:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
install)
|
2018-05-06 23:11:25 +00:00
|
|
|
install || exit 1
|
|
|
|
;;
|
2018-05-06 17:26:21 +00:00
|
|
|
clean)
|
2018-05-06 23:11:25 +00:00
|
|
|
clean || exit 1
|
|
|
|
;;
|
2018-05-06 17:26:21 +00:00
|
|
|
debug)
|
2018-05-06 23:11:25 +00:00
|
|
|
debug || exit 1
|
|
|
|
;;
|
2018-05-06 17:26:21 +00:00
|
|
|
*)
|
2018-05-06 23:11:25 +00:00
|
|
|
echo "Usage: install | clean | debug"
|
|
|
|
exit 1
|
2018-05-06 17:26:21 +00:00
|
|
|
esac
|