Advertisement
Guest User

MrCoolSpan

a guest
Dec 20th, 2009
958
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 62.42 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Script name: vdr-installer  # To be put in your /usr/local/bin, chmod the script, then load it simply typing: vdr-installer
  4.  
  5. # Dec_20_2009      (XINE 1.2_lib + vdpau)
  6. # jackblow33 Script
  7. # Edit by Mr Cool Span
  8.  
  9. ###############
  10. # Variables ### // EDIT AT YOUR OWN RISK ...
  11. ###############
  12.  
  13. XINE_1_2="true" # true = install Xine_lib_1.2, if false is used Xine_Vdpau(1.1lib) gonna be installed instead(works also with non vdpau video card)
  14. XINE_vdpau_Patch="on" # To apply vdpau patch to Xine-lib_1.2
  15. vdpau_ver="r284" # Set Vdpau patch version
  16.  
  17. VideoCard="Nvidia" # Choices are: Nvidia or Ati (default="Nvidia")
  18. NV_VER="190.42" # Nvidia Driver version - Previously tested: 185.18.31 - 185.18.36
  19.  
  20. # DVB driver # ( pre_s2api is used with vdr-1.6.0 and Ubuntu_8.04 )
  21. DVB_DRIVER="s2-liplianin" # Choices are: | s2-liplianin | v4l-dvb | v4l-endriss | v4l-Myth | pre_s2api |
  22. CW3K_PATCH="off" #(on, off) Need this patch for using your cw3k interface
  23. Nexus_NA_Firmware="false" # (true, false) to install Mod firmware for Hauppauge Nexus in NA
  24. Nexus_remote_control="false" # (true, false) To have you Nexus remote working with Vdr plugin remote-0.4.0      
  25. Hvr_4000="false" # (true, false) Install the Hauppauge Hvr-4000/NOVA-HD-S2 Firmware
  26.  
  27. MAKE="make -j6" # To see the effect of different values of -j have, you can take a look at /var/log/vdr_install_log and check compile time.
  28.  
  29.  
  30. USR="vdr" # Choose what you want, Default user=vdr
  31. SRC='/usr/local/src'
  32. VDRSRC=''$SRC'/vdr/PLUGINS/src'
  33. CONFIGS_FILE="/usr/local/bin/vdr.conf" # future update
  34.  
  35. VDR='vdr-1.7.10'                              # ftp://ftp.cadsoft.de/vdr/Developer
  36. VXINE='xine-0.9.3'                           # http://home.vrweb.de/rnissl
  37. XINE_UI='xine-ui-cvs-20090617220000.tar.bz2' # http://home.vrweb.de/rnissl
  38. PACKAGES=""$SRC"/packages"
  39. LOGFILE="/var/log/vdr_install_log"
  40. # SCRIPTS=""$SRC"/scripts"
  41. # ARCHIVES=""$SRC"/archives"
  42.  
  43. TEMP='/tmp'
  44. SC_CHECK="/etc/vdr/plugins/sc/"
  45. BIN_CHECK="/etc/vdr/plugins/sc/nagra"
  46. TIMESTAMP=`date +%Y%m%d.%R`
  47.  
  48. # Nscan variables
  49. V4LDVB="$SRC/v4l-dvb"
  50. CFGDIR="/etc/vdr"
  51. NSCAN="/usr/local/bin/nscan"
  52. CONF="channels.conf.$TIMESTAMP"
  53. channels="/etc/vdr/channels.conf"
  54.  
  55.  
  56. ####################################################################
  57. #                                                                ###
  58. # PLUGINS VARIABLE--(enable, disable vdr plugins with this part) ###
  59. #                                                                ###
  60. # Use: "on" to install, "off" to not install the plugin  ...     ###
  61. ####################################################################
  62.  
  63. lirc="on" #===> # Should be disable if you don't have a remote control
  64. #
  65. vdr_remote="on" # Should be disable if you don't have a remote control
  66. Mce_remote_conf="off" # Default="off"(force remote plugins to detect your remote and choose your own buttons
  67. Hvr_4000_remote="on" # Default="off"(force remote plugins to detect your remote and choose your own buttons
  68. #
  69. xineliboutput="off"
  70. VDR_XINE="on"
  71. NAScan="off"
  72. osdteletext="on"
  73. femon="on"
  74. Skin_Enigma="on"
  75. Skin_Reel="on"
  76. SC="off"
  77. Soppalusikka_Skin="on"
  78. YAEPGHD="on"
  79. StreamDev="on"
  80.  
  81. # Untested plugins(off by default not recommended to enable):
  82. vdr_setup="off" # the one to not enable.
  83. Reelchannelscan="off"
  84. dvdplugin="off"
  85. Channelswitcher="off"
  86. vdr_browse="off"
  87.  
  88. ####################################################################################
  89. press_enter()
  90. {
  91. echo "Press [enter] key to continue. . ."; read enterKey
  92. }
  93.  
  94. exit_check()
  95. {
  96. if [ $? -ne 0 ]; then
  97.    echo "Install did not run successfully" >> $LOGFILE
  98.    echo "Install did not run successfully"; press_enter; exit 1
  99. else
  100.    echo "Install successful" >> $LOGFILE
  101. fi  
  102. }
  103.  
  104. log_0_check()
  105. {
  106. if [ $? -ne 0 ]; then
  107.    echo "Did not run successfully" >> $LOGFILE
  108. else
  109.    echo "Run successfully" >> $LOGFILE
  110. fi  
  111. }
  112.  
  113.  
  114. timer_start()
  115. {
  116. BEGIN=$(date +%s)
  117. }
  118.  
  119.  
  120. timer_stop()
  121. {
  122.     NOW=$(date +%s)
  123.     let DIFF=$(($NOW - $BEGIN))
  124.     let MINS=$(($DIFF / 60))
  125.     let SECS=$(($DIFF % 60))
  126.     echo Time elapsed: $MINS:`printf %02d $SECS` >> $LOGFILE
  127. }
  128.  
  129. line()
  130. {
  131. echo "-----------------------------------" >> $LOGFILE
  132. }
  133.  
  134.  
  135. sc_error_message()
  136. {
  137. echo "WARNING CAM_FILES CHECK FAILURE. Before loading VDR copy you camfiles to: /etc/vdr/plugins/sc & the 4 bin files to: /etc/vdr/plugins/sc/nagra"; echo ""; echo "*** Folder name is nagra not Nagra ***"; echo ""
  138. }
  139.  
  140. sc_check()
  141. {
  142. if [ -f $SC_CHECK/SoftCam.Key ]; then
  143.     echo "OK, SoftCam.Key FILE IS THERE"
  144. else
  145.     echo ""; sc_error_message
  146. fi
  147.  
  148. if [ -f $BIN_CHECK/ROM102.bin ]; then
  149.     echo "OK, ROM102.bin FILE IS THERE"
  150. else
  151.     echo ""
  152. fi
  153. }
  154.  
  155. ##############################################################
  156.  
  157.  
  158.  
  159.  
  160. # Make sure only root can run the script -----------#
  161. if [ "$(id -u)" != "0" ]; then
  162.    echo "This script must be run as root" 1>&2
  163.    exit 1
  164. fi
  165. #---------------------------------------------------#
  166.  
  167.  
  168. # Check for the script configuration file -----------#
  169. #if [ -f ${CONFIGS_FILE} ]; then
  170. #    echo "OK, vdr.conf located in /usr/local/bin"; else
  171. #    echo "ERROR: You must have ${CONFIGS_FILE}"; exit 1
  172.  
  173. #fi
  174.  
  175. #. ${CONFIGS_FILE} || exit 1
  176. #---------------------------------------------------#
  177.  
  178.  
  179. # version check ------------------------------------#
  180. version=$( cat /etc/issue | grep 9.10 >/dev/null && echo 9.10 || echo "Unsupported version of Ubuntu" )
  181.  
  182. if [ "$version" = "9.10" ]; then
  183.     echo "Ubuntu $version"
  184. else
  185.     echo "$version"; exit 1
  186. fi
  187. #---------------------------------------------------#
  188.  
  189. # Print some infos in install log: /usr/local/src/vdr_install_log # PLZ check the install log for errors if you have problem installing
  190. echo "" >> $LOGFILE; echo "Started:" >> $LOGFILE; date >> $LOGFILE
  191. uname -r -m >> $LOGFILE; echo "Ubuntu $version" "As:$USER" >> $LOGFILE
  192. cat /proc/cpuinfo | grep -i "model name" >> $LOGFILE; line
  193.  
  194. # User to be used with vdr created(Default=vdr):
  195. sudo useradd $USR -g video -d /home/vdr -s /bin/bash -m
  196. if cat /etc/sudoers |grep "$USR ALL=(ALL) ALL"; then
  197.     echo "OK"
  198. else
  199.     echo "$USR ALL=(ALL) ALL" >> /etc/sudoers
  200. fi
  201.  
  202. # Some folders
  203. mkdir $SRC/packages      # $SRC/archives $SRC/scripts $SRC/READ_THIS
  204.  
  205.  
  206. while :
  207. do
  208.     clear
  209.     echo "-------------------------------------"
  210.     echo "     VDR Install script "
  211.     echo "-------------------------------------"
  212.     echo "[1]  Ubuntu Gnome base install"
  213.     echo "[2]  $DVB_DRIVER drivers"
  214.     echo "[2.1] Remove Dvb Driver"
  215.     echo "[3]  Nvidia 32 & 64bit: $NV_VER"
  216.     echo "====================================="
  217.     echo "[4]   FFMPEG"
  218.     echo "[5]   Xine-Lib-1.2 & XINE-UI"
  219.     echo "[5.1] Remove Xine-Lib-1.2 & XINE-UI"
  220.     echo "=============================================="
  221.     echo "[6]   $VDR & plugins & configurations"
  222.     echo "[6.1] Remove VDR & plugins & configurations"
  223.     echo "====================================="
  224.     echo "[7]   Nscan-2.0.7 scanner for NA"
  225.     echo "[7.1] Remove Nscan-2.0.7"
  226.     echo "====================================="
  227.     echo "[8] Exit/Stop"
  228.     echo "====================================="
  229.     echo -n "Enter your menu choice [1-8]: "
  230.     read yourch
  231.     case $yourch in
  232.  
  233.    ###########  #
  234. 1) # GNOME ###  # DO NOT EXECUTE THIS OPTION ON A FULL UBUNTU DESKTOP INSTALL
  235.    ###########  # Complete the base Ubuntu Install(Gnome) and more
  236.  
  237. timer_start; echo "[1]  Gnome" >> $LOGFILE
  238. sudo apt-get update -y # nano /etc/apt/sources.list && apt-get update -y
  239. sudo apt-get install -y gnome-core gdm network-manager-gnome human-theme \
  240. x11-xserver-utils jockey-gtk tangerine-icon-theme \
  241. gnome-themes-ubuntu ubuntu-artwork gnome-utils gcalctool tsclient \
  242. firefox file-roller gftp gdebi system-config-samba \
  243. evince ubuntu-restricted-extras \
  244. # Some optional apps that ###
  245. # SSH support: - Comment uncomment next line to install it or not.
  246. apt-get install -y ssh
  247. # Putty -free telnet/ssh client
  248. apt-get install -y putty
  249. # Brasero disc Burner
  250. apt-get install -y brasero
  251. #---------------------------------------------------------------------------------#
  252.  
  253. # gdm autologin=ON
  254. #sed -i "s/AutomaticLoginEnable=false/AutomaticLoginEnable=true/" /etc/gdm/gdm.conf
  255. #sed -i "s/AutomaticLogin=/AutomaticLogin=$USR/" /etc/gdm/gdm.conf
  256. #---------------------------------------------------------------------------------#
  257.  
  258.  
  259. ###########################################################
  260. # STATIC IP SETTINGS                          #############
  261. # Can set static ip with this next variables: #############
  262. ###########################################################
  263.  
  264. STATIC_IP="false"          # true, false //
  265. address="10.0.0.250"   # Choose the ip address you want to use ex.: 192.168.0.xyz
  266. netmask="255.255.255.0"   # ex.: 255.255.255.0
  267. network="10.0.0.1"     # ex.: 192.168.0.0
  268. broadcast="10.0.0.255" # ex.: 192.168.0.255
  269. gateway="10.0.0.1"     # ex.: 192.168.0.1
  270.  
  271. if [ $STATIC_IP = "true" ]; then
  272.   echo "Static ip settings" >> $LOGFILE
  273.     if [ ! -f /etc/network/interfaces_BAK ]; then
  274.         cp /etc/network/interfaces /etc/network/interfaces_BAK
  275.         sed -i "s/iface eth0 inet dhcp/#iface eth0 inet dhcp/" /etc/network/interfaces
  276.         echo "# Next part have been auto-generated by Vdr install script
  277.        iface eth0 inet static
  278.        address $address
  279.        netmask $netmask
  280.        network $network
  281.        broadcast $broadcast
  282.        gateway $gateway" >> /etc/network/interfaces && /etc/init.d/networking restart
  283.     fi
  284. else
  285.    echo "Network = dhcp or already Configured" >> $LOGFILE
  286. fi
  287. #-----------------------------------------------------------------------------------#
  288.  
  289. log_0_check; timer_stop; line
  290. ;;
  291.  
  292.    ############################
  293. 2) # V4L-DVB DRIVER INSTALL ###
  294.    ############################
  295. timer_start; echo "[2]  V4l-dvb drivers" >> $LOGFILE
  296. dmesg | grep -i dvb; sleep 2;
  297.  
  298. #build-essential dpkg-dev g++ g++-4.2 libc6-dev libstdc++6-4.2-dev libtimedate-perl
  299. #  linux-libc-dev mercurial patch
  300. apt-get install -y mercurial build-essential linux-headers-`uname -r`
  301.  
  302. #apt-get source linux-image-`uname -r`
  303.  
  304. #######################
  305. # Variables V4l-dvb ###
  306. #######################
  307. V4L='/media/KINGSTON/drivers/v4l-dvb.tar.bz2' # Using this to don't have to re-download the driver all the time
  308. USB='/media/KINGSTON' # = my usb flash drive, you don't have to edit this one, script gonna ignore this variable anyway.
  309. #
  310.  
  311.  
  312.     cd $SRC
  313. #    wget http://linuxtv.org/hg/v4l-dvb/archive/aa56a9c21b61.tar.bz2 # May 17 2009 version
  314. #    tar -xivf aa56a9c21b61.tar.bz2; mv v4l-dvb-aa56a9c21b61 v4l-dvb # ///////////////////
  315.  
  316.  
  317. # Some Dvb drivers ...
  318. if [ $DVB_DRIVER = "s2-liplianin" ]; then
  319.    hg clone http://mercurial.intuxication.org/hg/s2-liplianin/; mv s2-liplianin v4l-dvb; else
  320.      if [ $DVB_DRIVER = "v4l-dvb" ]; then
  321.         hg clone http://linuxtv.org/hg/v4l-dvb; else
  322.           if [ $DVB_DRIVER = "v4l-Myth" ]; then
  323.               hg clone http://linuxtv.org/hg/v4l-dvb
  324.               sed -i "s/FE_CAN_INVERSION_AUTO |/& FE_CAN_2G_MODULATION |/" /usr/local/src/v4l-dvb/linux/drivers/media/dvb/dvb-usb/gp8psk-fe.c; else
  325.                 if [ $DVB_DRIVER = "v4l-endriss" ]; then
  326.                    wget http://linuxtv.org/hg/~endriss/v4l-dvb/archive/tip.tar.bz2
  327.                    tar xivf tip.tar.bz2; mv v4l-dvb-* v4l-dvb; else
  328.                    if [ $DVB_DRIVER = "pre_s2api" ]; then
  329.                       wget http://www.hoochvdr.info/files/v4l_1_gpfix.20080606.1.diff
  330.                       wget http://www.hoochvdr.info/files/v4l_2_gp_8psk.20080508.1.diff
  331.                       hg clone -r 8984 http://linuxtv.org/hg/v4l-dvb
  332.                       cd v4l-dvb
  333.                       patch -p1 < /usr/local/src/v4l_1_gpfix.20080606.1.diff
  334.                       patch -p1 < /usr/local/src/v4l_2_gp_8psk.20080508.1.diff
  335.                       cd ..
  336.                    else
  337.                       echo "Could you plz select a driver that is listed ?"; press_enter
  338.                    fi
  339.                fi
  340.            fi
  341.      fi
  342. fi
  343. ###############                                              
  344. # CW3K PATCH ##
  345. ###############
  346. cw3k_diff="gp_cw3k_s2api_3b.diff" # Choices: 8psk.diff, gp_cw3k_s2api_3b.diff or gp_cw3k_s2api.diff
  347.  
  348. if [ "$CW3K_PATCH" = "on" ]; then
  349.   cp /home/$USR/Desktop/$cw3k_diff $SRC || cp $USB/patches/$cw3k_diff $SRC
  350.   echo "Cw3K_S2API Patching enable" >> $LOGFILE
  351.    # CHECK FOR gp_cw3k_s2api_3b patch: YOU MUST DOWNLOAD IT FIRST BEFORE INSTALLING:link to the patch:http://evilshare.com/7d2yzl61432l/gp_cw3k_s2api_3b.diff.html
  352.    if [ -f $SRC/$cw3k_diff ]; then
  353.      echo "OK"; cd v4l-dvb; patch -p1 < $SRC/$cw3k_diff; else # //ADD CHECK FOR PATCH ALREADY APPLIED
  354.      echo "cw3k_check FAILED" >> $LOGFILE
  355.      clear; echo ""
  356.      echo "##############################################################################################"
  357.      echo "# ---------------!!! COULD NOT DETECT CW3K PATCH ...!!!"
  358.      echo "# - YOU MUST DOWNLOAD THE PATCH BEFORE COMPILING ...!!!"
  359.      echo "#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
  360.      echo "# - Link to the patch is: http://evilshare.com/7d2yzl61432l/gp_cw3k_s2api_3b.diff.html"
  361.      echo "# - DOWNLOAD THE PATCH WITH MOZILLA TO YOUR DESKTOP AND THEN RE-EXECUTE THIS INSTAL STEP"
  362.      echo "##############################################################################################"
  363.      echo ""  
  364.      press_enter; exit 1
  365.    fi
  366.   else
  367. echo "Cw3K Patching skipped" >> $LOGFILE
  368. fi
  369.     cd v4l-dvb
  370.  
  371.     # TUNING TWEAK FOR GENPIX  ################################################################################                                          
  372. #    sed -i "s/tune->min_delay_ms = 200/tune->min_delay_ms = 800/" linux/drivers/media/dvb/dvb-usb/gp8psk-fe.c
  373.     ###########################################################################################################
  374.  
  375.  
  376. if [ ! $DVB_DRIVER = "pre-s2api" ]; then
  377.     ##########################################
  378.     # ALLOW QPSK and 8PSK ON GENPIX DEVICES ##
  379.     ##########################################
  380.     sed -i "s/Only QPSK is supported for DVB-S/Allow QPSK and 8PSK/" linux/drivers/media/dvb/dvb-usb/gp8psk-fe.c
  381.     sed -i "s/modulation != QPSK/& \&\& c->modulation != PSK_8/" linux/drivers/media/dvb/dvb-usb/gp8psk-fe.c
  382.     ###################################################################################################################################
  383. else
  384.     echo "sed command to enable 8PSK skipped"
  385. fi
  386. sed -ie 's/CONFIG_DVB_FIREDTV=m/CONFIG_DVB_FIREDTV=n/' v4l/.config
  387. $MAKE && make install && depmod -a
  388.  
  389. exit_check; timer_stop; line
  390.  
  391. # NEXUS NA FIRMWARE #----------------------------------------------------------#
  392. if [ "$Nexus_NA_Firmware" = "true" ]; then
  393.    cd $SRC; wget http://www.hoochvdr.info/files/dvb-ttpci-01.fw-f12623-070121-cr
  394.    mv /lib/firmware/dvb-ttpci-01.fw /lib/firmware/dvb-ttpci-01.fw_BAK
  395.    mv dvb-ttpci-01.fw-f12623-070121-cr /lib/firmware/dvb-ttpci-01.fw
  396. fi
  397. #-----------------------------------------------------------------------------#
  398.  
  399. # Hauppauge Hvr-4000/NOVA-HD-S2 Firmware #
  400. if [ "$Hvr_4000" = "true" ]; then
  401. sudo apt-get install linux-firmware-nonfree
  402. sudo apt-get install unrar -y
  403. rm /lib/firmware/dvb-fe-c*
  404. cd $SRC
  405. wget http://www.hauppauge.de/software/mce/88x_2_122_26109_WHQL.zip
  406. unzip -jo 88x_2_122_26109_WHQL.zip Driver88/hcw88bda.sys
  407. dd if=hcw88bda.sys of=dvb-fe-cx26109.fw skip=75504 bs=1 count=32501
  408. cp dvb-fe-cx26109.fw /lib/firmware/
  409. rm /lib/firmware/dvb-fe-cx24116.fw
  410. ln -s /lib/firmware/dvb-fe-cx26109.fw /lib/firmware/dvb-fe-cx24116.fw
  411. fi
  412. ;;
  413.  
  414.  
  415.      #####################
  416. 2.1) # Remove Dvb Driver #
  417.      #####################
  418. cd $SRC/v4l-dvb; make rminstall; make clean; make distclean; cd ..; rm -r v4l-dvb
  419. ;;
  420.  
  421.    ###############################
  422. 3) # NVIDIA DRIVER 32 & 64 bit ###
  423.    ###############################
  424. NV='NVIDIA-Linux-x86-'$NV_VER'-pkg1.run'
  425. NV64="NVIDIA-Linux-x86_64-"$NV_VER"-pkg1.run"
  426.  
  427. timer_start; echo "[3]  Nvidia 32 & 64bit: $NV_VER" >> $LOGFILE
  428.  
  429. apt-get install -y mercurial build-essential linux-headers-`uname -r`
  430. # cp $USB/drivers/$NV /$SRC
  431.  
  432.  
  433. cd $SRC; /etc/init.d/gdm stop || /etc/init.d/xdm stop
  434. if uname -m |grep "x86_64"; then
  435.    echo "64bit"
  436.    nvidia="x86_64/"$NV_VER"/NVIDIA-Linux-x86_64-"$NV_VER"-pkg1.run"
  437.    wget ftp://download.nvidia.com/XFree86/Linux-$nvidia || echo "Nvidia driver dl failure!!!" >> $LOGFILE
  438.    sh $NV64
  439. else
  440.    echo "32bit"
  441.    nvidia="x86/"$NV_VER"/NVIDIA-Linux-x86-"$NV_VER"-pkg1.run"
  442.    wget ftp://download.nvidia.com/XFree86/Linux-$nvidia || echo "Nvidia driver dl failure!!!" >> $LOGFILE
  443.    sh $NV
  444. fi
  445.  
  446.   log_0_check; timer_stop; line
  447.   nvidia-xconfig
  448.  
  449. ;;
  450.    ###############
  451. 4) #FFmpeg /X264 #
  452.    ###############
  453. cd $SRC
  454. sudo apt-get remove ffmpeg x264 libx264-dev -y
  455. apt-get install -y build-essential checkinstall
  456. apt-get install -y mercurial cvs subversion git-core libncurses-dev
  457. apt-get install -y autoconf libtool automake pkg-config gettext
  458. apt-get install -y liba52-0.7.4-dev libmp3lame-dev libvorbis-dev zlib1g-dev libpng12-dev libx11-dev libxv-dev libxvmc-dev libasound2-dev libmpcdec-dev
  459. apt-get install -y yasm
  460. apt-get build-dep ffmpeg -y
  461. #
  462. # X264
  463. if [ -f $PACKAGES/x264*.deb ]; then
  464.     echo "Package is there, skip compilation"
  465. else # compile
  466. git clone git://git.videolan.org/x264.git || git clone git://git.videolan.org/x264.git
  467.   if [ -d $SRC/x264 ]; then
  468.     echo "Download successful."
  469. else
  470.     echo "Looks like download have failed. Couldn't detect x264 folder"; echo "Press [enter] key to continue. . ."; read enterKey; exit 0
  471. fi
  472. cd x264
  473. ./configure --prefix=/usr --enable-pic --enable-shared --enable-pthread --enable-asm --extra-cflags="-mtune=native -march=native -mfpmath=sse -O4 -pipe"
  474. make
  475. sudo make install
  476. fi
  477. exit_status_check
  478.  mv x264*.deb $PACKAGES
  479. if [ -f $SRC/ffmpeg/ffmpeg*.deb ]; then
  480.     echo "Package is there, skip compilation"; press_enter
  481. else # compile
  482. cd $SRC; rm -rf /usr/include/ffmpeg
  483. apt-get install -y libvorbis-dev zlib1g-dev libpng12-dev libx11-dev libxv-dev libasound2-dev libxvidcore4-dev subversion
  484. apt-get install yasm
  485. apt-get build-dep -y ffmpeg
  486. svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
  487. if [ -d $SRC/ffmpeg ]; then
  488.     echo "Download successful."; else
  489.     echo "Looks like download have failed. Couldn't detect ffmpeg folder"; echo "Press [enter] key to continue. . ."; read enterKey; exit 0
  490. fi
  491. cd ffmpeg
  492. ./configure --prefix=/usr --enable-shared --enable-gpl --enable-postproc --enable-libmp3lame --enable-libvorbis --enable-pthreads --enable-libx264 --extra-cflags="-mtune=native -march=native -mfpmath=sse -O4 -pipe"
  493. make && sudo checkinstall --fstrans=no --install=yes --pkgname=ffmpeg --pkgversion "3:0.svn`date +%Y%m%d`-12ubuntu3" --default && ldconfig
  494. fi
  495. if [ -f $SRC/ffmpeg/ffmpeg*.deb ]
  496. then
  497.     echo ""; echo ""; echo "Compilation successful. Package is build"; echo ""
  498. else
  499.     echo "Looks like compilation fail. Couldn't detect package"; echo "Press [enter] key to continue. . ."; read enterKey; exit 0
  500. fi
  501. ffmpeg -version;  echo ""; echo ""; echo "Press [enter] key to continue. . ."; read enterKey
  502. ;;
  503.    ################
  504. 5) # XINE-LIB-1.2 #
  505.    ################
  506. timer_start; echo "[5.2] XINE-LIB-1.2" >> $LOGFILE
  507.  
  508. if [ -f $PACKAGES/libxine2*.deb ]; then
  509.     echo "Package is there, skip compilation(rename the .deb to bypass the check)" >> $LOGFILE
  510.     echo "Package is there, skip compilation(rename the .deb to bypass the check)"; press_enter
  511. else  
  512.   if [ "$lirc" = "on" ]; then
  513.     apt-get install -y lirc lirc-modules-source lirc-x liblircclient-dev
  514.   else
  515.     echo "lirc skipped" >> $LOGFILE
  516.   fi
  517.  
  518.     apt-get install -y mercurial cvs subversion libncurses-dev zlib1g-dev libcdio-dev libvcdinfo-dev libavcodec-dev libpostproc-dev
  519.     apt-get install -y autoconf libtool automake pkg-config gettext checkinstall
  520.     apt-get install -y liba52-0.7.4-dev libmp3lame-dev libvorbis-dev libpng12-dev libx11-dev libxv-dev libasound2-dev
  521. # Enable medibuntu repo. + Dvd playback
  522.     wget http://www.medibuntu.org/sources.list.d/`lsb_release -cs`.list --output-document=/etc/apt/sources.list.d/medibuntu.list
  523.     apt-get -q update; apt-get --yes -q --allow-unauthenticated install medibuntu-keyring
  524.     apt-get -q update && apt-get install -y libdvdcss2 libdvdnav4 libdvdnav-dev
  525.     sudo /usr/share/doc/libdvdread4/install-css.sh
  526.                                                                                  
  527.        # NVIDIA DRIVER CHECK (To make sure vdpau got enabled properly)
  528.        if [ "$VideoCard" = "Nvidia" ]; then
  529.           echo "NV"; dmesg | grep -i NVIDIA >> $LOGFILE
  530.             if cat $LOGFILE | grep "loading NVIDIA UNIX"; then
  531.                echo "NV driver Detected"; else
  532.                echo "Install Nvidia driver before this step" >> $LOGFILE
  533.                echo "Install Nvidia driver before this step"; press_enter; exit 1
  534.             fi
  535.  
  536.         else
  537.            echo "Nvidia_check-bypassed" >> $LOGFILE
  538.  
  539.        fi
  540.  
  541.  
  542. cd $SRC
  543. apt-get install -y libcdio-dev libvcdinfo-dev libmpcdec-dev
  544. hg clone http://hg.debian.org/hg/xine-lib/xine-lib-1.2
  545. # By DATE: hg clone http://hg.debian.org/hg/xine-lib/xine-lib-1.2 xine-lib-1.2_14.10.2008
  546. # hg clone http://hg.debian.org/hg/xine-lib/xine-lib-1.2/rev/6948d6d0a31e; mv 6948d6d0a31e xine-lib-1.2
  547.      ################
  548.      # 64_bit_check #
  549.      ################
  550.      if uname -m |grep "x86_64"; then
  551.    echo "64bit"
  552.    wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-amd64-20071007.tar.bz2
  553. tar xivf essential-amd64-20071007.tar.bz2
  554. mv essential-amd64-20071007 /usr/local/lib/win32
  555. rm -r /usr/local/lib/codecs
  556. ln -s /usr/local/lib/win32 /usr/local/lib/codecs
  557. export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
  558. else
  559.    echo "32bit"
  560.    wget http://www8.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
  561. tar xivf essential-20071007.tar.bz2
  562. mv essential-20071007 /usr/local/lib/win32
  563. ln -s /usr/local/lib/win32 /usr/local/lib/codecs
  564. export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
  565. fi
  566.  
  567.    if [ $XINE_vdpau_Patch = "on" ]; then
  568.       wget http://www.jusst.de/vdpau/files/xine-lib-1.2/xine-lib-1.2-vdpau-$vdpau_ver.diff.bz2
  569.       bunzip2 xine-lib-1.2-vdpau-$vdpau_ver.diff.bz2
  570.       cd xine-lib-1.2
  571.       patch -p1 < ../xine-lib-1.2-vdpau-$vdpau_ver.diff; echo "Vdpau patch" >> $LOGFILE; log_0_check; cd ..
  572.      else
  573.       echo "No_VdpauPatch applied"
  574.    fi
  575.  
  576. cd xine-lib-1.2
  577. ./autogen.sh --prefix=/usr --disable-dxr3 --enable-w32dll --with-w32-path=/usr/local/lib/win32
  578. $MAKE && checkinstall --fstrans=no --install=yes --pkgname=libxine2-dev --pkgversion "1.2.svn`date +%Y%m%d`-12ubuntu3" --default && ldconfig
  579. log_0_check; timer_stop; line
  580. nvidia-xconfig
  581. mv libxine2*.deb $PACKAGES
  582. make clean; make distclean
  583.  
  584. fi
  585. #############
  586. # XINE-UI ###
  587. #############
  588. timer_start; echo "[5] Xine-ui" >> $LOGFILE
  589. if [ -f $SRC/xine-ui/xine-ui*.deb ]; then
  590.     echo "Package is there, skip compilation"
  591. else # compile
  592.     cd $SRC; wget http://home.vrweb.de/rnissl/$XINE_UI || echo "$XINE_UI dl failure!!!"
  593.     tar -jxf$XINE_UI
  594.     apt-get install -y libxt-dev # libtool automake autoconf libextractor-dev
  595.     cd xine-ui
  596. ./autogen.sh --prefix=/usr --enable-lirc --enable-vdr-keys
  597. cd src/xitk/skins/xinetic
  598. sed -i '18d' Makefile.am
  599. cd ../../../../
  600. $MAKE && checkinstall --fstrans=no --install=yes --pkgname=xine-ui --pkgversion "0.99.6`date +%Y%m%d`-12ubuntu3" --default && ldconfig
  601.        
  602. fi
  603.  
  604.   log_0_check; timer_stop; line
  605.   mv xine-ui*.deb $PACKAGES
  606.  
  607. ;;
  608.  
  609.  
  610.      #########################################
  611. 5.1) # Remove XINE-LIB VDPAU 1.1 & XINE-UI ###
  612.      #########################################
  613. dpkg -r xine-ui libxine2-dev libxine1
  614. apt-get remove --purge -y lirc lirc-modules-source lirc-x liblircclient-dev
  615. cd $SRC; rm -r xine-ui xine-vdpau xine-lib xine-lib-1.2 essential-20071007 $VXINE
  616. rm xine-lib-1.2-vdpau$VDPAU.diff xine-ui*.tar.bz2 vdr-1.5.9-dn-eit.0.3.3.diff xine-lib-*.tar.bz2 essential-20071007.tar.bz2 $VXINE.tgz
  617. rm $PACKAGES/xine-ui*.deb
  618. rm $PACKAGES/libxine2*.deb
  619. rm $PACKAGES/libxine1*.deb
  620. echo "[8] Remove XINE-LIB VDPAU 1.2 & XINE-UI" >> $LOGFILE
  621. echo "Finished:" >> $LOGFILE; date >> $LOGFILE; line
  622. ;;
  623.  
  624.  
  625.  
  626.    ###############
  627. 6) # VDR-1.7.x ###
  628.    ###############
  629.    
  630.     timer_start; echo "[6] $VDR" >> $LOGFILE
  631. # v4l-dvb_check
  632. if [ -d $SRC/v4l-dvb ]
  633. then
  634.     echo "Looks like v4l-dvd driver is installed"
  635. else
  636.     echo "Looks like v4l-dvb driver isn't install, install it first"; press_enter; exit 0
  637.     echo "Looks like v4l-dvb driver isn't install, install it first"; >> $LOGFILE
  638. fi
  639.  
  640. # libxine_check
  641. if [ -f $PACKAGES/libxine2*.deb ]; then
  642.     echo "libxine check ok"
  643. else
  644.     echo "Must compile Xine before Vdr" >> $LOGFILE
  645.     echo "Must compile Xine before Vdr"; press_enter; exit 0
  646. fi
  647.    
  648.     apt-get install -y build-essential; echo ""; echo "*** Installing VDR ***"; echo ""
  649.     cd $SRC; apt-get install -y checkinstall libfreetype6-dev libfontconfig1-dev libjpeg62-dev libcap-dev libncurses5-dev libncursesw5-dev git-core gettext #libttf2 fontconfig
  650.     wget ftp://ftp.tvdr.de/vdr/Developer/$VDR.tar.bz2; tar xivf $VDR.tar.bz2; ln -s $VDR vdr
  651.  
  652.   if [ $vdr_setup = "on" ]; then
  653.      cd $SRC   
  654.     mkdir VDR-Extentions-Patch-72
  655. cd /usr/local/src/VDR-Extentions-Patch-72
  656. wget http://wbreu.htpc-forum.de/downloads/vdr1.7.10extensions.zip
  657. unzip vdr1.7.10extensions.zip
  658. cd ../vdr
  659. patch -p1 < ../VDR-Extentions-Patch-72/vdr-1.7.10_extensions.diff
  660. # Next line is just in case you just updated your kernel,do not worry if you get an error saying ´files are the same´
  661. sudo cp /usr/src/linux-headers-`uname -r`/include/linux/compiler.h /usr/local/src/s2-liplianin/linux/include/linux/compiler.h
  662.     else
  663.   echo "Skipping vdr-setup compile"
  664. fi
  665. #
  666. #              
  667.     #wget http://www.zulu-entertainment.de/page/klick.php?d=VDR+Extensions+Patch; tar xivf VDR-Extensions-Patch-*.tar.bz2
  668.     #patch -p1 < ../VDR-Extensions-Patch-71/vdr-1.7.5_extensions.diff; patch -p1 < ../VDR-Extensions-Patch-71/extras/vdr-1.7.5-ext_speedup.diff
  669.     # **** vdr-1.5.9-dn-eit.0.3.3.diff (need only if your provider is Dish network.
  670.     ################################################################################
  671.  
  672.     wget http://www.fepg.org/patches/eit/vdr-1.5.9-dn-eit.0.3.3.diff || echo "dn-eit.diff DL failure!!!" >> $LOGFILE
  673.     git clone git://projects.vdr-developer.org/vdr-plugin-yaepghd.git || git clone git://projects.vdr-developer.org/vdr-plugin-yaepghd.git || echo "yaepghd DL failure!!!" >> $LOGFILE
  674.  
  675.     cd vdr; patch -p1 < ../vdr-plugin-yaepghd/patches/vdr-1.6.0-yaepghd.patch; patch -p1 < ../vdr-1.5.9-dn-eit.0.3.3.diff; sleep 3
  676.     sudo cp /usr/src/linux-headers-`uname -r`/include/linux/compiler.h /usr/local/src/v4l-dvb/linux/include/linux/compiler.h
  677.     cp Make.config.template Make.config
  678.  
  679.   if [ $vdr_setup = "on" ]; then
  680. sed -i '       
  681. s/#SETUP/SETUP/g ' Make.config
  682. else
  683.   echo "Skipping vdr-setup compile"
  684.  fi
  685.  
  686. sed -i '
  687. s/#DVBDIR/DVBDIR/
  688. s|/usr/src/v4l-dvb/linux|/usr/local/src/v4l-dvb/linux|
  689. s|./locale|/usr/share/locale|
  690. s|$(PLUGINDIR)/lib|/usr/lib/vdr/plugins|
  691. s|/video|/media/video|
  692. s|$(VIDEODIR)|/etc/vdr|' Make.config
  693.  
  694. # DVB_API_VERSION_5.1 FIX
  695. sed -i 's/|| DVB_API_VERSION_MINOR != 0//' dvbdevice.h
  696.  
  697. # nano Make.config
  698.  
  699. # 64_bit_check
  700. if uname -m | grep "x86_64"; then
  701.     echo "64bit"; sed -i 's/-D_LARGEFILE64_SOURCE/& -D__KERNEL_STRICT_NAMES/' /usr/local/src/vdr/Makefile
  702. else
  703.     echo "32bit"
  704. fi
  705.  
  706. #    cd $VDRSRC; rm -r hello osddemo servicedemo sky svdrpdemo status pictures skincurses
  707.     $MAKE && make plugins && sudo checkinstall --fstrans=no --install=yes --pkgname=vdr --pkgversion "$VDR-5ubuntu2-0" --default
  708.     log_0_check
  709.     cd $SRC; sudo mkdir -p /usr/lib/vdr/plugins; sudo mkdir -p /usr/lib/vdr/scripts; sudo mkdir -p /etc/vdr/plugins          
  710.     timer_stop; line
  711.  
  712.  
  713.  
  714.  
  715. #########################################
  716. #                                    ####
  717. #  SOME VDR START AND STOP SCRIPTS    ###
  718. #########################################
  719.  
  720. #############################################
  721. # AutoStartup(works with Ubuntu & Xbuntu) ###
  722. #############################################
  723.  
  724.     ccd /home/$USR
  725.     mkdir .config/autostart
  726.     echo '[Desktop Entry]
  727.          Encoding=UTF-8
  728.          Version=0.9.9
  729.          Type=Application
  730.          Name=Vdr-Xine
  731.          Comment=
  732.          Exec=xine --no-splash -f -D --verbose=2 -A alsa -L --post vdr_video --post vdr_audio --post upmix_mono "vdr:/tmp/vdr-xine/stream#demux:mpeg_pes"
  733.          StartupNotify=false
  734.          Terminal=false
  735.          Hidden=false' >> .config/autostart/Vdr-Xine.desktop
  736.  
  737.  
  738. ##########################################################
  739. # VDRRUN (vdr start-up script)(Xine-VDPAU & Xine-lib) ####  # MUST BE ROOT TO LOAD VDR WITH COMMAND: vdrrun #######
  740. ##########################################################                                                                                                                                                    
  741. if [ -f /usr/local/bin/vdrrun ]; then                                                                                                                                                    
  742.     echo "OK"                                                                        
  743.                                                                              
  744. else                                                                                                                                                                                                    
  745.     echo ""; echo "Building vdrrun"                                                                                                                                                                      
  746.     echo "#!/bin/sh                                                                                                                                                                                    
  747. #file name: vdrrun
  748.  
  749. /usr/local/bin/vdr -c /etc/vdr -E /var/vdr -l 3 -u root -s /usr/local/bin/vdrpoweroff &
  750.  
  751. until [ -e \"/tmp/vdr-xine/stream\" ]; do sleep 1; done
  752.  
  753. xine --no-splash -f -D --verbose=2 -A alsa -L --post vdr_video --post vdr_audio --post upmix_mono \"vdr:/tmp/vdr-xine/stream#demux:mpeg_pes\" &" >> /usr/local/bin/vdrrun
  754.    
  755. chmod a+x /usr/local/bin/vdrrun
  756. fi
  757. #################
  758. # VDRPOWEROFF ### // Command line to Turn OFF Vdr + Pc = vdrpoweroff
  759. #################
  760. if [ -f /usr/local/bin/vdrpoweroff ]; then                                                                                                                                                  
  761.     echo "OK"                                                                        
  762.                                                                           else                                                                                                                                                                                                    
  763.     echo ""; echo "Building vdrpoweroff"
  764.     echo "#!/bin/bash
  765.  
  766. /sbin/poweroff" >> /usr/local/bin/vdrpoweroff
  767.  
  768. chmod a+x /usr/local/bin/vdrpoweroff
  769. fi
  770.  
  771.  
  772. #####################
  773. # /etc/init.d/vdr ###
  774. #####################
  775. if [ -f /etc/init.d/vdr ]; then
  776.     echo "OK"
  777. else
  778.     echo "building runvdr"
  779.  
  780. echo '#!/bin/sh
  781.  
  782. # To be copied to: /etc/init.d
  783. # And type:
  784. ### BEGIN INIT INFO
  785. # Provides:          VDR
  786. # Required-Start:  
  787. # Required-Stop:    
  788. # Default-Start:     0 1 2 3 4 5 6
  789. # Default-Stop:    
  790. # Description:       Start, Stop or Restart VDR
  791. ### END INIT INFO
  792.  
  793. # Shell functions sourced from /etc/rc.status:
  794. set -e
  795.  
  796. # Reset status of this service
  797. # rc_reset
  798. #
  799. echo "Vdr init.d script using: $1" >> /var/log/vdr.log &
  800. case "$1" in
  801.    start)
  802.        echo -n "Starting VDR "
  803.   /usr/local/bin/runvdr >> /var/log/vdr.log &
  804.        # Remember status and be verbose
  805.        ;;
  806.    stop)
  807.        echo -n "Shutting down VDR "
  808.   killall runvdr
  809.   killall vdr
  810.        # Remember status and be verbose
  811.        ;;
  812.    restart)
  813.        echo -n "Restart VDR "
  814.        $0 stop
  815.        $0 start
  816.  
  817.        # Remember status and be quiet
  818.        ;;
  819.    *)
  820.        echo "Usage: $0 {start|stop|restart}"
  821.        exit 1
  822.        ;;
  823. esac
  824. # rc_exit
  825. exit 0' >> /etc/init.d/vdr
  826.  
  827. chmod a+x /etc/init.d/vdr; update-rc.d vdr defaults
  828. fi
  829.  
  830. ############
  831. # RUNVDR ###
  832. ############
  833.  
  834. mv /usr/local/bin/runvdr /usr/local/bin/runvdr.$TIMESTAMP
  835. echo '#!/bin/bash
  836.  
  837. # runvdr: Loads the DVB driver and runs VDR
  838. #
  839. # If VDR exits abnormally, the driver will be reloaded
  840. # and VDR restarted.
  841. #
  842. # In order to actually use this script you need to implement
  843. # the functions DriverLoaded(), LoadDriver() and UnloadDriver()
  844. # and maybe adjust the VDRPRG and VDRCMD to your particular
  845. # requirements.
  846. #
  847. # Since this script loads the DVB driver, it must be started
  848. # as user root. Add the option "-u username" to run VDR
  849. # under the given user name.
  850. #
  851. # Any command line parameters will be passed on to the
  852. # actual vdr program.
  853. #
  854. # See the main source file vdr.c for copyright information and
  855. # how to reach the author.
  856. #
  857. # $Id: runvdr 2.0 2006/05/14 16:02:05 kls Exp $
  858.  
  859. VDRPRG="/usr/local/bin/vdr"
  860. VDRCMD="$VDRPRG -c /etc/vdr -E /var/vdr -l 3 -s /usr/local/bin/vdrpoweroff -u root $*"
  861.  
  862. KILL="/usr/bin/killall -q -TERM"
  863.  
  864. # Detect whether the DVB driver is already loaded
  865. # and return 0 if it *is* loaded, 1 if not:
  866. DriverLoaded()
  867. {
  868.  return 0
  869. }
  870.  
  871. # Load all DVB driver modules needed for your hardware:
  872. LoadDriver ()
  873. {
  874.  
  875.  return 0
  876.  
  877. }
  878.  
  879. # Unload all DVB driver modules loaded in LoadDriver():
  880. UnloadDriver ()
  881. {
  882.  
  883.  return 0
  884.  
  885. }
  886.  
  887. # Load driver if it hasnt been loaded already:
  888. if ! DriverLoaded; then
  889.   LoadDriver
  890.   fi
  891.  
  892. while (true) do
  893.      eval "$VDRCMD"
  894.      if test $? -eq 0 -o $? -eq 2; then exit; fi
  895.      echo "`date` reloading DVB driver"
  896.      $KILL $VDRPRG
  897.      sleep 10
  898.      UnloadDriver
  899.      LoadDriver
  900.      echo "`date` restarting VDR"
  901.      done' >> /usr/local/bin/runvdr
  902.  
  903. chmod a+x /usr/local/bin/runvdr
  904.  
  905.  
  906.  
  907. ###########################
  908. #                       ###
  909. #      VDR PLUGINS      ###
  910. #                       ###
  911. ###########################
  912. timer_start; echo "vdr plugins" >> $LOGFILE
  913.  
  914.  
  915. if [ $vdr_setup = "on" ]; then
  916. #cp -r $SRC/setup-0.3.1-zulu-edition $VDRSRC
  917. cd $VDRSRC
  918. wget http://www.zulu-entertainment.de/files/vdr-setup/vdr-setup-0.3.1-zulu-edition.tgz
  919. tar zxvf vdr-setup-0.3.1-zulu-edition.tgz
  920. mv setup-0.3.1-zulu-edition setup
  921. cd /usr/local/src/vdr
  922. make plugins
  923. mkdir /etc/vdr/plugins/setup
  924.  
  925.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P setup|" /usr/local/bin/runvdr
  926.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P setup|" /usr/local/bin/vdrrun
  927.  
  928. setup_menu_xml; setup_setup_xml
  929.  
  930. else
  931.   echo "Skipping vdr-setup compile"
  932. fi
  933. #
  934. #
  935. if [ $xineliboutput = "on" ]; then
  936.   echo ""; echo "*** XINELIBOUTPUT ***"; echo ""
  937.   apt-get install -y libextractor-dev
  938.   cd $VDRSRC; cvs -z3 -d:pserver:anonymous@xineliboutput.cvs.sourceforge.net:/cvsroot/xineliboutput co vdr-xineliboutput
  939. #  wget http://vdr-portal.de/board/attachment.php?attachmentid=22531&sid=9d272d83a21f4fd9189b7b6a53669c24
  940.   mv vdr-xineliboutput xineliboutput; cd xineliboutput
  941.   $MAKE; make install
  942.   cd ../../../; make plugins # && make install
  943.   mkdir -p /etc/vdr/plugins/xineliboutput; cp *.mpg /etc/vdr/plugins/xineliboutput
  944.  
  945.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P'xineliboutput -l none -r 37890 -p'|" /usr/local/bin/runvdr
  946.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P'xineliboutput -l none -r 37890 -p'|" /usr/local/bin/vdrrun
  947. else
  948.   echo "Skipping XINELIBOUTPUT compile"
  949. fi
  950. #
  951. #
  952. if [ $VDR_XINE = "on" ]; then
  953.   echo ""; echo "*** VDR-XINE ***"; echo ""
  954.   cd /usr/local/src/vdr/PLUGINS/src
  955.   wget http://home.vrweb.de/~rnissl/vdr-$VXINE.tgz || echo "$VXINE dl failure!!!" >> $LOGFILE
  956.   tar xfvz vdr-$VXINE.tgz; mv $VXINE vdr-xine; cd vdr-xine
  957.    if [ $yaepghd = "on" ]; then
  958.       # enable to fully support yaepghd plugin #####
  959.       sed -i 's/#VDR_XINE_SET_VIDEO_WINDOW = 1/VDR_XINE_SET_VIDEO_WINDOW = 1/' Makefile
  960.    fi
  961. make
  962. cd ../../../; make plugins # && make install
  963. sudo mkdir -p /etc/vdr/plugins/xine; cd /usr/local/src/vdr/PLUGINS/src/vdr-xine/data
  964. sudo cp * /etc/vdr/plugins/xine
  965.  
  966. sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P'xine -r'|" /usr/local/bin/runvdr
  967. sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P'xine -r'|" /usr/local/bin/vdrrun
  968. else
  969.   echo "Skipping VDR-XINE compile"
  970. fi
  971. #
  972. #
  973. if [ $dvdplugin = "on" ]; then
  974.   echo ""; echo "*** dvdplugin CVS ***"; echo ""
  975.   apt-get install -y libdvdnav-dev
  976.   cd $VDRSRC
  977.   cvs -z3 -d:pserver:anonymous@dvdplugin.cvs.sourceforge.net:/cvsroot/dvdplugin co -P dvd
  978.   cd ../../; make plugins
  979. else
  980.   echo "Skipping dvdplugin compile"
  981. fi
  982. #
  983. #
  984. if [ $vdr_remote = "on" ]; then
  985.   echo ""; echo "*** vdr-remote-0.4.0 ***"; echo ""
  986.   cd $VDRSRC
  987.   wget http://www.escape-edv.de/endriss/vdr/vdr-remote-0.4.0.tgz || echo "vdr-remote-0.4.0 dl failure!!!" >> $LOGFILE
  988.   tar xzvf vdr-remote-0.4.0.tgz; mv remote-0.4.0 remote; cd remote
  989.   sed -i Makefile -e 's/VDRVERSION/APIVERSION/g'
  990.   cd ../../../; make plugins
  991.     if [ "$Nexus_remote_control" = "true" ]; then
  992.        sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P'remote -i autodetect'|" /usr/local/bin/runvdr
  993.        sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P'remote -i autodetect'|" /usr/local/bin/vdrrun
  994.     else # LIRC REMOTE
  995.        sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P'remote -l /dev/lircd'|" /usr/local/bin/runvdr
  996.        sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P'remote -l /dev/lircd'|" /usr/local/bin/vdrrun
  997.     fi  
  998. else
  999.   echo "Skipping vdr-remote compile"
  1000. fi
  1001. #
  1002. #
  1003. if [ $Reelchannelscan = "on" ]; then
  1004.   echo ""; echo "*** Reel_channelscan-0.6.1 ***"; echo ""
  1005.   cd $VDRSRC
  1006.   svn co svn://reelbox.org/testing/src/vdr-plugins/src/channelscan-0.6.1
  1007.   cd ../../; make plugins
  1008. else
  1009.   echo "Skipping Reelchannelscan compile"
  1010. fi
  1011. #
  1012. #
  1013. if [ $NAScan = "on" ]; then
  1014.   echo ""; echo "*** NAScan 0.3 ***"; echo ""
  1015.   cd $VDRSRC
  1016.   hg clone http://mercurial.intuxication.org/hg/nascan || hg clone http://mercurial.intuxication.org/hg/nascan || echo "nascan dl failure!!!" >> $LOGFILE
  1017.   # hg clone http://freehg.org/u/fepg/nascan/
  1018.   # and to update your local copy: hg pull
  1019.   cd ../../; make plugins
  1020.   mkdir /etc/vdr/plugins/nascan; cp /usr/local/src/vdr/PLUGINS/src/nascan/config/* /etc/vdr/plugins/nascan/
  1021.  
  1022.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P nascan|" /usr/local/bin/runvdr
  1023.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P nascan|" /usr/local/bin/vdrrun
  1024. else
  1025.   echo "Skipping NAScan compile"
  1026. fi
  1027. #
  1028. #
  1029. if [ $osdteletext = "on" ]; then
  1030.   echo ""; echo "*** osdteletext-0.8.3 ***"; echo ""
  1031.   cd $VDRSRC
  1032.   wget http://projects.vdr-developer.org/attachments/download/116/vdr-osdteletext-0.8.3.tgz
  1033.   tar xzvf vdr-osdteletext-0.8.3.tgz
  1034.   mv osdteletext-0.8.3 osdteletext
  1035.   cd ../../
  1036.   make plugins
  1037.   mkdir -p /var/cache/vdr/vtx
  1038.  
  1039.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P osdteletext|" /usr/local/bin/runvdr
  1040.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P osdteletext|" /usr/local/bin/vdrrun
  1041. else
  1042.   echo "Skipping osdteletext compile"
  1043. fi
  1044. #
  1045. #
  1046. if [ $femon = "on" ]; then
  1047.   echo ""; echo "*** femon 1.7.2 ***"; echo ""
  1048.   cd $VDRSRC
  1049.   wget http://www.saunalahti.fi/~rahrenbe/vdr/femon/files/vdr-femon-1.7.2.tgz || echo "femon dl failure!!!" >> $LOGFILE
  1050.   tar xzvf vdr-femon-1.7.2.tgz
  1051.   mv femon-1.7.2 femon; cd ../../; make plugins
  1052.  
  1053.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P femon|" /usr/local/bin/runvdr
  1054.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P femon|" /usr/local/bin/vdrrun
  1055. else
  1056.   echo "Skipping femon compile"
  1057. fi
  1058. #
  1059. #
  1060. if [ $Skin_Enigma = "on" ]; then
  1061.   echo ""; echo "*** Skin Enigma ***"; echo ""
  1062.   cd $VDRSRC; wget http://andreas.vdr-developer.org/enigmang/download/vdr-skinenigmang-0.1.0.tgz || echo "skinenigmang dl failure!!!" >> $LOGFILE
  1063.   tar xivf vdr-skinenigmang-0.1.0.tgz; mv skinenigmang-0.1.0 skinenigmang
  1064.   cd ../../; make plugins
  1065.   mkdir -p /etc/vdr/plugins/skinenigmang;cd /etc/vdr/plugins; wget http://andreas.vdr-developer.org/enigmang/download/skinenigmang-logos-xpm-hi-20070702.tgz
  1066.   wget http://andreas.vdr-developer.org/enigmang/download/skinenigmang-channellogos-xpm-hi-20070702.tgz; wget http://andreas.vdr-developer.org/enigmang/download/skinenigmang-fonts-20080225.tgz
  1067.   tar xzvf skinenigmang-channellogos-xpm-hi-20070702.tgz; tar xzvf skinenigmang-channellogos-xpm-hi-20070702.tgz; tar xzvf skinenigmang-fonts-20080225.tgz
  1068.  
  1069.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P skinenigmang|" /usr/local/bin/runvdr
  1070.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P skinenigmang|" /usr/local/bin/vdrrun
  1071. else
  1072.   echo "Skipping Skin Enigma compile"
  1073. fi
  1074. #
  1075. #
  1076. if [ $Skin_Reel = "on" ]; then
  1077. echo ""; echo "*** SkinReel ***"; echo ""
  1078. cd $VDRSRC; wget http://rsync16.de.gentoo.org/files/vdr-skinreel/vdr-skinreel-0.0.1.tgz
  1079. tar xzvf vdr-skinreel-0.0.1.tgz; mv skinreel-0.0.1 skinreel; cd skinreel
  1080. sed -i Makefile -e 's/VDRVERSION/APIVERSION/g'
  1081. cp -r skinreel /etc/vdr/plugins/; cd ../../../; make plugins
  1082.  
  1083.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P skinreel|" /usr/local/bin/runvdr
  1084.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P skinreel|" /usr/local/bin/vdrrun
  1085. else
  1086.   echo "Skipping Skin_Reel compile"
  1087. fi
  1088. #
  1089. #
  1090. if [ $SC = "on" ]; then
  1091.   echo ""; echo "***SC***"; echo ""
  1092.   cd $VDRSRC; sudo apt-get install -y libssl-dev subversion libbz2-dev
  1093.   # cd /usr/local/src/vdr/PLUGINS/src/sc; svn update
  1094.   #svn co http://opensvn.csie.org/opensascng/open-sasc-ng/sc/PLUGINS/src/sc-src sc
  1095.   #svn co http://opensvn.csie.org/opensascng/open-sasc-ng/FFdecsa sc/FFdecsa
  1096.   hg clone -r trunk http://85.17.209.13:6100/sc || hg clone -r trunk http://85.17.209.13:6100/sc || echo "sc dl failure!!!" >> $LOGFILE
  1097.   #hg pull -r trunk http://85.17.209:6100/sc
  1098. sed -i 's|CSAFLAGS   ?= -Wall -fPIC -g -O3 -mmmx -fomit-frame-pointer -fexpensive-optimizations -funroll-loops|CSAFLAGS   ?= -Wall -fPIC -g -O2 -mmmx -fomit-frame-pointer -fexpensive-optimizations -funroll-loops|' /usr/local/src/vdr/PLUGINS/src/sc/Makefile  
  1099.      ################
  1100.      # 64_bit_check #
  1101.      ################
  1102.      if uname -m  | grep "x86_64"; then
  1103.        echo "64bit detected"; sed -i 's/^CPUOPT.*/CPUOPT ?= athlon64/' /usr/local/src/vdr/PLUGINS/src/sc/Makefile
  1104.     else
  1105.        echo "32bit"
  1106.     fi
  1107.      #
  1108.   cd ../../; make plugins
  1109.   sudo mkdir -p /etc/vdr/plugins/sc; cp -r /media/KINGSTON/appz/camfiles/* /etc/vdr/plugins/sc
  1110.   cp /usr/local/src/vdr/PLUGINS/src/sc/examples/override.conf.example /etc/vdr/plugins/sc/override.conf
  1111.  
  1112.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P sc|" /usr/local/bin/runvdr
  1113.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P sc|" /usr/local/bin/vdrrun
  1114. else
  1115.   echo "Skipping SC compile"
  1116. fi
  1117. #
  1118. #
  1119. if [ $Soppalusikka_Skin = "on" ]; then
  1120.   echo ""; echo "*** Soppalusikka Skin ***"; echo ""
  1121.   cd $VDRSRC
  1122.   wget http://www.saunalahti.fi/~rahrenbe/vdr/soppalusikka/files/vdr-skinsoppalusikka-1.6.4.tgz || echo "skinsoppalusikka dl failure!!!" >> $LOGFILE
  1123.   tar -xzf vdr-skinsoppalusikka-1.6.4.tgz; mv skinsoppalusikka-1.6.4 skinsoppalusikka
  1124.   wget http://captiveworks.org/open-source/vdr-skinsoppalusikka/files/vdr-1.5.8-plugin-skinsoppalusika-1.1.1-attenuate.diff
  1125.                      # Attenuate_patch # To TEST
  1126.   cd skinsoppalusikka; #patch -p1 < ../vdr-1.5.8-plugin-skinsoppalusika-1.1.1-attenuate.diff && echo "Attenuate patch applied" >> $LOGFILE
  1127.   mkdir /etc/vdr/plugins/skinsoppalusikka; mkdir /etc/vdr/plugins/themes
  1128.   #cp -d /path/to/channel/logos/*.xpm /etc/vdr/plugins/skinsoppalusikka
  1129.   cd ..; cp -d skinsoppalusikka/themes/*.theme /etc/vdr/plugins/themes; cd ../../
  1130.   make plugins
  1131.  
  1132.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P skinsoppalusikka|" /usr/local/bin/runvdr
  1133.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P skinsoppalusikka|" /usr/local/bin/vdrrun
  1134. else
  1135.   echo "Skipping Soppalusikka Skin compile"
  1136. fi
  1137. #
  1138. #
  1139. if [ $YAEPGHD = "on" ]; then
  1140.   echo ""; echo "*** YAEPGHD ***"; echo ""
  1141.   apt-get install -y git-core libmagick++-dev
  1142.   cd /usr/local/src; cp -r vdr-plugin-yaepghd $VDRSRC; cd $VDRSRC
  1143.   mv vdr-plugin-yaepghd yaepghd; cd yaepghd; make; cd ../../../
  1144.   make plugins
  1145.   cp -r /usr/local/src/vdr/PLUGINS/src/yaepghd/yaepghd /etc/vdr/plugins
  1146.  
  1147.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P yaepghd|" /usr/local/bin/runvdr
  1148.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P yaepghd|" /usr/local/bin/vdrrun
  1149. else
  1150.   echo "Skipping YAEPGHD compile"
  1151. fi
  1152. #
  1153. #
  1154. if [ $StreamDev = "on" ]; then
  1155.   echo ""; echo "*** StreamDev ***"; echo ""
  1156.   apt-get install -y cvs
  1157.   cd $VDRSRC
  1158.   cvs -d:pserver:anoncvs@vdr-developer.org:/var/cvsroot co streamdev
  1159.   sudo mkdir -p /etc/vdr/plugins/streamdev; cd streamdev; sudo cp streamdev/streamdevhosts.conf /etc/vdr/plugins/streamdev
  1160.   sudo cp streamdev/streamdevhosts.conf /etc/vdr/vdrsvdrphosts.conf; cd ../../../
  1161.   make plugins
  1162.  
  1163.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P streamdev-server|" /usr/local/bin/runvdr
  1164.   sed -i "s|-s /usr/local/bin/vdrpoweroff|& -P streamdev-server|" /usr/local/bin/vdrrun
  1165. else
  1166.   echo "Skipping StreamDev compile"
  1167. fi
  1168. #
  1169. #
  1170. if [ $Channelswitcher = "on" ]; then
  1171.   echo ""; echo "Channelswitcher"; echo ""
  1172.   cd $VDRSRC
  1173.   wget http://www.freewebs.com/sadhome/Plugin/Channelswitcher/vdr-channelswitcher-0.0.1b.tar.gz
  1174.   tar -xvvzf vdr-channelswitcher-0.0.1b.tar.gz
  1175.   mv channelswitcher-0.0.1b channelswitcher
  1176.   cd channelswitcher; sed -i Makefile -e 's/VDRVERSION/APIVERSION/'
  1177.   cd ../../../; make plugins
  1178. else
  1179.   echo "Skipping Channelswitcher compile"
  1180. fi
  1181. #
  1182. #
  1183. if [ $vdr_browse = "on" ]; then
  1184.   echo ""; echo "vdr-browse-0.2.0"; echo ""
  1185.   cd $VDRSRC
  1186.   wget http://www.fepg.org/files/vdr-browse-0.2.0.tgz
  1187.   tar -xvvf vdr-browse-0.2.0.tgz
  1188.   mv browse-0.2.0 browse
  1189.   cd ../../; make plugins
  1190. else
  1191.   echo "Skipping vdr-browse-0.2.0 compile"
  1192. fi
  1193. #
  1194. #
  1195. echo ""; echo "*** Final compilation ***"; echo ""
  1196. cd /usr/local/src/vdr
  1197.  
  1198.  
  1199. mv /usr/local/bin/runvdr /usr/local/bin/runvdr_tmp_bak
  1200.  
  1201.  
  1202. sudo apt-get purge -y vdr
  1203. sudo checkinstall --fstrans=no --install=yes --pkgname=vdr --pkgversion "$VDR-5ubuntu2-1" --default
  1204. sudo mkdir /media/video; sudo mkdir -p /usr/lib/vdr/plugins; sudo mkdir -p /usr/lib/vdr/scripts; sudo mkdir -p /etc/vdr/plugins; cp -a svdrpsend.pl /usr/bin; cp *.conf /etc/vdr
  1205. /usr/local/bin/vdr --help
  1206. log_0_check; timer_stop >> $LOGFILE; line
  1207. mv vdr*.deb $PACKAGES
  1208.  
  1209.  
  1210. rm /usr/local/bin/runvdr; mv /usr/local/bin/runvdr_tmp_bak /usr/local/bin/runvdr; chmod a+x /usr/local/bin/runvdr
  1211.  
  1212.  
  1213. ####################################
  1214. # My Remote.conf (off by default)###
  1215. ####################################
  1216. #remote_conf="off" # //default="off"(force remote plugins to detect your remote and choose your own buttons,
  1217.                  # "on" = My Mce remote settings, You should put your own remote.conf here, if you want to enable "on" this part.
  1218.  
  1219. if [ "$Mce_remote_conf" = "on" ]; then
  1220. echo "
  1221. LIRC.Up         Up
  1222. LIRC.Down       Down
  1223. LIRC.Menu       Enter
  1224. LIRC.Ok         OK
  1225. LIRC.Back       Back
  1226. LIRC.Left       Left
  1227. LIRC.Right      Right
  1228. LIRC.Red        Red
  1229. LIRC.Green      Green
  1230. LIRC.Yellow     Yellow
  1231. LIRC.Blue       Blue
  1232. LIRC.0          Zero
  1233. LIRC.1          One
  1234. LIRC.2          Two
  1235. LIRC.3          Three
  1236. LIRC.4          Four
  1237. LIRC.5          Five
  1238. LIRC.6          Six
  1239. LIRC.7          Seven
  1240. LIRC.8          Eight
  1241. LIRC.9          Nine
  1242. LIRC.Info       More
  1243. LIRC.Play       Play
  1244. LIRC.Pause      Pause
  1245. LIRC.Stop       Stop
  1246. LIRC.Record     Record
  1247. LIRC.FastFwd    Forward
  1248. LIRC.FastRew    Rewind
  1249. LIRC.Next       Skip
  1250. LIRC.Prev       Replay
  1251. LIRC.Power      Power
  1252. LIRC.Channel+   ChanUp
  1253. LIRC.Channel-   ChanDown
  1254. LIRC.PrevChannel Clear
  1255. LIRC.Volume+    VolUp
  1256. LIRC.Volume-    VolDown
  1257. LIRC.Mute       Mute
  1258. LIRC.Audio      Music
  1259. LIRC.Subtitles  Teletext
  1260. LIRC.Schedule   Guide
  1261. LIRC.Channels   LiveTV
  1262. LIRC.Timers     DVD
  1263. LIRC.Recordings RecTV
  1264. LIRC.Setup      Aspect
  1265. LIRC.User1      Home" >> /etc/vdr/remote.conf
  1266.  
  1267. else
  1268. echo "/etc/vdr/remote.conf skipped"
  1269. fi
  1270. #
  1271. if [ "$Hvr_4000_remote" = "on" ]; then
  1272. echo '
  1273. KERNEL=="event*", ATTRS{vendor}=="0x14f1", SYMLINK="input/irremote"' >> /etc/udev/rules.d/55-local.rules
  1274. #
  1275. echo '
  1276. REMOTE="Hauppauge NOVA-HD-S2"
  1277. REMOTE_MODULES=""
  1278. REMOTE_DRIVER="devinput"
  1279. # Next 2 lines will work as long as you have just 1 remote
  1280. #Both the event and the by-path value can change so this way works fine
  1281. #TEMPIREVENT=`ls /dev/input/by-path/ |grep event-ir`
  1282. #REMOTE_DEVICE="/dev/input/by-path/$TEMPIREVENT"
  1283. #Next line ONLY if you have the Hauppage NOVA-S2-HD remote control otherwise # and un# the other two before
  1284. REMOTE_DEVICE="/dev/input/irremote"
  1285. REMOTE_LIRCD_CONF="/etc/lircd.conf"
  1286. REMOTE_LIRCD_ARGS=""
  1287. TRANSMITTER="None"
  1288. TRANSMITTER_MODULES=""
  1289. TRANSMITTER_DRIVER=""
  1290. TRANSMITTER_DEVICE=""
  1291. TRANSMITTER_LIRCD_CONF=""
  1292. TRANSMITTER_LIRCD_ARGS=""
  1293. START_LIRCD="true"
  1294. START_LIRCMD=""
  1295. LOAD_MODULES=""
  1296. LIRCMD_CONF=""
  1297. FORCE_NONINTERACTIVE_RECONFIGURATION="false"' >> /etc/lirc/hardware.conf
  1298. #
  1299. echo '
  1300. # brand:                       Hauppauge NOVA-HD-S2
  1301. # model no. of remote control: Hauppage NOVA-HD-S2 Snowboard Shape Silver over Black
  1302. #
  1303.  
  1304. begin remote
  1305.  
  1306. name  NOVA-HD-S2
  1307.  bits           16
  1308. eps            30
  1309. aeps          100
  1310.  
  1311. one             0     0
  1312. zero            0     0
  1313.  pre_data_bits   16
  1314.  pre_data       0x8001
  1315.  gap          133325
  1316.  toggle_bit_mask 0x8001001C
  1317.  
  1318.    begin codes
  1319.         Pictures                 0x016F
  1320.         Go                       0x0161
  1321.         Text                     0x0184
  1322.         TV                       0x0179
  1323.         Videos                   0x0189
  1324.         Music                    0x0188
  1325.         Guide                    0x016D
  1326.         Radio                    0x0181
  1327.         ArrowUp                  0x0067
  1328.         ArrowDown                0x006C
  1329.         ArrowLeft                0x0069
  1330.         ArrowRight               0x006A
  1331.         Enter                    0x001C
  1332.         BackExit                 0x00AE
  1333.         Menu                     0x008B
  1334.         PrevCh                   0x019C
  1335.         Mute                     0x0071
  1336.         VolumeUp                 0x0073
  1337.         VolumeDown               0x0072
  1338.         ChannelUp                0x0192
  1339.         ChannelDown              0x0193
  1340.        Record                   0x00A7
  1341.         Stop                     0x0080
  1342.         Play                     0x00CF
  1343.         Pause                    0x0077
  1344.         Sub                      0x0172
  1345.         Power                    0x0074
  1346.         Rewind                   0x00A8
  1347.         Fwdwind                  0x00D0
  1348.         Sleep                    0x008E
  1349.         NextSong                 0x00A3
  1350.         PrevSong                 0x00A5
  1351.         1                        0x0002
  1352.         2                        0x0003
  1353.         3                        0x0004
  1354.         4                        0x0005
  1355.         5                        0x0006
  1356.         6                        0x0007
  1357.         7                        0x0008
  1358.         8                        0x0009
  1359.         9                        0x000A
  1360.         0                        0x000B
  1361.         Red                      0x018E
  1362.         Green                    0x018F
  1363.         Yellow                   0x0190
  1364.         Blue                     0x0191
  1365.  
  1366.  
  1367. end codes
  1368.  
  1369. end remote' >> /etc/lirc/lircd.conf
  1370. #
  1371. echo "
  1372. LIRC.Up         ArrowUp
  1373. LIRC.Down       ArrowDown
  1374. LIRC.Left       ArrowLeft
  1375. LIRC.Right      ArrowRight
  1376. LIRC.Ok         Enter
  1377. LIRC.0          0
  1378. LIRC.1          1
  1379. LIRC.2          2
  1380. LIRC.3          3
  1381. LIRC.4          4
  1382. LIRC.5          5
  1383. LIRC.6          6
  1384. LIRC.7          7
  1385. LIRC.8          8
  1386. LIRC.9          9
  1387. LIRC.Menu       NextSong
  1388. LIRC.Back       BackExit
  1389. LIRC.Red        Red
  1390. LIRC.Green      Green
  1391. LIRC.Yellow     Yellow
  1392. LIRC.Blue       Blue
  1393. LIRC.Info       Menu
  1394. LIRC.Stop       Stop
  1395. LIRC.Record     Record
  1396. LIRC.Play       Play
  1397. LIRC.Pause      Pause
  1398. LIRC.FastFwd    Fwdwind
  1399. LIRC.FastRew    Rewind
  1400. LIRC.PrevChannel PrevCh
  1401. LIRC.Volume+    VolumeUp
  1402. LIRC.Volume-    VolumeDown
  1403. LIRC.Mute       Mute
  1404. LIRC.Audio      Text
  1405. LIRC.Subtitles  Sub
  1406. LIRC.Channels   TV
  1407. LIRC.Schedule   Guide
  1408. LIRC.Recordings Pictures
  1409. LIRC.Setup      PrevSong
  1410. LIRC.Channel+   ChannelUp
  1411. LIRC.Channel-   ChannelDown" >> /etc/vdr/remote.conf
  1412.  
  1413. else
  1414. echo "Hvr_4000_remote skipped"
  1415. fi
  1416. ####################################
  1417. # My setup.conf (off by default) ###
  1418. ####################################
  1419. setup_conf="on"    # //default="off ???"
  1420.  
  1421. if [ "$setup_conf" = "on" ]; then
  1422. echo "
  1423. AntiAlias = 1
  1424. AudioLanguages =
  1425. ChannelEntryTimeout = 2000
  1426. ChannelInfoPos = 0
  1427. ChannelInfoTime = 5
  1428. CurrentChannel = 111
  1429. CurrentDolby = 0
  1430. CurrentVolume = 255
  1431. DefaultLifetime = 99
  1432. DefaultPriority = 50
  1433. DiSEqC = 0
  1434. DisplaySubtitles = 0
  1435. EmergencyExit = 1
  1436. EPGBugfixLevel = 3
  1437. EPGLanguages =
  1438. EPGLinger = 0
  1439. EPGScanTimeout = 5
  1440. FontFix = Courier:Bold
  1441. FontFixSize = 18
  1442. FontFixSizeP = 0.031000
  1443. FontOsd = Sans Serif:Bold
  1444. FontOsdSize = 22
  1445. FontOsdSizeP = 0.038000
  1446. FontSml = Sans Serif
  1447. FontSmlSize = 20
  1448. FontSmlSizeP = 0.035000
  1449. InitialChannel = 0
  1450. InitialVolume = -1
  1451. InstantRecordTime = 180
  1452. LnbFrequHi = 11250
  1453. LnbFrequLo = 11250
  1454. LnbSLOF = 0
  1455. MarginStart = 2
  1456. MarginStop = 10
  1457. MarkInstantRecord = 1
  1458. MaxVideoFileSize = 2000
  1459. MenuKeyCloses = 0
  1460. MenuScrollPage = 1
  1461. MenuScrollWrap = 0
  1462. MinEventTimeout = 30
  1463. MinUserInactivity = 0
  1464. MultiSpeedMode = 0
  1465. NameInstantRecord = TITLE EPISODE
  1466. NextWakeupTime = 0
  1467. OSDAspect = 1.066667
  1468. OSDHeight = 484
  1469. OSDHeightP = 0.840000
  1470. OSDLanguage = en_US
  1471. OSDLeft = 58
  1472. OSDLeftP = 0.080000
  1473. OSDMessageTime = 1
  1474. OSDSkin = soppalusikka
  1475. OSDTheme = default
  1476. OSDTop = 46
  1477. OSDTopP = 0.080000
  1478. OSDWidth = 624
  1479. OSDWidthP = 0.870000
  1480. PauseKeyHandling = 2
  1481. PauseLifetime = 1
  1482. PausePriority = 10
  1483. PrimaryDVB = 2
  1484. PrimaryLimit = 0
  1485. RecordingDirs = 1
  1486. ResumeID = 0
  1487. SetSystemTime = 0
  1488. ShowInfoOnChSwitch = 1
  1489. ShowReplayMode = 0
  1490. SplitEditedFiles = 0
  1491. SubtitleBgTransparency = 0
  1492. SubtitleFgTransparency = 0
  1493. SubtitleLanguages =
  1494. SubtitleOffset = 0
  1495. SVDRPTimeout = 300
  1496. TimeoutRequChInfo = 1
  1497. TimeSource = 0
  1498. TimeTransponder = 0
  1499. UpdateChannels = 5
  1500. UseDolbyDigital = 1
  1501. UseSmallFont = 1
  1502. UseSubtitle = 1
  1503. UseVps = 0
  1504. VideoDisplayFormat = 1
  1505. VideoFormat = 0
  1506. VpsMargin = 120
  1507. ZapTimeout = 3
  1508. streamdev-client.HideMenuEntry = 0
  1509. streamdev-client.MaxPriority = 99
  1510. streamdev-client.MinPriority = -1
  1511. streamdev-client.RemoteIp = 192.168.0.103
  1512. streamdev-client.RemotePort = 2004
  1513. streamdev-client.StartClient = 1
  1514. streamdev-client.StreamFilters = 0
  1515. streamdev-client.SyncEPG = 1" >> /etc/vdr/setup.conf
  1516.  
  1517. else
  1518.   echo "setup.conf skipped"
  1519. fi
  1520.          
  1521. ##########################
  1522. #                      ###
  1523. #  VDR CONFIGURATIONS  ###
  1524. #                      ###
  1525. ##########################
  1526. timer_start
  1527.  
  1528. echo "vdr configurations" >> $LOGFILE
  1529. echo "*** svdrphosts.conf setup ***"; rm /etc/vdr/svdrphosts.conf; touch /etc/vdr/svdrphosts.conf
  1530. echo "#
  1531. # svdrphosts    This file describes a number of host addresses that
  1532. #               are allowed to connect to the SVDRP port of the Video
  1533. #               Disk Recorder (VDR) running on this system.
  1534. # Syntax:
  1535. #
  1536. # IP-Address[/Netmask]
  1537. #
  1538.  
  1539. 127.0.0.1             # always accept localhost
  1540. 192.168.0.0/24     # any host on the local net
  1541. #204.152.189.113      # a specific host
  1542. #0.0.0.0/0            # any host on any net (USE THIS WITH CARE!)" >> /etc/vdr/svdrphosts.conf
  1543. sudo nano -w /etc/vdr/svdrphosts.conf && echo "*** diseqc.conf setup ***"
  1544. # DISEQC.conf
  1545. rm /etc/vdr/diseqc.conf; touch /etc/vdr/diseqc.conf
  1546. echo "## DishPro LNB Config
  1547. ## Sample DishPro diseqc.conf  You will need to substitute the # signs with
  1548. ## the Satellite you are trying to add.  It must match what is in your
  1549. ## sources.conf
  1550. #
  1551. # THIS EXAMPLE WORKS FOR A DISH_1000.2 LNBF:
  1552. # Port 1
  1553. S119.0W 99999 V 11250 t v W15 [E0 10 38 F1]
  1554. S119.0W 99999 H 14350 t V W15 [E0 10 38 F1]
  1555.  
  1556. # Port 2
  1557. S110.0W 99999 V 11250 t v W15 [E0 10 38 F5]
  1558. S110.0W 99999 H 14350 t V W15 [E0 10 38 F5]
  1559.  
  1560.  
  1561. # Port 3
  1562. S129.0W 99999 V 11250 t v W15 [E0 10 38 F9]
  1563. S129.0W 99999 H 14350 t V W15 [E0 10 38 F9]
  1564.  
  1565. ##DISH LEGACY SETUP
  1566. ## Satellite you are trying to add.  It must match what is in your
  1567. ## sources.conf
  1568.  
  1569. # Port 1
  1570. #S91.0W 99999 V 11250 t v W15 [E0 10 38 F1]
  1571. #S91.0W 99999 H 11250 t V W15 [E0 10 38 F3]
  1572.  
  1573. # Port 2
  1574. #S82.0W 99999 V 11250 t v W15 [E0 10 38 F5]
  1575. #S82.0W 99999 H 11250 t V W15 [E0 10 38 F7] " >> /etc/vdr/diseqc.conf
  1576. sudo nano -w /etc/vdr/diseqc.conf && echo "*** keymacros.conf setup ***";
  1577. # KEYMACROS.conf
  1578. rm /etc/vdr/keymacros.conf; touch /etc/vdr/keymacros.conf
  1579. echo "# Remote control key macros for VDR
  1580. # I HAVE ADD FOR YOU yaepghd ON BLUE KEY ###
  1581. # Format:
  1582. #
  1583. # macrokey  key1 key2 key3...
  1584. # macrokey  @plugin key1 key2 key3...
  1585. #
  1586. # See man vdr(5)
  1587.  
  1588. Red       Recordings
  1589. Green     Schedule
  1590. Yellow    Info
  1591. Blue      Timers
  1592. User1     @yaepghd" >> /etc/vdr/keymacros.conf
  1593. sudo nano -w /etc/vdr/keymacros.conf
  1594.  
  1595. if [ $NAScan = "on" ]; then
  1596. sudo nano -w /etc/vdr/plugins/nascan/sources.conf
  1597. fi
  1598.  
  1599.  
  1600. # MAKE SURE ALSA MIXER ISN'T MUTED
  1601. amixer set Master 100% unmute
  1602. amixer set Front 100% unmute
  1603. amixer set IEC958 unmute
  1604. amixer set PCM 100% unmute
  1605.  
  1606. timer_stop; line
  1607. clear; echo "Finished:" >> $LOGFILE; date >> $LOGFILE
  1608. sc_check; echo ""; echo ""; echo "*** To complete the install type: reboot ***"; echo ""; exit 0
  1609.  
  1610.  
  1611. ;;
  1612.  
  1613.  
  1614.      ###########################################
  1615. 6.1) # Remove VDR & plugins & configurations ###
  1616.      ###########################################
  1617. dpkg -r vdr
  1618. rm -r /etc/vdr
  1619. rm /usr/local/bin/vdrrun; rm /usr/local/bin/runvdr
  1620. cd $SRC; rm -r vdr $VDR vdr-plugin-yaepghd $VXINE
  1621. rm $VDR.tar.bz2 $VXINE.tgz vdr-1.5.9-dn-eit.0.3.3.diff
  1622. rm $PACKAGES/vdr*.deb
  1623. echo "[7] Remove VDR & plugins & configurations" >> $LOGFILE
  1624. echo "Finished:" >> $LOGFILE; date >> $LOGFILE; line
  1625. ;;
  1626.  
  1627.    ###########
  1628. 7) # NSCAN ###
  1629.    ###########
  1630. date >> $LOGFILE
  1631. cp /home/$USR/Desktop/nscan-2.0.7.tar.bz2 || cp $USB/appz/nscan/nscan-2.0.7.tar.bz2 $SRC
  1632. if [ -f $SRC/nscan-2.0.7.tar.bz2 ]; then
  1633.    echo "OK Nscan_check_file"; else
  1634.      echo "Nscan_check FAILED" >> $LOGFILE
  1635.      clear; echo ""
  1636.      echo "##############################################################################################"
  1637.      echo "# ---------------!!! COULD NOT DETECT Nscan-2.0.7 FILE ...!!!"
  1638.      echo "# - YOU MUST DOWNLOAD Nscan-2.0.7 BEFORE COMPILING IT  ...!!!"
  1639.      echo "#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
  1640.      echo "# - Link to Nscan-2.0.7 thread: http://dvbn.happysat.org/viewtopic.php?f=17&t=50912&start=0"
  1641.      echo "# - You should have a download link there on the first post"
  1642.      echo "# - DOWNLOAD Nscan-2.0.7 WITH MOZILLA TO YOUR DESKTOP AND THEN RE-EXECUTE THIS INSTAL STEP"
  1643.      echo "##############################################################################################"
  1644.      echo ""
  1645.      press_enter; exit 1
  1646. fi
  1647. if  [ -d $V4LDVB ]; then
  1648.     echo "$V4LDVB is there"; else
  1649.     echo "V4L-DVB ERROR CHECK FAIL TO DETECT YOUR FOLDER"; echo "Press [enter] key to continue. . ."; read enterKey; exit 0
  1650. fi
  1651. # Compile nscan
  1652. if [ -f $PACKAGES/nscan2.0.7*.deb ]; then
  1653.     echo "Package is there, skip compilation"
  1654. else # compile
  1655.     apt-get install -y checkinstall
  1656.     cd $SRC; mkdir /etc/vdr; tar xivf nscan-2.0.7.tar.bz2; mv nscan-2.0.7 nscan; cd nscan
  1657.     echo "[8] Nscan compilation" >> $LOGFILE
  1658.  
  1659. # 64_bit_check & fix
  1660. if uname -m | grep "x86_64"; then
  1661.     echo "64bit"
  1662.     sed -i 's/(u_int)/(u_long)/' $SRC/nscan/nutils.c
  1663.     sed -i 's/(int)/(long)/' $SRC/nscan/nsdt.c
  1664.     sed -i 's/(int)/(long)/' $SRC/nscan/nnit.c
  1665.     sed -i 's/(int)/(long)/g' $SRC/nscan/nscan.c
  1666. else
  1667.     echo "32 bit"
  1668. fi
  1669.  
  1670.     make && sudo checkinstall --pkgname=nscan2.0.7 --default
  1671.     log_0_check; press_enter
  1672.     mv nscan2.0.7*.deb $PACKAGES
  1673. fi
  1674. killall vdr
  1675. while :
  1676. do
  1677.     clear
  1678.     echo "------------------------------------------------------------"
  1679.     echo "                     NSCAN-2.0.7 "
  1680.     echo "------------------------------------------------------------"
  1681.     echo
  1682.     echo "[1] DishPro & DishProPlus 119-110-129w"
  1683.     echo "[2] Legacy Lnbf-110-119-129w"
  1684.     echo "[3] DishPro x2 Lnbf Bev-82-91w OR Dish-110-119w"
  1685.     echo "[4] Legacy x2 Lnbf-82-91w OR Dish-110-119w"
  1686.     echo "[5] 129w only"
  1687.     echo "[6] 1 DishPro Lnbf"
  1688.     echo "[7] 1 Legacy Lnbf"
  1689.     echo "[8] Exit/Stop"
  1690.     echo "============================================================"
  1691. echo ""; echo "IF no preset available for your setup you can use the scan script that come with nscan-2.0.7 and edit your own"; echo ""
  1692.     echo
  1693.     echo -n "Enter your menu choice [1-8]: "
  1694.     read yourch
  1695.     case $yourch in
  1696. 1)timer_start
  1697. scan_array=(
  1698. #      "nscan command line........" "padding"
  1699.         "0 12239 l 20000 1 9 2 5 0" "0"
  1700.         "1 12239 l 20000 1 9 2 5 0" "0"
  1701.         "2 12545 r 21500 2 9 2 5 0" "0"
  1702. )
  1703. ;;
  1704. 2)timer_start
  1705. scan_array=(
  1706. #      "nscan command line........" "padding"
  1707.         "0 12224 v 20000 1 9 0 5 0" "0"
  1708.         "1 12224 v 20000 1 9 0 5 0" "0"
  1709.         "2 12545 r 21500 2 9 0 5 0" "0"
  1710. )
  1711. ;;
  1712. 3)timer_start
  1713. scan_array=(
  1714. #      "nscan command line........" "padding"
  1715.         "0 12239 l 20000 1 9 2 5 0" "0"
  1716.         "1 12239 l 20000 1 9 2 5 0" "0"
  1717. )
  1718. ;;
  1719. 4)timer_start
  1720. scan_array=(
  1721. #      "nscan command line........" "padding"
  1722.         "0 12239 l 20000 1 9 0 5 0" "0"
  1723.         "1 12239 l 20000 1 9 0 5 0" "0"
  1724. )
  1725. ;;
  1726. 5)timer_start
  1727. scan_array=(
  1728. #      "nscan command line........" "padding"
  1729.         "2 12486 r 21500 2 9 2 5 0" "0"
  1730. )
  1731. ;;
  1732. 6)timer_start
  1733. scan_array=(
  1734. #      "nscan command line........" "padding"
  1735.         "0 12239 l 20000 1 9 2 5 0" "0"
  1736. )
  1737. ;;
  1738. 7)timer_start
  1739. scan_array=(
  1740. #      "nscan command line........" "padding"
  1741.         "0 12239 l 20000 1 9 0 5 0" "0"
  1742. )
  1743. ;;
  1744. 8) timer_stop; echo "exit"; exit 0
  1745. ;;
  1746. *) ;;
  1747. esac
  1748.  
  1749.  
  1750. let SEQ_MAX="${#scan_array[@]}"-1
  1751. for INDEX in `seq 0 2 $SEQ_MAX`; do
  1752.         FILE="/tmp/scan-index$INDEX.tmp"
  1753.         let PORT=`echo ${scan_array[$INDEX]} |cut -d' ' -f1`+1
  1754.         echo -en "\nscanning port $PORT: "
  1755.         $NSCAN ${scan_array[$INDEX]} >$FILE
  1756.         echo "found `cat $FILE |wc -l` channels at `cat $FILE |cut -d: -f4 |head -1`"
  1757.         let PADDING="${scan_array[$INDEX+1]}"
  1758.         if [ "$PADDING" -gt "0" ]; then
  1759.                 echo "padding with $PADDING"
  1760.                 cat $FILE |awk -v PAD=$PADDING 'BEGIN { OFS=FS=":" } { $NF+=PAD; print $0 }' >$FILE.pad
  1761.                 mv $FILE.pad $FILE
  1762.         fi
  1763.         cat $FILE >>/tmp/$CONF.tmp
  1764. done
  1765. echo "TOTAL CHANNELS: `cat /tmp/$CONF.tmp |wc -l`"
  1766. cat /tmp/$CONF.tmp |sort -n -t : -k 13 |uniq |awk 'BEGIN { FS=":" } { printf(":@%s\n%s:%s:%s:%s:%s:%s:%s:%s:%s:%s:%s:%s:%s\n", \
  1767. $13, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13 ); }' >$CFGDIR/$CONF
  1768. echo "wrote $CFGDIR/channels.conf"
  1769.  
  1770. cd /etc/vdr
  1771. #Channels.conf just created back-up
  1772. cp channels.conf.2* channels-bak.conf
  1773. timestamp=`date +%Y%m%d.%R`
  1774. mv channels-bak.conf channels-bak.conf$timestamp
  1775. sudo rm /etc/vdr/channels.conf
  1776. mv channels.conf.2* channels.conf
  1777. timer_stop; press_enter
  1778. done
  1779. ;;
  1780.  
  1781.  
  1782. 7.1)  # TO REMOVE NSCAN
  1783. dpkg -r nscan2.0.7; cd /usr/local/src; rm nscan*.tar.bz2; rm -r nscan-2.0.7
  1784. ;;
  1785.  
  1786.  
  1787. 8)
  1788. echo "Exit-Stopped" >> $LOGFILE; date >> $LOGFILE; line;  exit 0
  1789. ;;
  1790. *) ;;
  1791. esac
  1792. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement