summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSebastian Schmelzer2010-09-02 17:53:37 +0200
committerSebastian Schmelzer2010-09-02 17:53:37 +0200
commit91d3272f94fcb7a8bded9d2583b8f922c2b207e6 (patch)
treed96a524bc0f695ff4987bc6130420ebddb5bb287 /tools
parentchange dir structure (diff)
downloadcore-91d3272f94fcb7a8bded9d2583b8f922c2b207e6.tar.gz
core-91d3272f94fcb7a8bded9d2583b8f922c2b207e6.tar.xz
core-91d3272f94fcb7a8bded9d2583b8f922c2b207e6.zip
first steps for new makefile
Diffstat (limited to 'tools')
-rw-r--r--tools/inc/colors17
-rw-r--r--tools/inc/perl.modules.base29
l---------tools/inc/perl.modules.debian1
-rw-r--r--tools/inc/perl.modules.ubuntu29
-rwxr-xr-xtools/installer68
5 files changed, 144 insertions, 0 deletions
diff --git a/tools/inc/colors b/tools/inc/colors
new file mode 100644
index 00000000..984a8640
--- /dev/null
+++ b/tools/inc/colors
@@ -0,0 +1,17 @@
+Black='\e[0;30m'
+DarkGray='\e[1;30m'
+Blue='\e[0;34m'
+LightBlue='\e[1;34m'
+Green='\e[0;32m'
+LightGreen='\e[1;32m'
+Cyan='\e[0;36m'
+LightCyan='\e[1;36m'
+Red='\e[0;31m'
+LightRed='\e[1;31m'
+Purple='\e[0;35m'
+LightPurple='\e[1;35m'
+Brown='\e[0;33m'
+Yellow='\e[1;33m'
+LightGray='\e[0;37m'
+White='\e[1;37m'
+NC='\e[0m' # No Color \ No newline at end of file
diff --git a/tools/inc/perl.modules.base b/tools/inc/perl.modules.base
new file mode 100644
index 00000000..6e6febd1
--- /dev/null
+++ b/tools/inc/perl.modules.base
@@ -0,0 +1,29 @@
+Carp
+Clone
+Config::General
+Data::Dumper
+Cwd
+DBI
+Digest::MD5
+Digest::SHA1
+Encode
+Exporter
+Fcntl
+File::Basename
+File::Find
+File::Glob
+File::Path
+FindBin
+Getopt::Long
+HTTP::Request::Common
+JSON
+LWP::UserAgent
+List::Util
+MIME::Base64
+Pod::Usage
+POSIX
+Scalar::Util
+Socket
+Storable
+Sys::Hostname
+Term::ReadLine \ No newline at end of file
diff --git a/tools/inc/perl.modules.debian b/tools/inc/perl.modules.debian
new file mode 120000
index 00000000..61f9d24c
--- /dev/null
+++ b/tools/inc/perl.modules.debian
@@ -0,0 +1 @@
+perl.modules.ubuntu \ No newline at end of file
diff --git a/tools/inc/perl.modules.ubuntu b/tools/inc/perl.modules.ubuntu
new file mode 100644
index 00000000..2a520b01
--- /dev/null
+++ b/tools/inc/perl.modules.ubuntu
@@ -0,0 +1,29 @@
+Carp perl-base
+Clone libclone-perl
+Config::General libconfig-general-perl
+Data::Dumper perl
+Cwd perl-base
+DBI libdbi-perl
+Digest::MD5 perl
+Digest::SHA1 libdigest-sha1-perl
+Encode perl
+Exporter perl-base
+Fcntl perl-base
+File::Basename perl-modules
+File::Find perl-modules
+File::Glob perl-base
+File::Path perl-modules
+FindBin perl-modules
+Getopt::Long perl-base
+HTTP::Request::Common libwww-perl
+JSON libjson-perl
+LWP::UserAgent libwww-perl
+List::Util perl-base
+MIME::Base64 perl
+Pod::Usage perl-modules
+POSIX perl-base
+Scalar::Util perl-base
+Socket perl-base
+Storable perl
+Sys::Hostname perl
+Term::ReadLine perl-modules \ No newline at end of file
diff --git a/tools/installer b/tools/installer
new file mode 100755
index 00000000..33e8683d
--- /dev/null
+++ b/tools/installer
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+. tools/inc/colors
+
+DISTRO=$(lsb_release -i| sed 's/^[^:]*:\t//' | tr '[:upper:]' '[:lower:]')
+
+
+# helper functions:
+git_version()
+{
+ GITVERSION=`git describe`
+ GITMODIFIED=`(git status | grep "modified:\|added:\|deleted:" -q) && echo "-M"`
+ echo $GITVERSION$GITMODIFIED
+}
+
+perl_dep_check()
+{
+ echo -n " * checking perl dependencies"
+ PERL_MODULES=$(cat tools/inc/perl.modules.base)
+ [ -e .perl_modules_missing ] && rm .perl_modules_missing
+ [ -e .perl_deps_guess ] && rm .perl_deps_guess
+ for pm in $PERL_MODULES; do
+ perl -e "use $pm" 2>>/dev/null || echo $pm >> .perl_modules_missing;
+ done
+ if [ -e .perl_modules_missing ]; then
+ echo -e " [${LightRed}failed${NC}]"
+ echo " Following perl modules are required and could not be found on your system:"
+ for pm in $(cat .perl_modules_missing); do
+ echo -n " $pm"
+ if [ -e tools/inc/perl.modules.$DISTRO ]; then
+ GUESS_INSTALL=$(cat tools/inc/perl.modules.$DISTRO|grep $pm| awk '{print $2}')
+ if [ ! -z $GUESS_INSTALL ]; then
+ echo " ($GUESS_INSTALL)"
+ echo "$GUESS_INSTALL" >> .perl_deps_guess
+ else
+ echo ""
+ fi
+ else
+ echo ""
+ fi
+ done
+ if [ -e .perl_deps_guess ]; then
+ echo " To install the missing dependencies run:"
+ echo -n " apt-get install"
+ for d in $(cat .perl_deps_guess | sort -u); do
+ echo -n " $d"
+ done
+ echo ""
+ exit 1
+ fi
+ else
+ echo -e " [${LightGreen}done${NC}]"
+ fi
+}
+
+make_tarball()
+{
+ echo -n " * create openslx tarball"
+ VERSIONSTRING="openslx-$(git_version)"
+ rm -rf $VERSIONSTRING.tar $VERSIONSTRING.tar.*
+ git archive --format=tar --prefix=$VERSIONSTRING/ -o $VERSIONSTRING.tar HEAD
+ bzip2 $VERSIONSTRING.tar
+ echo -e " [${LightGreen}done${NC}]"
+}
+
+perl_dep_check
+make_tarball
+git_version \ No newline at end of file