#!/bin/sh # Heavily based on the Slackware 12.0 SlackBuild # Packager and Patch preset by Submax (Massimo Cavalleri) # http://audacious-media-player.org/Main_Page # http://www.slacky.eu # Requirements: autoconf, automake, gtk+2, libglade, mcs, libmowgli NAME=audacious VERSION=1.4.6 VERSION_PKG=$(echo $VERSION | sed "s/-//g") ARCH=${ARCH:-i486} BUILD=${BUILD:-1ultra} TMP=${TMP:-/tmp/tgz} PKG=$TMP/package-$NAME CWD="$(pwd)" CHOST=i486 SOURCE=http://distfiles.atheme.org/$NAME-$VERSION.tgz SOURCE_EQ=http://www.xmms.org/misc/winamp_presets.gz # download source if [ ! -e $NAME-$VERSION.tgz ]; then wget -c $SOURCE || exit 1 fi if [ ! -e winamp_presets.gz ]; then wget -c $SOURCE_EQ || exit 1 fi # CHOST arch should be set to i486 for any 32-bit x86, unless # you want problems finding your compiler. case $ARCH in "i486") SLKCFLAGS="-O2 -march=i486 -mtune=i686" ; SLKLIBDIR=lib ; CHOST=i486 ;; "i686") SLKCFLAGS="-O3 -march=i686 -pipe -fomit-frame-pointer" ; SLKLIBDIR=lib ; CHOST=i486 ;; "x86_64_slamd64") SLKCFLAGS="-O2" ; SLKLIBDIR=lib64 ; CHOST=x86_64 ;; # multilib /lib and /lib64 "x86_64") SLKCFLAGS="-O2" ; SLKLIBDIR=lib ; CHOST=x86_64 ;; # pure /lib only es. sflack "s390") SLKCFLAGS="-O2" ; SLKLIBDIR=lib ; CHOST=s390 ;; esac # clean necessary before compile after old run rm -rf $PKG mkdir -p $PKG rm -rf $TMP/$NAME-$VERSION # extract source cd $TMP tar xzvf "$CWD"/$NAME-$VERSION.tgz cd $NAME-$VERSION # Make sure ownerships and permissions are sane chown -R root:root . find . -perm 666 -exec chmod 644 {} \; find . -perm 664 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; find . -perm 400 -exec chmod 644 {} \; find . -perm 440 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; ## PATCHES ## # # apply my mod on function "equalizerwin_read_presets" in source file audacious-1.4.0-dr1/src/audacious/ui_equalizer.c # This, add an system path for insert the presets predefined. # It does not eliminate the possibility to define presets of the user (~/.local/share/audacious/presets/eq.preset | ~/.config/audacious/eq.preset). # If these are existing, the presets predefined are ignored and are loaded those of the user. # # this patch is already insert on 1.4.0-dr2 or last version!!! # # zcat "$CWD"/audacious-1.4.0-dr1_add-default-presets-v0.1.patch.gz | patch -p0 --verbose --backup --suffix=.orig || exit 1 # ## END PATCHES ## # Compile LDFLAGS="-L/usr/$SLKLIBDIR -L/$SLKLIBDIR" \ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/$SLKLIBDIR \ --sysconfdir=/etc \ --mandir=/usr/man \ --enable-ipv6 \ --enable-chardet \ --program-prefix= \ --program-suffix= \ --build=$CHOST-slackware-linux make -j4 || exit 1 make install DESTDIR=$PKG || exit 1 # Strip binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # add skins mkdir -p $PKG/usr/share/audacious/Skins ( cd $PKG/usr/share/audacious/Skins tar xzf "$CWD"/my_audacious_skins.tar.gz ) # insert default presets equalizer, thanks submax patch! ;) ( cd $PKG/usr/share/audacious/ gunzip -c "$CWD"/winamp_presets.gz > eq.preset cp eq.preset eq.auto_preset ) # Add a documentation directory mkdir -p $PKG/usr/doc/$NAME-$VERSION_PKG cp -a ABOUT-NLS AUTHORS COPYING FAQ.bmp INSTALL NEWS README $PKG/usr/doc/$NAME-$VERSION_PKG mkdir $PKG/usr/doc/$NAME-$VERSION_PKG/SlackBuild cat "$CWD"/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION_PKG/SlackBuild/$NAME.SlackBuild cat "$CWD"/slack-desc > $PKG/usr/doc/$NAME-$VERSION_PKG/SlackBuild/slack-desc cp "$CWD"/*.patch.gz $PKG/usr/doc/$NAME-$VERSION_PKG/SlackBuild/ gzip -9 $PKG/usr/man/*/* # install directory mkdir -p $PKG/install # $PKG/install/doinst.sh is auto-create from makepkg cat "$CWD"/slack-desc > $PKG/install/slack-desc # build package cd $PKG chown -R root:root $PKG if [ -x "$(which requiredbuilder)" ]; then requiredbuilder -y -v -s "$CWD" $PKG fi makepkg -l y -c n "$CWD"/../$NAME-$VERSION_PKG-$ARCH-$BUILD.tgz # checksum and desc (cd "$CWD"/.. md5sum $NAME-$VERSION_PKG-$ARCH-$BUILD.tgz > $NAME-$VERSION_PKG-$ARCH-$BUILD.tgz.md5 cat $PKG/install/slack-desc | grep "^$NAME" > $NAME-$VERSION_PKG-$ARCH-$BUILD.txt ) # optional clean if [ "$1" = "--cleanup" ]; then if [ "$TMP" != "/" ]; then rm -rf $TMP fi fi