4 if test -z "$(which curl)"; then
5 echo "This script requires 'curl' - please install it" >&2
9 ###############################################################################
10 ### look-up architecture
13 i[3456789]86|x86|i86pc)
14 echo "Architecture is x86"
18 echo "Architecture is x86_64"
23 echo "ERROR: Unknown architecture `uname -m`" >&2
30 MULTIARCH="${MULTIARCH}-linux-gnu"
34 echo "ERROR: Platform `uname` is not supported by this script" >&2
39 echo "Multiarch triplet is '$MULTIARCH'"
42 ###############################################################################
43 ### install target directory
50 if test -z "$DUT"; then
55 if test ! -d "$DUT"; then
56 $ECHO "ERROR: '$DUT' is not a directory'"; >&2
61 if test ! -w "$DUT"; then
62 $ECHO "ERROR: no write permissions for '$DUT'" >&2
67 echo $PATH | grep -q "$DUT"
69 if test "$CHECKPATH" != "yes"; then
70 $ECHO "WARNING: '$DUT' is not in \$PATH" >&2
72 $ECHO "ERROR: '$DUT' is not in \$PATH" >&2
81 while test $(checkdir "$TARGETDIR" no) != 0 ; do
83 ARDOUR=$(ls -td /opt/Ardour* 2>/dev/null | head -n 1)
84 if test -n "${ARDOUR}" -a $(checkdir "${ARDOUR}/bin" no true) = 0; then
85 echo -n "found ardour installation in '${ARDOUR}/bin'. Install there? [Y|n] "
87 if test "$a" != "n" -a "$a" != "N"; then
88 TARGETDIR="${ARDOUR}/bin"
93 if test $(checkdir "/usr/bin" yes true) = 0; then
94 echo -n "Can write to '/usr/bin' Install there? [Y|n] "
96 if test "$a" != "n" -a "$a" != "N"; then
102 if test $(checkdir "${HOME}/bin" yes true) = 0; then
103 echo -n "Found '${HOME}/bin' in PATH. Install there? [Y|n] "
105 if test "$a" != "n" -a "$a" != "N"; then
106 TARGETDIR="${HOME}/bin"
111 if test $(checkdir "/usr/local/bin" yes true) = 0; then
112 echo -n "Can write to '/usr/local/bin' Install there? [Y|n] "
114 if test "$a" != "n" -a "$a" != "N"; then
115 TARGETDIR="/usr/local/bin"
121 echo "ERROR: Cannot find a suitable installation directory" >&2
122 echo "run: $0 /install/path/bin" >&2
123 echo "'/install/path/bin' must be an existing directory and should be in \$PATH" >&2
127 ###############################################################################
128 ### actual install procedure
130 echo "installing video-tools to '${TARGETDIR}'."
131 cd "$TARGETDIR" || exit 1
133 HARVID_VERSION=$(curl -s http://ardour.org/files/video-tools/harvid_version.txt)
134 echo "Downloading harvid-${MULTIARCH}-${HARVID_VERSION}."
135 curl -L --progress-bar \
136 http://ardour.org/files/video-tools/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz \
137 | tar -x -z --exclude=README --exclude=harvid.1 --strip-components=1 || exit 1
139 XJADEO_VERSION=$(curl -s http://ardour.org/files/video-tools/xjadeo_version.txt)
140 echo "Downloading xjadeo-${MULTIARCH}-${XJADEO_VERSION}."
141 curl -L --progress-bar \
142 http://ardour.org/files/video-tools/xjadeo-${MULTIARCH}-${XJADEO_VERSION}.tgz \
143 | tar -x -z --exclude=README --exclude=xjadeo.1 --strip-components=1 || exit 1
146 echo "ardour video tools installed successfully."