Commit a97355ad465d3510f86d673b61610793f37f0abc

  • avatar
  • Sergey 'Jin' Bostandzhyan <jin @deve…per.digitalstrom.org>
  • Thu Aug 05 19:57:26 CEST 2010
Removed copy script as it is no longer needed
tools/build_and_copy_weblibs.sh
(0 / 108)
  
1#!/bin/bash
2
3###
4## Copies necessary js files for development/distribution
5
6BASEDIR=$1
7TARGETDIR=$2
8
9if [ -z "$TARGETDIR" ] ; then
10 echo "Usage: $(basename $0) <base directory> <target_dir>"
11 echo "example: $(basename $0) ./websrc ./data/webroot/js"
12 exit 1
13fi
14
15SPROCKETS=$(which sprocketize)
16if [ ! -x "$SPROCKETS" ] ; then
17 echo "error: need ruby sprocketize"
18 exit 1
19fi
20
21# make sure our submodules are here
22cd $BASEDIR
23git submodule update --init
24cd -
25
26$SPROCKETS -I $BASEDIR/dss-setup-interface/ $BASEDIR/dss-setup-interface/dss-setup-interface.js > "$TARGETDIR/dss-setup-interface.js"
27
28$SPROCKETS -I $BASEDIR/dss-setup-interface/ $BASEDIR/dss-setup-interface/dss-overview-page.js > "$TARGETDIR/dss-overview-page.js"
29
30RAKE=$(which rake)
31if [ ! -x "$RAKE" ] ; then
32 echo "error: need ruby rake"
33 exit 1
34fi
35
36# if prototype is present
37if [ -d "$BASEDIR/thirdparty/prototype" ] ; then
38 cd "$BASEDIR/thirdparty/prototype"
39 # build prototype
40 if $RAKE dist && [ -f "dist/prototype.js" ]; then
41 cd -
42 mkdir -p "$TARGETDIR/lib/prototype"
43 cp $BASEDIR/thirdparty/prototype/dist/prototype.js "$TARGETDIR/lib/prototype/"
44 else
45 echo "could not build prototype.js"
46 exit 1
47 fi
48fi
49
50MAKE=$(which make)
51if [ ! -x "$RAKE" ] ; then
52 echo "error: need ruby make"
53 exit 1
54fi
55
56# if jquery is present
57if [ -d "$BASEDIR/thirdparty/jquery" ] ; then
58 cd "$BASEDIR/thirdparty/jquery"
59 # build prototype
60 if $MAKE && [ -f "dist/jquery.min.js" ]; then
61 cd -
62 mkdir -p "$TARGETDIR/lib/jquery"
63 cp $BASEDIR/thirdparty/jquery/dist/jquery.min.js "$TARGETDIR/lib/jquery/"
64 else
65 echo "could not build prototype.js"
66 exit 1
67 fi
68fi
69
70# if extjs is present
71if [ -d "$BASEDIR/thirdparty/extjs" ] ; then
72 mkdir -p "$TARGETDIR/lib/extjs"
73 cp $BASEDIR/thirdparty/extjs/ext-all.js "$TARGETDIR/lib/extjs/"
74 cp $BASEDIR/thirdparty/extjs/ext-all-debug.js "$TARGETDIR/lib/extjs/"
75 cp -r $BASEDIR/thirdparty/extjs/adapter "$TARGETDIR/lib/extjs/"
76 cp -r $BASEDIR/thirdparty/extjs/resources "$TARGETDIR/lib/extjs/"
77fi
78
79# if flot is present
80if [ -d "$BASEDIR/thirdparty/flot" ] ; then
81 mkdir -p "$TARGETDIR/lib"
82 (cd $BASEDIR/thirdparty; tar cf - --exclude .git ./flot) | ( cd $TARGETDIR/lib; tar xfp -)
83fi
84
85# install extjs customizing if it exists
86if [ -d "$BASEDIR/customizing/extjs/resources" ]; then
87 set -x
88 cp -r $BASEDIR/customizing/extjs/resources "$TARGETDIR/lib/extjs/"
89fi
90
91# install translations
92if [ -d "$BASEDIR/customizing/LC_MESSAGES" ]; then
93 set -x
94 mkdir -p "$TARGETDIR/lib/LC_MESSAGES/de_DE"
95 cp $BASEDIR/customizing/LC_MESSAGES/*.json "$TARGETDIR/lib/LC_MESSAGES/"
96 cp $BASEDIR/customizing/LC_MESSAGES/de_DE/* "$TARGETDIR/lib/LC_MESSAGES/de_DE"
97fi
98
99
100# if jsgettext is present
101if [ -d "$BASEDIR/thirdparty/jsgettext" ] ; then
102 # build prototype
103 mkdir -p "$TARGETDIR/lib/jsgettext"
104 cp $BASEDIR/thirdparty/jsgettext/Gettext.js "$TARGETDIR/lib/jsgettext/"
105else
106 echo "could not find Gettext.js"
107 exit 1
108fi