wok rev 14650

Add get-libaacs
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Jun 04 11:51:18 2013 +0200 (2013-06-04)
parents 662b600e1688
children 726bbc1c6701
files get-libaacs/receipt get-libaacs/stuff/get-libaacs
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/get-libaacs/receipt	Tue Jun 04 11:51:18 2013 +0200
     1.3 @@ -0,0 +1,17 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="get-libaacs"
     1.7 +VERSION="1.00"
     1.8 +CATEGORY="non-free"
     1.9 +SHORT_DESC="Get a library to play encrypted blu-ray."
    1.10 +MAINTAINER="pascal.bellard@slitaz.org"
    1.11 +WEB_SITE="http://vlc-bluray.whoknowsmy.name/"
    1.12 +TAGS="bluray"
    1.13 +
    1.14 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.15 +genpkg_rules()
    1.16 +{
    1.17 +	mkdir -p $fs/usr/bin
    1.18 +	cp stuff/get-libaacs $fs/usr/bin
    1.19 +}
    1.20 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/get-libaacs/stuff/get-libaacs	Tue Jun 04 11:51:18 2013 +0200
     2.3 @@ -0,0 +1,83 @@
     2.4 +#!/bin/sh -e
     2.5 +
     2.6 +PACKAGE="libaacs"
     2.7 +VERSION="1.0"
     2.8 +WEB_SITE="http://vlc-bluray.whoknowsmy.name/"
     2.9 +CATEGORY="non-free"
    2.10 +SUGGESTED="vlc"
    2.11 +SHORT_DESC="A library to play encrypted blu-ray"
    2.12 +MAINTAINER="nobody@slitaz.org"
    2.13 +
    2.14 +ROOT="$1"
    2.15 +[ -d "$ROOT" ] || ROOT=""
    2.16 +
    2.17 +if test $(id -u) != 0 ; then
    2.18 +        echo -e "\nYou must be root to run `basename $0`."
    2.19 +        echo -e "Please type 'su' and root password to become super-user.\n"
    2.20 +        exit 0
    2.21 +fi
    2.22 +
    2.23 +if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
    2.24 +	[ -n "$ROOT" ] && exit 1
    2.25 +	tazpkg remove $PACKAGE
    2.26 +	[ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1
    2.27 +fi
    2.28 +
    2.29 +TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM
    2.30 +CUR_DIR=$(pwd)
    2.31 +mkdir -p $TMP_DIR && cd $TMP_DIR
    2.32 +
    2.33 +for i in KEYDB.cfg linux32/libaacs.so.0 ; do
    2.34 +	wget ${WEB_SITE}files/$i
    2.35 +	[ -s $(basename $i) ] && continue
    2.36 +	cd $CUR_DIR
    2.37 +	rm -rf $TMP_DIR
    2.38 +	echo "Could not download $(basename $i) from ${WEB_SITE}files/$i. Exiting."
    2.39 +	exit 1
    2.40 +done
    2.41 +
    2.42 +mkdir -p $PACKAGE-$VERSION/fs/usr/lib $PACKAGE-$VERSION/fs/etc/skel/.config/aacs
    2.43 +mv libaacs.so.0 $PACKAGE-$VERSION/fs/usr/lib
    2.44 +mv KEYDB.cfg $PACKAGE-$VERSION/fs/etc/skel/.config/aacs
    2.45 +
    2.46 +cat > $PACKAGE-$VERSION/receipt <<EOT
    2.47 +PACKAGE="$PACKAGE"
    2.48 +VERSION="$VERSION"
    2.49 +CATEGORY="$CATEGORY"
    2.50 +SHORT_DESC="$SHORT_DESC"
    2.51 +MAINTAINER="$MAINTAINER"
    2.52 +SUGGESTED="$SUGGESTED"
    2.53 +WEB_SITE="$WEB_SITE"
    2.54 +
    2.55 +# Pre and post install commands for Tazpkg.
    2.56 +post_install()
    2.57 +{
    2.58 +	for i in $1/home/*/.config ; do
    2.59 +		[ -d $i ] || continue
    2.60 +		cp -a $1/etc/skel/.config/aacs $i
    2.61 +		chown -R $(stat -c '%u.%g' $i) $i/aacs
    2.62 +	done
    2.63 +}
    2.64 +
    2.65 +pre_remove()
    2.66 +{
    2.67 +	rm -rf $1/home/*/.config/aacs
    2.68 +}
    2.69 +EOT
    2.70 +
    2.71 +# Pack
    2.72 +tazpkg pack $PACKAGE-$VERSION
    2.73 +
    2.74 +# Clean to save RAM memory
    2.75 +rm -rf $PACKAGE-$VERSION
    2.76 +
    2.77 +# Install pseudo package
    2.78 +tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
    2.79 +case " $@ " in
    2.80 +*\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
    2.81 +esac
    2.82 +
    2.83 +# Clean
    2.84 +cd $CUR_DIR
    2.85 +rm -rf $TMP_DIR
    2.86 +