Wednesday, March 28, 2012

You know your trouble when you cable guy is smarter than your rocket scientist.

You know your trouble when you cable guy is smarter than your rocket scientist.

http://www.circleid.com/posts/20120322_nasa_teething_troubles_teach_a_dnssec_lesson/

Thursday, March 08, 2012

When building RPM for Perl module XML::SAX, make install for XML::SAX fails with Can't locate XML/SAX/ParserFactory.pm error message


Given this %install section in the spec file:

        ...
        %prep
        %global
        %setup
        %build
        /usr/bin/perl/bin/perl Makefile.PL INSTALLDIRS=vendor
        make
        make test
        %install
        rm -rf $RPM_BUILD_ROOT
        make install DESTDIR=$RPM_BUILD_ROOT > %{_topdir}/%{name}.install.out
        ...

if you get this error:

        Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.7597
        + umask 022
        + cd /users/red/tasks/perl-5.14-for-cel5.03/platform/vendor_perl/perl-XML-SAX/BUILD
        + cd perl-XML-SAX-0.99
        + rm -rf /users/red/tasks/perl-5.14-for-cel5.03/platform/vendor_perl/perl-XML-SAX/BUILDROOT/perl-XML-SAX-0.99-1.i386
        + make install DESTDIR=/users/red/tasks/perl-5.14-for-cel5.03/platform/vendor_perl/perl-XML-SAX/BUILDROOT/perl-XML-SAX-0.99-1.i386
        Can't locate XML/SAX/ParserFactory.pm in @INC (@INC contains: /usr/bin/perl-5.14.1/lib/eman_perl/i686-linux-thread-multi /usr/bin/perl-5.14.1/lib/eman_perl /usr/bin/perl-5.14.1/lib/vendor_perl/5.14.1/i686-linux-thread-multi /usr/bin/perl-5.14.1/lib/vendor_perl/5.14.1 /usr/bin/perl-5.14.1/lib/5.14.1/i686-linux-thread-multi /usr/bin/perl-5.14.1/lib/5.14.1 /usr/bin/perl-5.14.1/lib/site_perl .) at /usr/bin/perl-5.14.1/lib/vendor_perl/5.14.1/XML/SAX.pm line 18.
        BEGIN failed--compilation aborted at /usr/bin/perl-5.14.1/lib/vendor_perl/5.14.1/XML/SAX.pm line 18.
        Compilation failed in require.
        BEGIN failed--compilation aborted.
        make[1]: *** [install_sax_pureperl] Error 2
        error: Bad exit status from /var/tmp/rpm-tmp.7597 (%install)


        RPM build errors:
            Macro % has illegal name (%define)
            Bad exit status from /var/tmp/rpm-tmp.7597 (%install)
        make: *** [perl-XML-SAX-0.99-1.i386.rpm] Error 1

You need to add the line ...

        export PERL5LIB=${RPM_BUILD_ROOT}/usr/bin/perl-5.14.1/lib/vendor_perl/5.14.1

... so your spec looks like this ...

        %prep
        %global
        %setup
        %build
        /usr/bin/perl/bin/perl Makefile.PL INSTALLDIRS=vendor
        make
        make test
        %install
        rm -rf $RPM_BUILD_ROOT
        export PERL5LIB=${RPM_BUILD_ROOT}/usr/bin/perl-5.14.1/lib/vendor_perl/5.14.1
        make install DESTDIR=$RPM_BUILD_ROOT > %{_topdir}/%{name}.install.out

Sunday, March 04, 2012

How To Make Ubuntu Apache2 Listen on another port


red@ubuntu:/etc/apache2$ sudo cp ports.conf ports.conf_old
red@ubuntu:/etc/apache2$ vim ports.conf
red@ubuntu:/etc/apache2$ sudo vim ports.conf
red@ubuntu:/etc/apache2$ diff ports.conf ports.conf_old
8c8
< NameVirtualHost *:*
---
> NameVirtualHost *:80
10d9
< Listen 81

Friday, March 02, 2012

dealing with spaces in shell script for loops


SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for policy in `/usr/SD/bin/nrcmd -r -N doofus -P 1234 policy listnames`
do
        echo "$policy"
done
IFS=$SAVEIFS

Thursday, March 01, 2012

Perl cpan module GD make fails with t/GD.t ........ Not a CODE reference ... DynaLoader.pm line 213.

If you are getting these errors when trying to install the CPAN Perl module GD (http://search.cpan.org/~lds/GD-2.46/) ...


make test
PERL_DL_NONLAZY=1 ... "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
Not a CODE reference at ... DynaLoader.pm line 213.
END failed--call queue aborted at blib/lib/GD.pm line 213.
Compilation failed in require at t/GD.t line 14.
BEGIN failed--compilation aborted at t/GD.t line 14.
t/GD.t ........
Dubious, test returned 2 (wstat 512, 0x200)
Failed 12/12 subtests
Not a CODE reference at ... DynaLoader.pm line 213.
END failed--call queue aborted at ... perl-GD-2.46/blib/lib/GD.pm line 213.
Compilation failed in require at ... perl-GD-2.46/blib/lib/GD/Polyline.pm line 45.
BEGIN failed--compilation aborted at ... perl-GD-2.46/blib/lib/GD/Polyline.pm line 45.
Compilation failed in require at t/Polyline.t line 10.
BEGIN failed--compilation aborted at t/Polyline.t line 10.
t/Polyline.t ..
Dubious, test returned 2 (wstat 512, 0x200)
Failed 1/1 subtests

Test Summary Report
-------------------
t/GD.t      (Wstat: 512 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 2
  Parse errors: Bad plan.  You planned 12 tests but ran 1.
t/Polyline.t (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: Bad plan.  You planned 1 tests but ran 0.
Files=2, Tests=1,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.04 cusr  0.01 csys =  0.07 CPU)
Result: FAIL
Failed 2/2 test programs. 1/1 subtests failed.
make[1]: *** [test_dynamic] Error 2

... you need run make like so ...

make CCFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"