#!/bin/sh # # # This script will: # 1) download the sources needed to build libdvdcss2 RPM # 2) Ask the root password # 3) Build the binary RPM packages and install it. # NOTE: To build is needed to install before the following packages: # gcc (the C GNU compiler) # make (the make build GNU utility) # wget (the tool to download the source code) # To use it, you will need an internet conection up to download the sources # a) Download the script # b) move it to a temp directory # c) cd to that temp directory # d) execute the script (you will need to know the root password and the # internet conection up) # ./install_libdvdcss2 # # (c) Guillermo Ballester Valor, 2004 # # v 0.1.2 (2008-09-08) # V_DVDCSS2=1.2.10 V_PACKMAN=0.pm.0 SITE_PACKMAN="packman.mirrors.skynet.be/mirror2/packman" TEMP_FILE=./tmpfile ARCH=`grep -i '(' /etc/SuSE-release | awk -F '(' '{print $2}' | awk -F ')' '{print $1}' | tr [:upper:] [:lower:] | sed s/-/_/g` # First check about gcc and make packages echo "Checking if you have basic compiler and utils installed ..." ! ( rpm -q gcc ) && echo "You have to install 'gcc' RPM package before" && exit ! ( rpm -q gcc-fortran ) && echo "You have to install 'gcc-fortran' RPM package before" && exit ! ( rpm -q make ) && echo "You have to install 'make' RPM package before" && exit ! ( rpm -q wget ) && echo "You have to install 'wget' RPM package before" && exit echo "Ok, continue downloading needed packages and sources ..." echo " " # A small clean before download fresh files rm -f libdvdcss2-${V_DVDCSS2}-${V_PACKMAN}.nosrc.rpm* rm -f libdvdcss-${V_DVDCSS2}.tar.bz2* # download the packman nosrc.rpm package wget ftp://${SITE_PACKMAN}/suse/11.0/SRPMS/libdvdcss2-${V_DVDCSS2}-${V_PACKMAN}.nosrc.rpm # download the libdvdcss2 source wget ftp://download.videolan.org/pub/libdvdcss/${V_DVDCSS2}/libdvdcss-${V_DVDCSS2}.tar.bz2 echo "download completed" echo " " # A legal warning and ask the root password echo "WARNING: THE USE OF LIBDVDCSS LIBRARY COULD BE ILLEGAL IN YOUR COUNTRY" echo "Enter the root password if you want to continue and install it." echo "Enter any other key otherwise." echo "The compiling process will generate a lot of output on the screen" echo "Don't worry about it" INSTALLED=`rpm -qi libdvdcss2 | grep libdvdcss2-${V_DVDCSS2}-${V_PACKMAN}.nosrc.rpm` FILE0=./libdvdcss2-${V_DVDCSS2}-${V_PACKMAN}.nosrc.rpm FILE1=/usr/src/packages/RPMS/${ARCH}/libdvdcss2-${V_DVDCSS2}-${V_PACKMAN}.${ARCH}.rpm # build the rpms and install as root su --command="mv libdvdcss-${V_DVDCSS2}.tar.bz2 /usr/src/packages/SOURCES && \ rpmbuild --rebuild --target=${ARCH} ${FILE0} &&\ rpm -Uvh ${FILE1} " # check the installation # last step if test -n "${INSTALLED}" -a ${FILE1} -nt ${FILE0}; then echo "libdvdcss2 rpm packages installed successfully. You have the rpm" echo "packages in the directory '/usr/src/packages/RPMS/${ARCH}' " else echo "libdvdcss2 have not been installed" if test -n "${INSTALLED}"; then echo "The same version was already installed" fi fi