summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYves Fischer <yves.fischer@cern.ch>2016-05-24 19:29:09 +0200
committerYves Fischer <yvesf-git@xapek.org>2016-05-26 20:01:07 +0200
commit283845b18c97cfbae75e39ae89fbaed2e1ee0a91 (patch)
treea452b085e4b1a3bf3fb40bfd87639e228bb7f3f3
parentfd1e0cea253494df43aa5702c6796cf1f79ad746 (diff)
downloaddebian-packages-283845b18c97cfbae75e39ae89fbaed2e1ee0a91.tar.gz
debian-packages-283845b18c97cfbae75e39ae89fbaed2e1ee0a91.zip
update scripts
-rw-r--r--README.md24
-rw-r--r--packages/scripts-cern/build.gradle6
-rw-r--r--packages/scripts/build.gradle6
-rw-r--r--packages/scripts/resources/lib/activate.inc.sh14
-rw-r--r--packages/scripts/resources/lib/environments.inc.sh70
5 files changed, 74 insertions, 46 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..24bc213
--- /dev/null
+++ b/README.md
@@ -0,0 +1,24 @@
+## Bash Usage
+
+add to `~/.profile`
+
+```bash
+function __env_<name>() { # replace <name>
+ // add commands, examples:
+ __activator oraclejdk8 idea-iu2016 groovy-bin-2.4.5
+ export FOO=bar
+}
+
+# to use dmenu-software.sh
+export PATH=$PATH:/opt/scripts/bin/
+
+# at the end!
+source /opt/scripts/lib/activate.inc.sh
+```
+
+## Build packages
+
+```
+# ./gradlew packages:jvmtop:buildDeb
+# dpkg -i packages/jvmtop/build/distributions/jvmtop*deb
+``` \ No newline at end of file
diff --git a/packages/scripts-cern/build.gradle b/packages/scripts-cern/build.gradle
index d10b19e..0e7d121 100644
--- a/packages/scripts-cern/build.gradle
+++ b/packages/scripts-cern/build.gradle
@@ -4,3 +4,9 @@ ospackage {
into "/opt/${project.name}"
from files('resources')
}
+
+tasks.getByName('createActivator').doFirst {
+ new File("resources/bin").listFiles().each {
+ activator.bin[it.name] = "/opt/${project.name}/bin/${it.name}"
+ }
+} \ No newline at end of file
diff --git a/packages/scripts/build.gradle b/packages/scripts/build.gradle
index d10b19e..0e7d121 100644
--- a/packages/scripts/build.gradle
+++ b/packages/scripts/build.gradle
@@ -4,3 +4,9 @@ ospackage {
into "/opt/${project.name}"
from files('resources')
}
+
+tasks.getByName('createActivator').doFirst {
+ new File("resources/bin").listFiles().each {
+ activator.bin[it.name] = "/opt/${project.name}/bin/${it.name}"
+ }
+} \ No newline at end of file
diff --git a/packages/scripts/resources/lib/activate.inc.sh b/packages/scripts/resources/lib/activate.inc.sh
index 79bed6b..b77b9fd 100644
--- a/packages/scripts/resources/lib/activate.inc.sh
+++ b/packages/scripts/resources/lib/activate.inc.sh
@@ -1,3 +1,17 @@
+# use to process /opt/activator entries
+__activator() {
+ for product in $*; do
+ if [ -d "/opt/activator/$product/env" ]; then
+ for env in /opt/activator/$product/env/*; do
+ name=$(basename "$env")
+ eval "export '$name'='$(cat $env)'"
+ done
+ fi
+ if [ -d "/opt/activator/$product/bin" ]; then
+ export PATH="/opt/activator/$product/bin":$PATH
+ fi
+ done
+}
# non-interactive activate
__activate_env() {
diff --git a/packages/scripts/resources/lib/environments.inc.sh b/packages/scripts/resources/lib/environments.inc.sh
index 8960d95..d615b47 100644
--- a/packages/scripts/resources/lib/environments.inc.sh
+++ b/packages/scripts/resources/lib/environments.inc.sh
@@ -1,46 +1,24 @@
-
-function __sub_java7() {
- export JAVA_HOME=/usr/lib/jvm/java-7-oraclejdk
- export PATH=$JAVA_HOME/bin:$PATH
-}
-
-function __sub_java8() {
- export JAVA_HOME=/usr/lib/jvm/java-8-oraclejdk
- export PATH=$JAVA_HOME/bin:$PATH
-}
-
-function __sub_tools() {
- export PATH=/opt/idea-iu15/bin:$PATH
- export PATH=/opt/gwt-chromium/bin:$PATH
-
- export PATH=/opt/grails3/bin:$PATH
-
- export PATH=/opt/cern-scripts/bin:$PATH
-
- export TNS_ADMIN=/home/yfischer/.cache/tnsnames/admin_localhost
- export JAVA_OPTS="-Doracle.net.tns_admin=$TNS_ADMIN"
- export GRADLE_OPTS="-Doracle.net.tns_admin=$TNS_ADMIN"
-}
-
-function __env_ideajava8() {
- __sub_java8
- __sub_tools
-}
-
-function __env_ideajava7() {
- __sub_java7
- __sub_tools
-}
-
-function __env_fwk24() {
- __sub_java7
-
- export PATH=/opt/idea-iu15/bin:$PATH
- export PATH=/opt/gwt-chromium/bin:$PATH
- export PATH=/opt/grails2.2.1/bin:$PATH
- export PATH=/opt/cern-scripts/bin:$PATH
-
- export TNS_ADMIN=/home/yfischer/.cache/tnsnames/admin_localhost
- export JAVA_OPTS="-Doracle.net.tns_admin=$TNS_ADMIN"
- export GRADLE_OPTS="-Doracle.net.tns_admin=$TNS_ADMIN"
-}
+# Examples:
+#
+# function __env_ideajava8() {
+# __activator oraclejdk8 idea-iu2016 groovy-bin-2.4.5
+# __activator gwt-chromium cern-scripts
+#
+# export TNS_ADMIN=/home/yfischer/.cache/tnsnames/admin_localhost
+# export JAVA_OPTS="-Doracle.net.tns_admin=$TNS_ADMIN"
+# export GRADLE_OPTS="-Doracle.net.tns_admin=$TNS_ADMIN"
+# }
+#
+# function __env_fwk24() {
+# __activator oraclejdk7
+# __activator gwt-chromium
+# __activator idea-iu2016
+# __activator cern-scripts
+#
+#
+# export PATH=/opt/grails2.2.1/bin:$PATH
+#
+# export TNS_ADMIN=/home/yfischer/.cache/tnsnames/admin_localhost
+# export JAVA_OPTS="-Doracle.net.tns_admin=$TNS_ADMIN"
+# export GRADLE_OPTS="-Doracle.net.tns_admin=$TNS_ADMIN"
+# }