#!/bin/sh # Heavily based on the Slackware 14.2 SlackBuild # Written by Loris Vincenzi (http://www.slacky.eu) # Last build from Matteo Rossini ( zerouno at slacky dot it ) # Slackware build script for skype # Official Site: http://www.skype.com/ # # 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. set -e SLACK=${SLACK:-14.2} # if do you have slackware current: SLACK=current USEPATCHES=${USEPATCHES:-yes} # on slackware stable uses /patches tree; set to 'no' to not use patched packages # ignored on slackware current PKGNAME=skype_static VERSION=${VERSION:-4.3.0.37} BUILD=${BUILD:-4} TAG=${TAG:-sl} ARCH=${ARCH:-x86_64} SOURCE=http://download.skype.com/linux/skype-$VERSION.tar.bz2 # Slackware Utah mirror is so fast ;) LIBS=${LIBS:-http://slackware.cs.utah.edu/pub/slackware/slackware-$SLACK} # if do you have a slackware dvd: LIBS=/mnt/cdrom (not tested) TAR= DIR=skype-$VERSION DOCS="LICENSE README" SLKFILES="libraries.txt usr-bin-skype" if [ -e EULA.TXT ];then more EULA.TXT echo "Do you accept terms? (yes/[no])" read ACCEPT if [ "$ACCEPT" != "yes" ];then echo; echo "SlackBuild Aborted!!" exit 1 fi fi JOBS=${JOBS:--j2} CWD=$(pwd) TMP=${TMP:-/tmp/buildpkgs/$PKGNAME} PKG=${PKG:-$TMP/package-$PKGNAME} OUTPUT=${OUTPUT:-$CWD} TAR=${TAR:-$(basename $SOURCE)} DIR=${DIR:-$(echo "$TAR"|sed -r 's/(\.tar|)(.gz|.bz2|.xz|)$//')} LIB=$TMP/libraries DOCS="$DOCS $LIB/CHECKSUMS.md5 $LIB/ChangeLog.txt $LIB/release.txt" if [ ! -e "$CWD/$TAR" ];then wget "$SOURCE" -O "$CWD/$TAR" fi if echo "$*"|grep -w -q -- --continue;then echo "Resuming..." /sbin/ldconfig -n -r $PKG -v -N /usr/share/skype/lib32 else rm -rf $PKG fi mkdir -p $TMP $PKG $OUTPUT $LIB cd $LIB CHECKSUMS=$LIB/CHECKSUMS.md5-tmp #rm -f $CHECKSUMS if [ ${LIBS:0:1} == "/" ];then cp $LIBS/CHECKSUMS.md5 . cp $LIBS/ChangeLog.txt . else wget -N $LIBS/CHECKSUMS.md5 wget -N $LIBS/ChangeLog.txt fi date > release.txt echo "Slackware version: $SLACK" >> release.txt if [ "$USEPATCHES" == "no" ];then cat CHECKSUMS.md5 |grep -v /patches/|grep "\.t?z$" >$CHECKSUMS else echo "Slackware ChangeLog: $(head -1 ChangeLog.txt)" >> release.txt cat CHECKSUMS.md5|grep "\.t.z$" > $CHECKSUMS fi echo "Skype package name: $PKGNAME-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}" >> release.txt ( cd $CWD ; md5sum libraries.txt ) >> release.txt mkdir -p $PKG/usr/share/skype/lib32 cat $CWD/libraries.txt|sed 's/#.*//'|grep ^[a-z]|while read SLPKG LIBRARY COMMENT;do printf "Install library %-25s from %-20s : " $LIBRARY $SLPKG PPATH=$(grep /$SLPKG-[0-9] CHECKSUMS.md5 |grep txz$|awk '{print $2}') PTXZ=$(basename $PPATH) PSUM=$(grep /$SLPKG-[0-9] CHECKSUMS.md5 |grep txz$|awk '{print $1}') if [ -e $PTXZ ];then if ! md5sum $PTXZ|grep -q $PSUM ;then rm $PTXZ fi fi if [ ! -e $PTXZ ];then if [ ${LIBS:0:1} == "/" ];then cp $LIBS/$PPATH $PTXZ else wget $LIBS/$PPATH -O $PTXZ fi fi if ! md5sum $PTXZ|grep -q $PSUM;then echo "ABORT! MD5 DOES NOT MATCH ($PTXZ)." exit 1 fi ls $PKG/usr/share/skype/lib32/${LIBRARY/\/$/} >/dev/null 2>&1 && { echo ; continue ; } FILE=$(tar tf $PTXZ | grep /$LIBRARY||true) if [ -z "$FILE" ];then echo "ABORT! Library $LIBRARY not found in $PTXZ" exit 1 else echo $FILE fi tar xf $PTXZ $FILE mv $FILE $PKG/usr/share/skype/lib32 done echo "Building links:" /sbin/ldconfig -n -r $PKG -v -N /usr/share/skype/lib32 cd $TMP tar xvf $CWD/$TAR cd $DIR chown -R root:root . chmod -R u+w,go+r-w,a-s . mkdir -p $PKG/usr/bin cat $CWD/usr-bin-skype > $PKG/usr/bin/skype chmod 755 $PKG/usr/bin/skype cp -a skype $PKG/usr/share/skype mkdir -p $PKG/etc/dbus-1/system.d cp skype.conf $PKG/etc/dbus-1/system.d mkdir -p $PKG/usr/share/skype cp -a sounds avatars lang $PKG/usr/share/skype mkdir -p $PKG/usr/share/applications cp -a skype.desktop $PKG/usr/share/applications mkdir -p $PKG/usr/share/icons/hicolor/16x16/apps mkdir -p $PKG/usr/share/icons/hicolor/32x32/apps mkdir -p $PKG/usr/share/icons/hicolor/48x48/apps ( cd icons cp -a SkypeBlue*16*.png $PKG/usr/share/icons/hicolor/16x16/apps/skype.png cp -a SkypeBlue*32*.png $PKG/usr/share/icons/hicolor/32x32/apps/skype.png cp -a SkypeBlue*48*.png $PKG/usr/share/icons/hicolor/48x48/apps/skype.png ) # Documentations mkdir -p $PKG/usr/doc/$PKGNAME-$VERSION cp -r $DOCS $PKG/usr/doc/$PKGNAME-$VERSION mkdir -p $PKG/usr/doc/$PKGNAME-$VERSION/SlackBuild cd $CWD for SB in $PKGNAME.SlackBuild slack-desc doinst.sh doinst.sh.gz EULA.TXT $SLKFILES;do [ -e $SB ]&&cp -r $SB $PKG/usr/doc/$PKGNAME-$VERSION/SlackBuild/$SB done if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done ) fi mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc [ -e $CWD/doinst.sh ] && cat $CWD/doinst.sh > $PKG/install/doinst.sh [ -e $CWD/doinst.sh.gz ] && zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PKGNAME-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz} cp $LIB/release.txt $OUTPUT/ if [ "$1" = "--cleanup" ]; then rm -rf $TMP fi