summaryrefslogtreecommitdiff
path: root/audio/mp3val/mp3val.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'audio/mp3val/mp3val.SlackBuild')
-rw-r--r--audio/mp3val/mp3val.SlackBuild75
1 files changed, 62 insertions, 13 deletions
diff --git a/audio/mp3val/mp3val.SlackBuild b/audio/mp3val/mp3val.SlackBuild
index 02a20b919a..8c52ef54bb 100644
--- a/audio/mp3val/mp3val.SlackBuild
+++ b/audio/mp3val/mp3val.SlackBuild
@@ -1,9 +1,23 @@
#!/bin/sh
+
# Written by Benjamin Trigona-Harany <slackbuilds@jaxartes.net>
+# Modified by B. Watson <yalhcru@gmail.com>
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+# 20140921 bkw: bump BUILD to 2
+# - took over maintenance
+# - add man page
+# - add mp3valgui and GUI=no to disable it
+# - make SLKCFLAGS actually get used
+# - patch to fix -Wwrite-strings warnings, future-proofing since this may
+# become an error someday.
+# - minor script cleanups
+
PRGNAM=mp3val
VERSION=${VERSION:-0.1.8}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -35,29 +49,64 @@ fi
set -e
+SRCNAM=$PRGNAM-$VERSION-src
+
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION-src.tar.gz # source file comes with -src appended
-mv $PRGNAM-$VERSION-src $PRGNAM-$VERSION # .tar extracts to directory with -src appended
-cd $PRGNAM-$VERSION
-mv Makefile.linux Makefile
+rm -rf $SRCNAM
+tar xvf $CWD/$SRCNAM.tar.gz
+cd $SRCNAM
+# upstream's permissions are horrid, please don't change this to boilerplate
chown -R root:root .
chmod 644 *
-CXXFLAGS="$SLKCFLAGS" \
-make
-strip --strip-unneeded mp3val
+# this isn't strictly necessary for Slack 14.1, but at some point these
+# warnings might possibly become errors in some future version of gcc.
+patch -p1 < $CWD/fix_compile_warnings.diff
+make -f Makefile.linux CXXFLAGS="$SLKCFLAGS"
mkdir -p $PKG/usr/bin
-cp mp3val $PKG/usr/bin
+install -s -m0755 $PRGNAM $PKG/usr/bin
+
+# man page converted from manual.html with html2pod | pod2man
+mkdir -p $PKG/usr/man/man1
+gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
+
+# package the GUI unless disabled
+if [ "${GUI:-yes}" = "yes" ]; then
+ GUINAME=${PRGNAM}gui
+ GUIVER=${GUIVER:-0.1.1}
+ unzip $CWD/$GUINAME-$GUIVER.zip
+ cd $GUINAME
+
+ # damn thing expects to find its .glade file somewhere in $PATH or the
+ # current dir. Let's use /usr/share/mp3valgui/ instead.
+ sed -i \
+ '/gladefile *= *locate/s,=.*,= "/usr/share/'$GUINAME/$GUINAME.glade'",' \
+ $GUINAME.py
+
+ mkdir -p $PKG/usr/share/$GUINAME
+ install -m0755 $GUINAME.py $PKG/usr/bin/$GUINAME
+ cat $GUINAME.glade > $PKG/usr/share/$GUINAME/$GUINAME.glade
+
+ # .desktop taken from mandriva's mp3valgui-0.1.1-1mdv2007.1.noarch.rpm
+ # and modified.
+ mkdir -p $PKG/usr/share/applications
+ cat $CWD/$GUINAME.desktop > $PKG/usr/share/applications/$GUINAME.desktop
+
+ # .xpm icon is a modified copy of windowmaker's Microphone.xpm
+ mkdir -p $PKG/usr/share/pixmaps
+ cat $CWD/$GUINAME.xpm > $PKG/usr/share/pixmaps/$GUINAME.xpm
+
+ mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/$GUINAME-$GUIVER
+ cp -a AUTHORS COPYING NEWS $PKG/usr/doc/$PRGNAM-$VERSION/$GUINAME-$GUIVER
+ cd -
+fi
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a \
- changelog.txt manual.html \
- $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a changelog.txt manual.html $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install