remaster/autogen.sh

78 lines
1.4 KiB
Bash
Raw Normal View History

2018-04-26 11:23:51 +00:00
#!/bin/bash
# at the moment only generate dir structure in /build
2018-05-06 23:34:59 +00:00
#make ...
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
}
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
2018-05-06 23:34:59 +00:00
#config ...
2018-05-06 23:30:50 +00:00
function set_rootdir() {
2018-05-06 23:58:55 +00:00
sed -i "s#<ROOTDIR>#$1#g" build/usr/bin/remaster
2018-05-06 23:30:50 +00:00
for i in proj func mods; do
2018-05-06 23:58:55 +00:00
sed -i "s#<ROOTDIR>#$1#g" build/usr/lib/remaster/$i/*
2018-05-06 23:30:50 +00:00
done
}
function set_libdir() {
2018-05-06 23:58:55 +00:00
sed -i "s#<LIBDIR>#$1#g" build/usr/bin/remaster
2018-05-06 23:30:50 +00:00
for i in proj func mods; do
2018-05-06 23:58:55 +00:00
sed -i "s#<LIBDIR>#$1#g" build/usr/lib/remaster/$i/*
2018-05-06 23:30:50 +00:00
done
}
2018-05-06 23:34:59 +00:00
#modes
2018-05-06 23:30:50 +00:00
function debug() {
clean
build
set_rootdir "`pwd`/build"
set_libdir "`pwd`/build/usr/lib/remaster"
}
function install() {
clean
build
set_rootdir ""
set_libdir "/usr/lib/remaster"
#cp -f -r build/* /
}
2018-05-06 17:26:21 +00:00
2018-05-06 23:34:59 +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 23:34:59 +00:00
build)
build || exit 1
;;
2018-05-06 17:26:21 +00:00
*)
2018-05-06 23:34:59 +00:00
echo "Usage: install | clean | debug | build"
2018-05-06 23:11:25 +00:00
exit 1
2018-05-06 17:26:21 +00:00
esac