summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xmpackage.sh36
-rwxr-xr-xonce/install.bat17
2 files changed, 50 insertions, 3 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
diff --git a/once/install.bat b/once/install.bat
index 3dde082..5d285f9 100755
--- a/once/install.bat
+++ b/once/install.bat
@@ -1,6 +1,7 @@
@echo off
-if "!%SYSROOT%!"=="!!" goto sysroot_missing
+if "!%SYSROOT%!"=="!!" goto sysroot_missing
+if "!%SYSROOT%!"=="!@sysroot@!" goto sysroot_invalid
pushd "%~dp0"
@@ -35,3 +36,17 @@ echo.
@pause
exit /B 1
+
+
+:sysroot_invalid
+
+echo.
+echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+echo this is the @product@ installation script
+echo SYSROOT is invalid! Will do nothing...
+echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+echo.
+
+@pause
+
+exit /B 1