scripts: fix unterminated quoted string in create-uninstalled-setup.sh
[platform/upstream/gstreamer.git] / scripts / create-uninstalled-setup.sh
1 #!/bin/sh
2 # ----------------------------------------------------------------------------
3 #
4 # create-uninstalled-setup.sh
5 #
6 # Little shell script that creates a fresh GStreamer uninstalled setup in
7 # your home directory.
8 #
9 # ----------------------------------------------------------------------------
10 #
11 # Copyright (C) 2011-2012 Tim-Philipp Muller <tim centricular net>
12 #
13 # This script is free software; you can redistribute it and/or
14 # modify it under the terms of the GNU Library General Public
15 # License as published by the Free Software Foundation; either
16 # version 2 of the License, or (at your option) any later version.
17 #
18 # This library is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21 # Library General Public License for more details.
22 #
23 # You should have received a copy of the GNU Library General Public
24 # License along with this library; if not, write to the
25 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26 # Boston, MA 02111-1307, USA.
27 #
28 # ----------------------------------------------------------------------------
29
30 set -e
31
32 # set BRANCH to "0.10" for a GStreamer 0.10.x checkout
33 BRANCH="master"
34
35 # set to "ssh" if you have a developer account and ssh access
36 GIT_ACCESS="anongit"
37
38 # git modules to clone
39 MODULES="gstreamer gst-plugins-base gst-plugins-good gst-plugins-ugly gst-plugins-bad gst-ffmpeg"
40
41 # note: we use ~/gst because that's what the gst-uninstalled script
42 # uses by default, so don't just change that to something else
43 UNINSTALLED_ROOT=~/gst
44
45 echo "==========================================================================================="
46 echo "Creating new GStreamer uninstalled environment for branch $BRANCH in $UNINSTALLED_ROOT ... "
47 echo "==========================================================================================="
48
49 mkdir -p $UNINSTALLED_ROOT
50 mkdir -p $UNINSTALLED_ROOT/$BRANCH
51
52 mkdir -p $UNINSTALLED_ROOT/$BRANCH/prefix
53
54
55 echo ""
56 echo "Checking basic build tools and dependencies are installed..."
57 echo ""
58
59 if ! pkg-config --version 2>/dev/null >/dev/null; then
60   DEPS_OK="no"
61 elif ! pkg-config --exists glib-2.0 orc-0.4 2>/dev/null >/dev/null; then
62   DEPS_OK="no"
63 elif ! bison --version 2>/dev/null >/dev/null; then
64   DEPS_OK="no"
65 elif ! flex --version 2>/dev/null >/dev/null; then
66   DEPS_OK="no"
67 else
68   DEPS_OK="yes"
69 fi
70
71 if test "$DEPS_OK" != "yes"; then
72 echo "==========================================================================================="
73 echo ""
74 echo "  Some very basic build tools or dependencies are missing."
75 echo ""
76 echo "  Please visit"
77 echo ""
78 echo "      http://gstreamer.freedesktop.org/wiki/BuildDependenciesDebianUbuntu"
79 echo ""
80 echo "         or"
81 echo ""
82 echo "      http://gstreamer.freedesktop.org/wiki/Fedora"
83 echo ""
84 echo "  for instructions how to install them."
85 echo ""
86 echo "==========================================================================================="
87 fi
88
89
90 cd $UNINSTALLED_ROOT/$BRANCH
91
92 for m in $MODULES
93 do
94   if test "$GIT_ACCESS" = "ssh"; then
95     git clone ssh://git.freedesktop.org/gstreamer/$m
96   else
97     git clone git://anongit.freedesktop.org/gstreamer/$m
98   fi
99
100   cd $m
101   if test "$BRANCH" != "master"; then
102     git checkout -b $BRANCH origin/$BRANCH
103   fi
104   cd ..
105 done
106
107 cd $UNINSTALLED_ROOT
108 ln -s $BRANCH/gstreamer/scripts/gst-uninstalled gst-$BRANCH
109 chmod +x gst-$BRANCH
110
111 cd ~
112
113 echo "==========================================================================================="
114 echo
115 echo "Done. Created new GStreamer uninstalled environment for branch $BRANCH in $UNINSTALLED_ROOT"
116 echo
117 echo "To enter the uninstalled environment do: cd $UNINSTALLED_ROOT; ./gst-$BRANCH"
118 echo
119 echo "To leave the uninstalled environment do: exit"
120 echo
121 echo "To check the uninstalled environment do: printenv | grep GST"
122 echo "    (loads of output = you're in the uninstalled environment)"
123 echo
124 echo "==========================================================================================="
125 echo
126 echo "Now compile all GStreamer modules one by one by first switching into"
127 echo "the uninstalled environment and then doing:"
128 echo
129 echo "    cd <MODULE>; ./autogen.sh; make"
130 echo
131 echo "First gstreamer, then gst-plugins-base, then the other modules."
132 echo "You do not need to do 'make install'"
133 echo
134 echo "==========================================================================================="
135 echo
136 echo "If your system GLib is too old, you can install a newer version"
137 echo "into --prefix=$UNINSTALLED_ROOT/$BRANCH/prefix and it should be picked up"
138 echo "by autogen.sh/configure"
139 echo
140 echo "==========================================================================================="
141 echo
142 echo "Also see http://gstreamer.freedesktop.org/wiki/UninstalledSetup"
143 echo
144 echo "==========================================================================================="
145