aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--multimedia/youtube-viewer/README25
-rw-r--r--multimedia/youtube-viewer/doinst.sh4
-rw-r--r--multimedia/youtube-viewer/slack-desc2
-rw-r--r--multimedia/youtube-viewer/youtube-viewer.SlackBuild53
-rw-r--r--multimedia/youtube-viewer/youtube-viewer.info6
5 files changed, 71 insertions, 19 deletions
diff --git a/multimedia/youtube-viewer/README b/multimedia/youtube-viewer/README
index 1b62324a7e55a..ac1d143ce431e 100644
--- a/multimedia/youtube-viewer/README
+++ b/multimedia/youtube-viewer/README
@@ -1,3 +1,22 @@
-Youtube Viewer is a CLI application dedicated for searching and streaming
-Youtube Videos with MPlayer. It has been written in Perl and plays videos
-from Youtube at the best quality available without using a flash player.
+youtube-viewer (browse YouTube videos from a terminal or GTK UI)
+
+Youtube Viewer is a dedicated application for searching, viewing, and
+downloading Youtube videos, using wget for downloading and MPlayer for
+viewing. It has been written in Perl and plays videos from Youtube at
+the best quality available without using a flash player.
+
+Optional dependencies:
+
+perl-gtk2 and perl-File-ShareDir - for gtk-youtube-viewer.
+perl-LWP-Protocol-https - for https:// URL support.
+perl-Text-CharWidth - for better formatting in the terminal.
+
+This build always includes the command-line client (youtube-viewer). For
+the GTK client (gtk-youtube-viewer), install perl-gtk2 and
+perl-File-ShareDir before running this script. If you have them installed
+but don't want gtk-youtube-viewer, you can set GTK=no in the script's
+environment.
+
+To force gtk-youtube-viewer to use your preferred terminal for downloading
+with wget and watching in a terminal, set TERMINAL in the script's
+environment (e.g. TERMINAL="xterm" or TERMINAL="urxvt").
diff --git a/multimedia/youtube-viewer/doinst.sh b/multimedia/youtube-viewer/doinst.sh
new file mode 100644
index 0000000000000..696d35bad7e66
--- /dev/null
+++ b/multimedia/youtube-viewer/doinst.sh
@@ -0,0 +1,4 @@
+
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
diff --git a/multimedia/youtube-viewer/slack-desc b/multimedia/youtube-viewer/slack-desc
index d1d0ed0a9ce98..6b3f543618d58 100644
--- a/multimedia/youtube-viewer/slack-desc
+++ b/multimedia/youtube-viewer/slack-desc
@@ -6,7 +6,7 @@
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
-youtube-viewer: youtube-viewer (browse YouTube videos from a terminal)
+youtube-viewer: youtube-viewer (browse YouTube videos from a terminal or GTK UI)
youtube-viewer:
youtube-viewer: Youtube Viewer is a CLI application dedicated for searching and
youtube-viewer: streaming Youtube Videos with MPlayer. It has been written in Perl
diff --git a/multimedia/youtube-viewer/youtube-viewer.SlackBuild b/multimedia/youtube-viewer/youtube-viewer.SlackBuild
index 988074383df74..bd42589d08fb0 100644
--- a/multimedia/youtube-viewer/youtube-viewer.SlackBuild
+++ b/multimedia/youtube-viewer/youtube-viewer.SlackBuild
@@ -6,13 +6,12 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
-# Tarball gotten like so:
-# wget -O youtube-viewer-$(date +%Y%m%d).tar.gz http://trizen.googlecode.com/files/youtube-viewer.tar.gz
-# (the URL is always updated to the latest version, which is why I
-# mirrored a version on my site)
+# 20140318 bkw:
+# - Updated for 3.0.9 release
+# - Added support for gtk-youtube-viewer
PRGNAM=youtube-viewer
-VERSION=${VERSION:-20130203}
+VERSION=${VERSION:-3.0.9}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -50,9 +49,9 @@ DIRNAME=WWW-YoutubeViewer
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf $DIRNAME
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
-cd $DIRNAME
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$VERSION.tar.gz || tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION/$DIRNAME
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -60,7 +59,23 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-perl Build.PL prefix=/usr installdirs=vendor --destdir="$PKG"
+# perl-gtk2 is a runtime dep, we can build with GTK=yes even if it's not
+# installed... but don't do that by default.
+GTK="${GTK:-auto}"
+
+case "$GTK" in
+ no) BUILD_GTK="no" ;;
+ yes) BUILD_GTK="yes" ;;
+ *) perl -MGtk2 -MFile::ShareDir -e 0 2>/dev/null \
+ && BUILD_GTK="yes" \
+ || BUILD_GTK="no" ;;
+esac
+
+[ "$BUILD_GTK" = "yes" ] && GTKOPT="--gtk-youtube-viewer"
+
+echo "=== HAVE_GTK=$HAVE_GTK BUILD_GTK=$BUILD_GTK"
+
+perl Build.PL $GTKOPT prefix=/usr installdirs=vendor --destdir="$PKG"
./Build
./Build test
./Build install --install_path script=/usr/bin
@@ -68,9 +83,22 @@ perl Build.PL prefix=/usr installdirs=vendor --destdir="$PKG"
# I couldn't figure out what to pass to Build.PL or Build to install
# man pages correctly, so:
mv $PKG/usr/share/man $PKG/usr/man
-
-find $PKG/usr/man -type f -exec gzip -9 {} \;
-for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+gzip $PKG/usr/man/man?/*.?
+
+if [ "$BUILD_GTK" = "yes" ]; then
+ # link .desktop and icon to standard locations
+ mkdir -p $PKG/usr/share/applications $PKG/usr/share/pixmaps
+ LNPATH="../perl5/vendor_perl/auto/share/dist/WWW-YoutubeViewer"
+ ln -s $LNPATH/gtk-youtube-viewer.desktop \
+ $PKG/usr/share/applications/gtk-youtube-viewer.desktop
+ ln -s $LNPATH/gtk-youtube-viewer.png \
+ $PKG/usr/share/pixmaps/gtk-youtube-viewer.png
+
+ # support TERMINAL option for user's preferred terminal.
+ if [ "$TERMINAL" != "" ]; then
+ sed -i "s/'gnome-terminal'/'$TERMINAL', &/" $PKG/usr/bin/gtk-$PRGNAM
+ fi
+fi
find $PKG -name perllocal.pod \
-o -name ".packlist" \
@@ -85,6 +113,7 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/multimedia/youtube-viewer/youtube-viewer.info b/multimedia/youtube-viewer/youtube-viewer.info
index 125577a56b069..bcfeae08e66ee 100644
--- a/multimedia/youtube-viewer/youtube-viewer.info
+++ b/multimedia/youtube-viewer/youtube-viewer.info
@@ -1,9 +1,9 @@
PRGNAM="youtube-viewer"
-VERSION="20130203"
+VERSION="3.0.9"
HOMEPAGE="http://code.google.com/p/trizen/"
-DOWNLOAD="http://urchlay.naptime.net/~urchlay/src/youtube-viewer-20130203.tar.gz"
+DOWNLOAD="https://github.com/trizen/youtube-viewer/archive/3.0.9.tar.gz"
DOWNLOAD_x86_64=""
-MD5SUM="a36f6367ee26f7b6deb2e26857d1fee5"
+MD5SUM="ad81dd73efbd9ebfc2fc062158acf578"
MD5SUM_x86_64=""
REQUIRES="perl-data-dump"
MAINTAINER="B. Watson"