#!/bin/sh # Heavily based on the Slackware 12.0 SlackBuild # http://www.xmms.org # Packagers: # originally create by Gohanz (Andrea Sciucca) after big changes and patch by Submax (Massimo Cavalleri) # http://www.slacky.eu # Requirements: alsa, esound, libmikmod, libvorbis, mesa3d NAME=xmms VERSION=1.2.11 PKG_VERSION=$(echo $VERSION | sed 's/\-/\_/g') ARCH=${ARCH:-i486} BUILD=1ultra TMP=${TMP:-/tmp/tgz} PKG=$TMP/package-$NAME CWD=`pwd` CHOST=i486 if [ -z "$(echo $VERSION | grep "cvs")" ]; then SOURCE=http://xmms.org/files/1.2.x/$NAME-$VERSION.tar.gz else SOURCE=http://havardk.xmms.org/dist/cvs/$NAME-$VERSION.tar.gz fi SOURCE_EQ=http://www.xmms.org/misc/winamp_presets.gz if [ ! -e $NAME-$VERSION.tar.gz ]; 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 ;; "athlon64") SLKCFLAGS="-O2 -march=athlon64 -pipe" ; SLKLIBDIR=lib ; CHOST=i486 ;; "athlonxp") SLKCFLAGS="-O3 -march=athlon-xp -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 2> /dev/null mkdir -p $PKG rm -rf $TMP/$NAME-$VERSION 2> /dev/null # extract source and create tmp compile directory cd $TMP tar xvzf $CWD/$NAME-$VERSION.tar.gz echo -e "\E[0;32m+------------------------------+\E[0;0m" echo -e "\E[0;32m| Start SlackBuild $NAME-$VERSION |\E[0;0m" echo -e "\E[0;32m+------------------------------+\E[0;0m" 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 {} \; # apply my mod on function "equalizerwin_read_presets" in source file xmms/equalizer.c # This, add an system path for insert the presets predefined "{prefix}/share/xmms". # It does not eliminate the possibility to define presets of the user ("./xmms/eq.preset"). # If these are existing, the presets predefined are ignored and are loaded those of the user. zcat $CWD/xmms-1.2.10-add-default-presets-v0.1.patch.gz | patch -p0 --verbose --backup --suffix=.orig || exit 1 # alsa output plugin is default choice if there is not ~./xmms/config for current user (thanks fedora for this patch) zcat $CWD/xmms-1.2.10_outputplugin-default-is-alsa.patch.gz | patch -p1 --verbose --backup --suffix=.orig || exit 2 # set default skin if there is not ~./xmms/config for current user (thanks fedora for this patch) zcat $CWD/xmms-1.2.8_default-skin.patch.gz | patch -p1 --verbose --backup --suffix=.orig || exit 3 # ONLY if you compile on x86_64 (thanks slamd64 for this patch) if [ "$ARCH" = "x86_64_slamd64" ]; then zcat $CWD/xmms-1.2.10_x86_64.patch.gz | patch -p1 --verbose --backup --suffix=.orig || exit 5 fi # replace taskbar icon # IMP: file image xpm must start with string: "/* XPM */ static char * xmms_mini_xpm[] = {" # because in the source xpm file is included and this line declare the variable xmms_mini_xpm if [ ! -z "$(which convert)" ] && [ -x "$(which convert)" ]; then ( cd xmms mv xmms_mini.xpm xmms_mini.xpm.orig # The original size of xmms_mini.xpm is 16x16 but more big size don't seem create problems # convert $CWD/xmms-128x128.png -resize 16x16 xmms_mini_xpm.xpm convert $CWD/xmms-128x128.png xmms_mini_xpm.xpm mv xmms_mini_xpm.xpm xmms_mini.xpm ) fi LDFLAGS="-L/usr/$SLKLIBDIR -L/$SLKLIBDIR" \ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/$SLKLIBDIR \ --sysconfdir=/etc \ --localstatedir=/var \ --mandir=/usr/man \ --disable-static \ --enable-shared \ --enable-simd \ --enable-ipv6 \ --program-prefix= \ --program-suffix= \ --build=$CHOST-slackware-linux make -j3 || exit 666 make install DESTDIR=$PKG # strip ( 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 find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs strip -g 2> /dev/null ) # skins mkdir -p $PKG/usr/share/xmms/Skins ( cd $PKG/usr/share/xmms/Skins tar xzf $CWD/my_xmms_skins.tar.gz ) # insert default presets equalizer, thanks submax patch! ;) ( cd $PKG/usr/share/xmms/ gunzip -c $CWD/winamp_presets.gz > eq.preset cp eq.preset eq.auto_preset ) # doc mkdir -p $PKG/usr/doc/$NAME-$PKG_VERSION cp -a ABOUT-NLS AUTHORS COPYING ChangeLog FAQ INSTALL NEWS README TODO $PKG/usr/doc/$NAME-$PKG_VERSION mkdir -p $PKG/usr/doc/$NAME-$PKG_VERSION/SlackBuild cat $CWD/slack-desc > $PKG/usr/doc/$NAME-$PKG_VERSION/SlackBuild/slack-desc cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$PKG_VERSION/SlackBuild/$NAME.SlackBuild cp $CWD/*.patch.gz $PKG/usr/doc/$NAME-$PKG_VERSION/SlackBuild # man page # patch for add description for files of presets by submax (cd $PKG zcat $CWD/xmms-1.2.10_man-for-presets-and-default-presets.patch.gz | patch -p1 --verbose || exit 11 ) # compress gzip -9 $PKG/usr/man/*/* # new entry desktop enviroment menu and new icon mkdir -p $PKG/usr/share/pixmaps mkdir -p $PKG/usr/share/applications cp -a $CWD/xmms-128x128.png $PKG/usr/share/pixmaps/xmms.png cp $CWD/$NAME.desktop $PKG/usr/share/applications/ # # If you use fix "export LC_ALL=C" for run more quickly command "sort" and after run xmms on the same shell, this starts with english # language instead with this method, xmms starts with correct system language also you don't reload correct value on the system variable LC_ALL. # This is common situation for run more speed removepkg / upgradepkg on slackware system for install very amount of packages. # es.: If you want to see xmms (run on new shell) in your language when you want to listen the music while install gnome-slacky ;) # # xmms is the script that setting of xmms language # xmms.bin is very binary of xmms # # fix by fedora for https://bugzilla.redhat.com/213172 and http://bugs.xmms.org/show_bug.cgi?id=1907 # enabling transparency in X.org with Extensions Composite and after run xmms select Options->Double Size, I get the following error: # Gdk-ERROR **: BadMatch (invalid parameter attributes) # serial 407 error_code 8 request_code 2 minor_code 0 # # use exec for kill shell that start xmms after close xmms # # WMXMMS is a dock applet for the Window Maker window manager. From the applet you can start and control xmms. # for i_bin in xmms wmxmms ; do mv $PKG/usr/bin/$i_bin $PKG/usr/bin/$i_bin.bin cat << EOF > $PKG/usr/bin/$i_bin #!/bin/bash if [ -z "\$XLIB_SKIP_ARGB_VISUALS" ] ; then exec env XLIB_SKIP_ARGB_VISUALS=1 LANGUAGE=\$LANG LC_ALL=\$LANG /usr/bin/$i_bin.bin "\$@" else exec env LANGUAGE=\$LANG LC_ALL=\$LANG /usr/bin/$i_bin.bin "\$@" fi EOF chmod 755 $PKG/usr/bin/$i_bin done # slack-desc and doinst.sh mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc # build tgz's 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-$PKG_VERSION-$ARCH-$BUILD.tgz # checksum and desc (cd $CWD/.. md5sum $NAME-$PKG_VERSION-$ARCH-$BUILD.tgz > $NAME-$PKG_VERSION-$ARCH-$BUILD.tgz.md5 cat $PKG/install/slack-desc | grep "^$NAME" > $NAME-$PKG_VERSION-$ARCH-$BUILD.txt ) # optional clean if [ "$1" = "--cleanup" ]; then if [ "$TMP" != "/" ]; then rm -rf $TMP fi fi