Shell script to install libdvdcss under Debian GNU Linux to play DVDs that use css for encryption

#!/bin/sh
# Shell script to install libdvdcss under Debian GNU Linux
# Many DVDs use css for encryption.  To play these discs, a special library 
# is needed to decode them, libdvdcss.  Due to legal problems, Debian and most
# Linux distibutions cannot distribute libdvdcss
# Use this shell script to install the libdvdcss under DEBIN GNU/Linux
# --------------------------------------------------------------------------
# Refer url for more info:
# Copyright info -  http://www.dtek.chalmers.se/~dvd/
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit http://bash.cyberciti.biz/ for more information.
# -------------------------------------------------------------------------
 
set -e
 
site=http://www.dtek.chalmers.se/groups/dvd/deb/
arch=$(dpkg --print-installation-architecture)
 
soname=2
uversion=1.2.5
#available="alpha hppa i386 ia64 powerpc s390 sparc"
available="i386"
version=${uversion}-1
 
if ! type wget > /dev/null ; then
    echo "Install wget and run this script again"
    exit 1
fi
 
for a in $available; do
    if [  "$a" = "$arch" ]; then
	wget ${site}libdvdcss${soname}_${version}_${arch}.deb -O /tmp/libdvdcss.deb
	dpkg -i /tmp/libdvdcss.deb
	exit $?
    fi
done
 
echo "No binary deb available.  Will try to build and install it."
echo "You need to have debhelper, dpkg-dev and fakeroot installed."
echo "If not, interrupt now, install them and rerun this script."
echo ""
echo "This is higly experimental, look out for what happens below."
echo "If you want to stop, interrupt now (control-c), else press"
echo "return to proceed"
read dum
 
mkdir -p /tmp/dvd
cd /tmp/dvd
wget ${site}libdvdcss_${uversion}.orig.tar.gz
wget ${site}libdvdcss_${version}.diff.gz
wget ${site}libdvdcss_${version}.dsc
dpkg-source -x libdvdcss_${version}.dsc
cd libdvdcss-${uversion}
fakeroot ./debian/rules binary
echo "Any problems?  Interrupt now (control-c) and try to fix"
echo "manually, else go on and install (return)."
dpkg -i ../libdvdcss${soname}_${version}_${arch}.deb
Get the latest tutorials on SysAdmin, Linux/Unix, Open Source, and DevOps topics:
CategoryList of Unix and Linux commands
File Management cat
Firewall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilities dig host ip nmap
OpenVPN CentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Manager apk apt
Processes Management bg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searching grep whereis which
User Information groups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPN CentOS 8 Debian 10 Firewall Ubuntu 20.04
1 comment… add one
  • Momo_102 Apr 30, 2008 @ 9:16

    There is bug:

    Replace
    #available=”alpha hppa i386 ia64 powerpc s390 sparc”
    available=”i386″

    With
    available=”alpha amd64 hppa i386 ia64 powerpc s390 sparc”
    #available=”i386″

    and it works for all architecture including amd64.

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.