Browse files

add more runable requirements

  • Loading branch information...
1 parent e7d02e3 commit 8136ad1c4d42ad3116bee36aba3ba16d781caa30 @mpapis mpapis committed Jan 9, 2013
View
56 scripts/functions/requirements/arch
@@ -0,0 +1,56 @@
+#!/usr/bin/env bash
+
+function requirements_arch()
+{
+ typeset -a command_to_run command_flags
+ command_to_run=()
+ command_flags=()
+
+ while
+ (( $# ))
+ do
+ case "$1" in
+ (echo)
+ command_to_run+=( $1 )
+ shift
+ ;;
+ (force)
+ command_flags+=( --noconfirm )
+ shift
+ ;;
+ (*)
+ break
+ ;;
+ esac
+ done
+
+ (( UID == 0 )) || command_to_run+=( sudo )
+
+ while
+ (( $# ))
+ do
+ case "$1" in
+ (update-system)
+ true
+ ;;
+ (jruby*head)
+ "${command_to_run[@]}" pacman -Sy "${command_flags[@]}" jdk7-openjdk jre7-openjdk curl apache-ant
+ ;;
+ (jruby*)
+ "${command_to_run[@]}" pacman -Sy "${command_flags[@]}" jdk7-openjdk jre7-openjdk curl
+ ;;
+ (ir*)
+ "${command_to_run[@]}" pacman -Sy "${command_flags[@]}" mono
+ ;;
+ (opal)
+ "${command_to_run[@]}" pacman -Sy "${command_flags[@]}" nodejs
+ ;;
+ (*)
+ "${command_to_run[@]}" pacman -Sy "${command_flags[@]}" gcc patch curl zlib readline libxml2 libxslt git autoconf automake diffutils make libtool bison subversion
+ ;;
+ esac
+ shift
+ done
+}
+
+requirements_arch "$@"
View
53 scripts/functions/requirements/centos
@@ -0,0 +1,53 @@
+#!/usr/bin/env bash
+
+function requirements_yum()
+{
+ typeset -a command_to_run command_flags
+ command_to_run=()
+ command_flags=()
+
+ while
+ (( $# ))
+ do
+ case "$1" in
+ (echo)
+ command_to_run+=( $1 )
+ shift
+ ;;
+ (force)
+ command_flags+=( -y )
+ shift
+ ;;
+ (*)
+ break
+ ;;
+ esac
+ done
+
+ (( UID == 0 )) || command_to_run+=( sudo )
+
+ while
+ (( $# ))
+ do
+ case "$1" in
+ (update-system)
+ true
+ ;;
+ (jruby*)
+ "${command_to_run[@]}" yum install "${command_flags[@]}" java
+ ;;
+ (ir*)
+ true # not that easy
+ ;;
+ (opal)
+ true # not that easy
+ ;;
+ (*)
+ "${command_to_run[@]}" yum install "${command_flags[@]}" gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel
+ ;;
+ esac
+ shift
+ done
+}
+
+requirements_yum "$@"
View
1 scripts/functions/requirements/debian
View
1 scripts/functions/requirements/fedora
View
52 scripts/functions/requirements/gentoo
@@ -0,0 +1,52 @@
+#!/usr/bin/env bash
+
+function requirements_gentoo()
+{
+ typeset -a command_to_run command_flags
+ command_to_run=()
+ command_flags=()
+
+ while
+ (( $# ))
+ do
+ case "$1" in
+ (echo)
+ command_to_run+=( $1 )
+ shift
+ ;;
+ (force)
+ shift
+ ;;
+ (*)
+ break
+ ;;
+ esac
+ done
+
+ (( UID == 0 )) || command_to_run+=( sudo )
+
+ while
+ (( $# ))
+ do
+ case "$1" in
+ (update-system)
+ "${command_to_run[@]}" emerge --sync
+ ;;
+ (jruby*)
+ "${command_to_run[@]}" emerge dev-java/sun-jdk dev-java/sun-jre-bin
+ ;;
+ (ir*)
+ "${command_to_run[@]}" emerge dev-lang/mono
+ ;;
+ (opal)
+ "${command_to_run[@]}" emerge nodejs
+ ;;
+ (*)
+ "${command_to_run[@]}" emerge libiconv readline zlib openssl curl git libyaml sqlite libxslt libtool gcc autoconf automake bison m4
+ ;;
+ esac
+ shift
+ done
+}
+
+requirements_gentoo "$@"
View
53 scripts/functions/requirements/opensuse
@@ -0,0 +1,53 @@
+#!/usr/bin/env bash
+
+function requirements_zypper()
+{
+ typeset -a command_to_run command_flags
+ command_to_run=()
+ command_flags=()
+
+ while
+ (( $# ))
+ do
+ case "$1" in
+ (echo)
+ command_to_run+=( $1 )
+ shift
+ ;;
+ (force)
+ command_flags+=( -y )
+ shift
+ ;;
+ (*)
+ break
+ ;;
+ esac
+ done
+
+ (( UID == 0 )) || command_to_run+=( sudo )
+
+ while
+ (( $# ))
+ do
+ case "$1" in
+ (update-system)
+ true
+ ;;
+ (jruby*)
+ "${command_to_run[@]}" zypper install "${command_flags[@]}" java
+ ;;
+ (ir*)
+ "${command_to_run[@]}" zypper install "${command_flags[@]}" mono
+ ;;
+ (opal)
+ "${command_to_run[@]}" zypper install "${command_flags[@]}" nodejs
+ ;;
+ (*)
+ "${command_to_run[@]}" zypper install "${command_flags[@]}" patterns-openSUSE-devel_basis gcc-c++ bzip2 readline-devel zlib-devel libxml2-devel libxslt-devel libyaml-devel libopenssl-devel libffi-devel libtool bison
+ ;;
+ esac
+ shift
+ done
+}
+
+requirements_zypper "$@"
View
1 scripts/functions/requirements/redhat
View
4 scripts/functions/requirements/ubuntu
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-function requirements_ubuntu()
+function requirements_apt()
{
typeset -a command_to_run command_flags
command_to_run=()
@@ -53,4 +53,4 @@ function requirements_ubuntu()
done
}
-requirements_ubuntu "$@"
+requirements_apt "$@"

0 comments on commit 8136ad1

Please sign in to comment.