From afce3c05480d54686a2e44958822bfb4f8c0ca76 Mon Sep 17 00:00:00 2001 From: MagicMan Date: Tue, 11 May 2010 15:00:30 +0200 Subject: multimedia/streamtuner: Initial import --- multimedia/streamtuner/README | 4 + multimedia/streamtuner/doinst.sh | 5 + multimedia/streamtuner/slack-desc | 11 + .../streamtuner/streamtuner-0.99.99-live365.diff | 247 +++++++++++++++++++++ multimedia/streamtuner/streamtuner.SlackBuild | 92 ++++++++ multimedia/streamtuner/streamtuner.info | 8 + 6 files changed, 367 insertions(+) create mode 100644 multimedia/streamtuner/README create mode 100644 multimedia/streamtuner/doinst.sh create mode 100644 multimedia/streamtuner/slack-desc create mode 100644 multimedia/streamtuner/streamtuner-0.99.99-live365.diff create mode 100644 multimedia/streamtuner/streamtuner.SlackBuild create mode 100644 multimedia/streamtuner/streamtuner.info (limited to 'multimedia/streamtuner') diff --git a/multimedia/streamtuner/README b/multimedia/streamtuner/README new file mode 100644 index 0000000000..9b7e995d81 --- /dev/null +++ b/multimedia/streamtuner/README @@ -0,0 +1,4 @@ +streamtuner is a stream directory browser. Through the use of +a plugin system, it offers an intuitive GTK+ 2.0 interface to +Internet radio directories such as SHOUTcast and Live365. + diff --git a/multimedia/streamtuner/doinst.sh b/multimedia/streamtuner/doinst.sh new file mode 100644 index 0000000000..3412314ed0 --- /dev/null +++ b/multimedia/streamtuner/doinst.sh @@ -0,0 +1,5 @@ + +if [ -x usr/bin/update-desktop-database ]; then + ./usr/bin/update-desktop-database ./usr/share/applications >/dev/null 2>&1 +fi + diff --git a/multimedia/streamtuner/slack-desc b/multimedia/streamtuner/slack-desc new file mode 100644 index 0000000000..f309738e40 --- /dev/null +++ b/multimedia/streamtuner/slack-desc @@ -0,0 +1,11 @@ +streamtuner: streamtuner (Stream Directory Browser) +streamtuner: +streamtuner: streamtuner is a stream directory browser. Through the use of +streamtuner: a plugin system, it offers an intuitive GTK+ 2.0 interface to +streamtuner: Internet radio directories such as SHOUTcast and Live365. +streamtuner: +streamtuner: Homepage: http://www.nongnu.org/streamtuner/ +streamtuner: +streamtuner: +streamtuner: +streamtuner: diff --git a/multimedia/streamtuner/streamtuner-0.99.99-live365.diff b/multimedia/streamtuner/streamtuner-0.99.99-live365.diff new file mode 100644 index 0000000000..2000c3b663 --- /dev/null +++ b/multimedia/streamtuner/streamtuner-0.99.99-live365.diff @@ -0,0 +1,247 @@ +--- src/plugins/live365/live365.c.orig Wed May 11 03:49:30 2005 ++++ src/plugins/live365/live365.c Wed May 11 03:51:11 2005 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2002, 2003, 2004 Jean-Yves Lefort ++ * Copyright (C) 2002-2005 Jean-Yves Lefort + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -59,7 +59,9 @@ + { + ACCESS_ALL, + ACCESS_VIP, +- ACCESS_SUBSCRIPTION ++ ACCESS_SUBSCRIPTION, ++ ACCESS_SOLD_OUT, ++ ACCESS_UNKNOWN + } Access; + + typedef struct +@@ -94,7 +96,8 @@ + { + GList **streams; + Live365Stream *stream; +- Live365Stream *finished_stream; ++ gboolean first_page; ++ gboolean looped; + gboolean has_next_page; + } ReloadStreamsInfo; + +@@ -263,13 +266,16 @@ + + case FIELD_ACCESS_STRING: + { +- const char *str = NULL; ++ const char *str; + + switch (stream->access) + { + case ACCESS_ALL: str = _("All"); break; + case ACCESS_VIP: str = _("VIP"); break; + case ACCESS_SUBSCRIPTION: str = _("Subscription"); break; ++ case ACCESS_SOLD_OUT: str = _("Sold out"); break; ++ case ACCESS_UNKNOWN: str = _("Unknown"); break; ++ default: str = NULL; break; + } + + g_value_set_string(value, str); +@@ -707,14 +713,16 @@ + char *s1, *s2, *s3, *s4, *s5; + + if ((s1 = st_strstr_span(line, "')) + && (s5 = strstr(s4, ""))) + { + category = st_category_new(); + category->name = g_strndup(s2, s3 - s2); +- category->label = st_sgml_ref_expand_len(s4, s5 - s4); ++ category->label = ! strcmp(category->name, "Recommendations") ++ ? g_strdup(_("Recommendations")) ++ : st_sgml_ref_expand_len(s4, s5 - s4); + category->url_postfix = g_strconcat(DIRECTORY_PREFIX, category->name, NULL); + } + else if ((s1 = st_strstr_span(line, "looped) ++ return; ++ + if ((s1 = st_str_has_prefix_span(line, "stream->access = ACCESS_VIP; + else if (strstr(s2, "'SUBSCRIPTION'")) + info->stream->access = ACCESS_SUBSCRIPTION; ++ else if (strstr(s2, "'SOLD_OUT'")) ++ info->stream->access = ACCESS_SOLD_OUT; + else +- PARSE_ERROR; +- +- info->finished_stream = NULL; ++ { ++ PARSE_ERROR; ++ info->stream->access = ACCESS_UNKNOWN; ++ } + } + else if ((s1 = st_str_has_prefix_span(line, "")) +- && (s4 = strstr(s3, ""))) ++ && (s2 = st_strstr_span(s1, "href='")) ++ && (s3 = strstr(s2, "'>")) ++ && (s4 = strstr(s3, ""))) + { + if (info->stream) + { +@@ -865,12 +884,19 @@ + else + PARSE_ERROR; + } +- else if ((s1 = st_strstr_span(line, "&station_id=")) +- && (s2 = strchr(s1, '&'))) ++ else if ((s1 = st_str_has_prefix_span(line, "')) +- && (s3 = strstr(s2, ""))) +- { +- if (info->stream) +- { +- g_free(info->stream->broadcaster); +- info->stream->broadcaster = st_sgml_ref_expand_len(s2, s3 - s2); +- } +- else +- PARSE_ERROR; +- } + else if ((s1 = st_str_has_prefix_span(line, "')) +- && (s3 = strstr(s2, "
")) +- && ((s4 = strstr(s3, "stream) + { + word1 = st_sgml_ref_expand_len(s2, s3 - s2); +- s3 += 4; word2 = st_sgml_ref_expand_len(s3, s4 - s3); +- ++ + g_free(info->stream->audio); +- info->stream->audio = g_strdup_printf(g_str_has_prefix(s4, "") ? "%s %s" : "%s %s, MP3Pro", word2, word1); + +- g_free(word1); +- g_free(word2); ++ if (strstr(s3, "')) ++ && (s4 = strstr(s3, "
"))) ++ info->stream->description = st_sgml_ref_expand_len(s3, s4 - s3); ++ + ((STStream *) info->stream)->name = g_strdup_printf("%i", info->stream->station_id); + *(info->streams) = g_list_append(*(info->streams), info->stream); + } +@@ -962,23 +982,23 @@ + stream_free_cb(info->stream, NULL); + } + +- info->finished_stream = info->stream; + info->stream = NULL; + } + else + PARSE_ERROR; + } +- else if ((s1 = st_strstr_span(line, "')) +- && (s3 = strstr(s2, "
"))) +- { +- if (info->finished_stream) +- { +- info->finished_stream->description = st_sgml_ref_expand_len(s2, s3 - s2); +- info->finished_stream = NULL; ++ else if ((s1 = st_strstr_span(line, "Showing ")) ++ && (s3 = strchr(s2, '-'))) ++ { ++ word1 = g_strndup(s2, s3 - s2); ++ if (st_str_like(word1, ST_NUMERIC)) ++ { ++ int n = atoi(word1); ++ if (n == 1 && ! info->first_page) ++ info->looped = TRUE; + } +- else +- PARSE_ERROR; ++ g_free(word1); + } + else if (strstr(line, "Next
")) + info->has_next_page = TRUE; diff --git a/multimedia/streamtuner/streamtuner.SlackBuild b/multimedia/streamtuner/streamtuner.SlackBuild new file mode 100644 index 0000000000..0221721753 --- /dev/null +++ b/multimedia/streamtuner/streamtuner.SlackBuild @@ -0,0 +1,92 @@ +#!/bin/sh + +# Slackware build script for streamtuner + +# Copyright 2007 MagicMan +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Modified by the SlackBuilds.org project + +if [ "$(id -u)" != "0" ]; then + echo "This script must be run as root!" + exit 1 +fi + +PRGNAM=streamtuner +VERSION=0.99.99 +ARCH=${ARCH:-i486} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +CWD=`pwd` +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +PDOCS="AUTHORS COPYING INSTALL NEWS README TODO" + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" +fi + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP || exit 1 +rm -rf $PRGNAM-$VERSION +tar -xvf $CWD/$PRGNAM-$VERSION.tar.* || exit 1 +cd $PRGNAM-$VERSION || exit 1 + +# Apply streamtuner-0.99.99-live365.diff patch: +cat $CWD/$PRGNAM-$VERSION-live365.diff | patch -p0 --verbose || exit 1 + +chown -R root:root . +chmod -R u+w,go+r-w,a-s . + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + || exit 1 + +make || exit 1 +make install-strip DESTDIR=$PKG || exit 1 + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a $PDOCS $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +# Create link to html docs: +( cd $PKG/usr/doc/$PRGNAM-$VERSION + ln -s ../../share/gtk-doc/html/$PRGNAM html +) + +mkdir -p $PKG/install +cat $CWD/doinst.sh > $PKG/install/doinst.sh +cat $CWD/slack-desc > $PKG/install/slack-desc + +# Fix path to icon in desktop file: +sed -i 's#^Icon=\(.\+\)$#Icon=/usr/share/pixmaps/\1#' \ + $PKG/usr/share/applications/$PRGNAM.desktop || exit 1 + +cd $PKG +/sbin/makepkg -l y -c n -p $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz diff --git a/multimedia/streamtuner/streamtuner.info b/multimedia/streamtuner/streamtuner.info new file mode 100644 index 0000000000..bc8b3cc7aa --- /dev/null +++ b/multimedia/streamtuner/streamtuner.info @@ -0,0 +1,8 @@ +PRGNAM="streamtuner" +VERSION="0.99.99" +HOMEPAGE="http://www.nongnu.org/streamtuner/" +DOWNLOAD="http://savannah.nongnu.org/download/streamtuner/streamtuner-0.99.99.tar.gz" +MD5SUM="2027b7c34e85b594524b0b4351c14362" +MAINTAINER="MagicMan" +EMAIL="MagicMan07@bluebottle.com" +APPROVED="robw810" -- cgit v1.2.3-80-g2a13