#!/bin/bash # # gstreamer-plugins-base.SlackBuild # code: Vicious (michal@scxd.info); improvements: Zielony (e-pl@o2.pl) set -e # PACKAGE GENERAL INFO [EDIT] # Wymaga: gstreamer, liboil. PKGNAME=gstreamer-plugins-base VERSION=0.10.19 BUILD=1X ARCH=i686 URL=http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-$VERSION.tar.bz2 CWD=`pwd` TMP=/tmp/$PKGNAME PKG=$TMP/package if [ -e $TMP/$PKGNAME-$VERSION/'Makefile' ]; then cd $TMP/$PKGNAME-$VERSION make else if [ ! -d $TMP/$PKGNAME-$VERSION ]; then rm -rf $PKG mkdir -p $PKG/install # PACKAGE DESCRIPTION [EDIT] cat << 'SLACKDESC' | fmt -w $(( 80 - `echo $PKGNAME | wc -c` - 3 )) | perl -pe "s/^/$PKGNAME: /" > $PKG/install/slack-desc GStreamer Plugins Base (GStreamer plugins) GStreamer Base Plug-ins is a well-groomed and well-maintained collection of GStreamer plug-ins and elements, spanning the range of possible types of elements one would want to write for GStreamer. It also contains helper libraries and base classes useful for writing elements. A wide range of video and audio decoders, encoders, and filters are included. Package prepared by Zielony (e-pl@o2.pl) SLACKDESC cd $TMP # step 1: DOWNLOAD SOURCE case "${URL//*\/}" in *.tar.bz2) EXTENSION="tar.bz2"; DECOMPRESS="tar jxvf" ;; *.tar.gz) EXTENSION="tar.gz"; DECOMPRESS="tar zxvf" ;; *.zip) EXTENSION="zip"; DECOMPRESS="unzip" ;; esac PKGFNAME="$PKGNAME-$VERSION.$EXTENSION" ( wget -c $URL -P $TMP -O $PKGFNAME ) # step 2: UNPACK SOURCE AND PREPARE PACKAGE $DECOMPRESS $PKGFNAME DIRNAME=`ls -c | head -1 | cut -d / -f 1` if [ "$DIRNAME" != "$PKGNAME-$VERSION" ]; then mv $DIRNAME $PKGNAME-$VERSION; fi chown root:root $TMP -R fi cd $TMP/$PKGNAME-$VERSION case "$ARCH" in "i686") SLKCFLAGS="-O2 -march=i686 -mtune=i686" ;; "i486") SLKCFLAGS="-O2 -march=i486 -mtune=i686" ;; "i386") SLKCFLAGS="-O2 -march=i386 -mcpu=i686" ;; "s390") SLKCFLAGS="-O2" ;; "x86_64") SLKCFLAGS="-O2" ;; *) SLKCFLAGS="-O2" ;; esac if [ -s 'configure' ]; then CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" ./configure \ --prefix=/usr \ --disable-debug \ --disable-static \ --mandir=/usr/man \ --sysconfdir=/etc \ --program-prefix="" \ --program-suffix="" \ $ARCH-slackware-linux fi make fi make install DESTDIR=$PKG for i in $PKG/usr/bin/*-`echo $VERSION | perl -pe 's/^([0-9]+\.[0-9]+)\.?.*/$1/'`; do mv -f $i ${i%-*} done for i in $PKG/usr/man/*/*-`echo $VERSION | perl -pe 's/^([0-9]+\.[0-9]+)\.?.*/$1/'`.1; do mv -f $i ${i%-*} done rm -rf $PKG/usr/share/gtk-doc # step 3: STRIP BINARIES & GZIP MANUALS 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" | grep ELF | cut -f 1 -d : \ | xargs strip --strip-debug 2> /dev/null ) find $PKG/usr -regex '.+/man/\(.+?/\)?man./.+' -exec gzip -9 \{} \; # step 4: CREATE PACKAGE & CLEAN TMP if [ `find . | wc -l` -le 1 ]; then echo "Brak plików pakietu!" else ( requiredbuilder -y -s $PKG/install $PKG ) makepkg -l y -c n $CWD/$PKGNAME-$VERSION-$ARCH-$BUILD.tgz if [ "$1" != "-nc" ]; then rm -rf $TMP; fi fi