summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-17 19:08:28 +0300
committerAndrei Karas <akaras@inbox.ru>2017-02-17 19:08:28 +0300
commit4f66c6c7df447be0a2bfc404c2371ef206a8fdc9 (patch)
tree6c66dc66ea5e62bf0d97e5efa85232360d5aa52b
parentda4686d2cab1914719643f6a0d7e53adf7e2666c (diff)
downloadspm-4f66c6c7df447be0a2bfc404c2371ef206a8fdc9.tar.gz
spm-4f66c6c7df447be0a2bfc404c2371ef206a8fdc9.tar.bz2
spm-4f66c6c7df447be0a2bfc404c2371ef206a8fdc9.tar.xz
spm-4f66c6c7df447be0a2bfc404c2371ef206a8fdc9.zip
Add script for create environment file from more than one package.
New script name: createenvs.sh envname package1 [package2 ...] Example: ./createenvs.sh sdl1 SDL SDL_image SDL_ttf SDL_net SDL_gfx SDL_mixer
-rwxr-xr-xscripts/createenvs.sh5
-rw-r--r--scripts/include/common.sh37
2 files changed, 42 insertions, 0 deletions
diff --git a/scripts/createenvs.sh b/scripts/createenvs.sh
new file mode 100755
index 0000000..a5fba23
--- /dev/null
+++ b/scripts/createenvs.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+source ../scripts/include/common.sh
+
+common_use_packages $*
diff --git a/scripts/include/common.sh b/scripts/include/common.sh
index e348e5d..e7e8f8c 100644
--- a/scripts/include/common.sh
+++ b/scripts/include/common.sh
@@ -317,6 +317,43 @@ function common_use_package {
check_error $?
}
+function common_use_packages {
+ cd "${scriptsdir}"
+ check_error $?
+
+ export envname="$1"
+ export installname0="${installname}"
+ export envfile="../env/run${envname}.sh"
+ echo "#!/bin/bash" >"${envfile}"
+ check_error $?
+ echo "" >>"${envfile}"
+ shift
+ names="$*"
+ IFS=" "
+ for package in $names
+ do
+ export installname="${installname0}"
+ unset ENV_PATH
+ unset ENV_LD_LIBRARY_PATH
+ unset ENV_PKG_CONFIG_PATH
+ unset ENV_MANPATH
+ unset ENV_ACLOCAL_PATH
+ unset ENV_LDFLAGS_PATH
+ unset ENV_CPPFLAGS_PATH
+
+ common_package_init
+ common_build_init
+ common_run_package
+ package_use
+ check_error $?
+ done
+ unset IFS
+ echo "\$*" >>"${envfile}"
+ check_error $?
+ chmod 0755 "${envfile}"
+ check_error $?
+}
+
function package_get_source {
echo "package_get_source"
run_clone "${SRCURL}"