For When You Can't Have The Real Thing
[ start | index | login ]
start > Perl OAuth Libraries In CentOS-5.x

Perl OAuth Libraries In CentOS-5.x

Created by dave. Last edited by dave, 13 years and 229 days ago. Viewed 6,045 times. #4
[diff] [history] [edit] [rdf]

or, This Is Why We Can't Have Nice Things

(8 September 2010)

So I have this Twitter thing going, and for the last little while it's been fine using some raw API-using code I found on the net. Now Twitter's gone all OAuth on us and disabled the old API. So my thing doesn't work any more.

So there is a perl library Net::Oauth which can handle this. But of course since it is shiny spanking new, it isn't available for the CentOS-4 system I'm running the thing on.

It isn't available for CentOS-5 either, but CentOS-5 is less mouldy-old than CentOS-4 is I figured I'd use CentOS-5 as a base for doing something not-three-years-out-of-date.

So this is the trail of action that this hilarity all causes.

  • Decide to use a VM.
  • Start up my "reference" C5 VM and do a 'yum update' on it.
  • Clone the VM.
  • Do all the unmentionables that are required to differentiate this clone from other pre-existing and/or future clones of the reference VM.
  • Transplant the twitter thing into the clone. Confirm it still won't work.
  • Find an example perl script that has dealt with the OAuth issue. It requires some dependencies.
  • Comment out Net::Oauth and install things until the perl script passes the -cw test.
  • I guess we'd better get Net::Oauth from cpan, then. It does mean that unless we are very careful we'll either hopelessly hose the RPM packaging that's installed the perl environment up until now, or some RPM update in the future will come along and hopelessly hose the environment at that point. I hate cpan.
  • Fire up cpan. Walk through manual configuration step.
  • Stop configuration step after it fails to find ncftp, thinking "hey, I have a ncftp src.RPM somewhere."
  • Find rpm and load into VM.
  • Figure out how to create a non-root rpmbuild environment.
  • Install .src.rpm.
  • $ rpmbuild -bb fails because rpmbuild isn't installed.
  • Curse because yum install rpmbuild can't figure out what I want.
  • Fifteen seconds with grep teaches me that rpmbuild is available through the obviously named rpm-build package. RedHat and their fucking dashes-in-names inconsistencies strike again.
  • $ rpmbuild -bb fails because there is no C compiler.
  • $ yum install "Development Tools" (and yes I enjoy the space in the group's name, thank you)
  • $ rpmbuild -bb succeeds.
  • $ rpm -ivh ncftp-3*rpm fails. Curse because I'm not root.
  • $ sudo rpm -ivh ncftp-3*rpm succeeds.
  • Rerun cpan initialization. Carefully select some Canadian mirrors for no good reason.
  • Observe that the whole exercise with ncftp was probably academic considering cpan uses LWP by default if it is available.
  • cpan: get Net::Oauth
I'll continue but problems seem likely to happen.
Warning: Cannot get Net::Oauth, don't know what it is.
  • looks like maybe one of the mirrors I carefully selected is out of date.
  • blow away cpan configuration and accept an automatically generated one.
  • cpan: get Net::Oauth
Warning: Cannot get Net::Oauth, don't know what it is.
  • Curse again.
  • cpan: get Net::OAuth succeeds.
  • $ perl Makefile.PL LIB=/home/dave/lib/
This module requires Module::Build to install itself.
  • $ sudo yum --enablerepo=rpmforge install perl-Module-Build
Let me digress for a moment to mention that there are reasons why I'm trying to use RPM as much as possible to build the perl environment using RPM instead of with CPAN. Firstly I'm hoping that any CPAN libraries can go in a directory in my home directory rather than polluting the system directories. Secondly, my experience with CPAN over the years has shown me that for any non-trivial module you try to install you will inevitably get down to either a totally unresolvable dependency loop, or CPAN deciding what it really needs to do is download the entire perl distribution source and build it from scratch right now. Neither of these "solutions" are particularly any good, so it is all just best avoided.
  • $ perl Makefile.PL LIB=/home/dave/lib/
Checking prerequisites…
    !  Class::Accessor is not installed
    !  Class::Data::Inheritable is not installed
    !  Digest::SHA1 (2.11) is installed, but we need version >= 2.12
    !  Encode (2.12) is installed, but we need version >= 2.35
    !  Test::More (0.62) is installed, but we need version >= 0.66
    !  Test::Warn is not installed
  • Fuck, why are we doing this again?
  • $ sudo yum --enablerepo=rpmforge install perl-Test-Warn
  • $ sudo yum --enablerepo=rpmforge install perl-Class-Accessor perl-CLASS (note capitalization difference between perl-Class-something and perl-CLASS)
  • $ perl Makefile.PL LIB=/home/dave/lib/
Checking prerequisites…
    !  Class::Data::Inheritable is not installed
    !  Digest::SHA1 (2.11) is installed, but we need version >= 2.12
    !  Encode (2.12) is installed, but we need version >= 2.35
    !  Test::More (0.62) is installed, but we need version >= 0.66
...and that's enough fail for one night.

Except now I'm (probably foolishly) wondering if >>cpan2rpm would solve my problems. But I've already shut down the VM at this point so I'm going to bed.

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful: | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt