diff options
Diffstat (limited to 'mpackage.sh')
-rwxr-xr-x | mpackage.sh | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/mpackage.sh b/mpackage.sh index a73dd1e..78b4827 100755 --- a/mpackage.sh +++ b/mpackage.sh @@ -27,6 +27,11 @@ USAGE: --symbols do not strip PE binaries (distro) --flysyms do not strip PE binaries (live environment) + --defroot default location to which the distribution should + be installed (substitutes @sysroot@) + --product name of the distribution to be installed + (substitutes @product@) + EOF exit 1 } @@ -68,6 +73,10 @@ init_vars() mb_symbols='no' mb_flysyms='no' + # setup + mb_defroot=@sysroot@ + mb_product=@product@ + # and voila mb_zipfile=$ZIPFILE_NAME } @@ -176,6 +185,22 @@ strip_symbols() && ( strip $1 || exit 2 ) } +gen_setup() +{ + pkgdir="$mb_tmproot/once" + objdir="$mb_project_dir/once" + + cp -av "$objdir" "$pkgdir" || exit 2 + cd "$pkgdir" || exit 2 + + for f in $(find -type f); do + sed -e 's#@sysroot@#'"$mb_defroot"'#g' \ + -e 's#@product@#'"$mb_product"'#g' \ + $f > $f.tmp || exit 2 + mv $f.tmp $f || exit 2 + done +} + gen_tarballs() { for pkg in $mb_pkglist; do @@ -223,7 +248,7 @@ gen_sysroot() cp -av * "$mb_sysroot" || exit 2 # once - cd "$mb_project_dir/once" || exit 2 + cd "$mb_tmproot/once" || exit 2 cp -av * "$mb_sysroot" || exit 2 # tarballs @@ -288,6 +313,12 @@ for arg ; do --zipfile=*) mb_zipfile=${arg#*=} ;; + --defroot=*) + mb_defroot=${arg#*=} + ;; + --product=*) + mb_product=${arg#*=} + ;; --symbols) mb_symbols='yes' ;; @@ -312,7 +343,8 @@ validate_args init_dirs init_pkglist -# five: tarballs, sysroot +# five: tarballs, sysroot, setup +gen_setup gen_tarballs gen_sysroot |