Sunday, July 4, 2010

g-Cpan is my shepherd

The electronic TV guide for MythTV sucks! At least for Australia. I got put onto a little perl program called Shepherd. Basically "Shepherd provides reliable, high-quality Australian TV guide data by employing a flock of independent data sources." This is the good stuff! I read on about how Shepherd works and I was impressed enough to try it. The install instructions were pretty easy to follow. I installed version 1.4.0 Your mileage may vary with another version. If you're a Gentoo user you'll need the following mandatory packages installed for shepherd:

  • dev-lang/perl

  • dev-perl/libwww-perl

  • media-tv/xmltv

  • perl-core/IO-Compress

  • dev-perl/DateManip

  • dev-perl/Algorithm-Diff

  • dev-perl/Digest-SHA1

  • dev-perl/File-Find-Rule


The optional dependencies are listed on the Installation page, under Non-Distribution Specific They correspond to the following Gentoo packages.

  • dev-perl/Archive-Zip

  • dev-perl/DateTime-Format-Strptime

  • dev-perl/Crypt-SSLeay

  • dev-perl/GD

  • dev-perl/HTTP-Cache-Transparent

  • dev-perl/HTML-Parser

  • dev-perl/HTML-Tree

  • dev-perl/IO-String

  • dev-perl/XML-DOM

  • dev-perl/XML-Simple

  • perl-core/Digest-MD5

  • perl-core/Storable


However a mandatory dependency, List::Compare doesn't have a portage ebuild. The Shepherd page linked to a tool I'd never heard of before, g-cpan. g-cpan sits on top of CPAN, but builds ebuilds in your overlay, and installs the perl module in a Gentoo-esque way. If no overlay is present in your /etc/make.conf, the overlay will go into /var/tmp/g-cpan. My overlay is set to /usr/local/portage because I don't like the thought of ebuilds ending up in a temp directory. Running
$ g-cpan -i List::Compare
installed the needed perl module. Very nice. I couldn't find an ebuild for the optional JavaScript.pm module, so I used g-cpan for that as well.

Note for the JavaScript.pm install make sure that you setup up spidermonkey in the right way, otherwise the module wont install properly.

$ emerge spidermonkey
$ mkdir /usr/lib/MozillaFirefox/
$ ln -s /usr/include/ /usr/lib/MozillaFirefox/

While running the Shepherd install, I encountered a few errors.

  1. No mysql.txt Not sure how this file is created. I think it's a mythfrontend config file to specify how to connect to the backend. It's contents looks like:

    DBHostName=$HOSTNAME
    DBUserName=$USERNAME
    DBPassword=$PASSWORD
    DBName=mythconverg
    DBPort=0
    My suspicion is that since I'm using XBMC, this never got created. I created one in ~/.mythtv for the user that I run XMBC (and shepherd) with, and reran shepherd.

  2. Creation of the tv_grab_au symlink. If your user doesn't have sudo rights - which is a valid security situation, this will fail. Not hard to do yourself, but I wonder if Shepherd should assume sudo rights.

  3. Addition of Shepherd cron job to crontab. Failed due to lack of sudo rights. To do yourself (as root)
    $ crontab -e
    [Add crontab entry and save file]
    If you didn't get the crontab output from Shepherd, I put
    56 * * * * nice /usr/bin/mythfilldatabase 
    --graboptions '--daily'
    into my file (all as one line).


If you ran shepherd without installing the optional modules, you can rerun the install process using:
$ ~/.shepherd/shepherd --configure
Shepherd hasn't run yet, (the --history flag tells me so), I'll wait for an hour or so. Overall I'm pretty impressed with Shepherd so far. It's well documented, the installation process is easy, and provides good information to make decisions. Keep up the good work Shepherd dev(s).

No comments:

Post a Comment