Tenon Intersystems Please see text links at bottom of page for navigation Please see text links at bottom of page for navigation
Please see text links at bottom of page for navigation Please see text links at bottom of page for navigation Please see text links at bottom for navigation
Please see text links at bottom of page for navigation
Google
Search this site:





Building Perl Modules for Tenon’s iTools


Introduction

This document describes the process of creating and installing a Perl module
that is configured to work with the Tenon iTools version of Perl. This will
allow users to extend iTools with modules required for their work.

Tenon has its own parallel installations of major application utilities for
iTools (e.g. httpd, Perl, PHP). This means that sometimes there are duplicate
versions of the utilities, but it also means that when a new Mac OS X release
is available our customers do not have to worry that their iTools installation
will fail due to some kind of Apple tool upgrade. Additionally, Tenon can update
its version of the tools independent of a system tool, serving our customers
with more timely availability of new tool releases, updates to fix tool errors
or deficiencies and the ability to modify a tool configuration (add a new Perl
module) without impacting system operation or performance.


There are six steps to building any Perl module for use with Tenon iTools:
• Extract the Module
• Build the Makefile
• Make the Module
• Test the Module
• Logically Install the Module
• Capture the Result
After the build process a tar file will be available that can be used to install
the module on any system.

If you want to just install it on the local system, the command:
(cd /; tar xvfz <tar file name>)
will install the module.

You can also use:
make install
if you want to bypass the creation and capture of a logical root and just install
the module on the same system that it was built on.

As an example, a real world module not available with a standard iTools release,
Net::SSL, has been selected to build and install on Mac OS X 10.4. This module
is available from CPAN:
http://search.cpan.org/~chamas/Crypt-SSLeay-0.51
Clicking the download URL will cause your browser to download a tar.gz file
that is then used to build the file. In this case the file Crypt-SSLeay-0.51.tar.gz
is downloaded.

Extracting the Module

Use tar to extract the contents of the module:
mm1: root# tar xvfz Crypt-SSLeay-0.51.tar.gz
Crypt-SSLeay-0.51/
Crypt-SSLeay-0.51/t/
Crypt-SSLeay-0.51/t/net_ssl.t
Crypt-SSLeay-0.51/t/ssl_context.t
Crypt-SSLeay-0.51/lib/
Crypt-SSLeay-0.51/lib/Crypt/
Crypt-SSLeay-0.51/lib/Crypt/SSLeay/
Crypt-SSLeay-0.51/lib/Crypt/SSLeay/MainContext.pm
Crypt-SSLeay-0.51/lib/Crypt/SSLeay/Conn.pm
Crypt-SSLeay-0.51/lib/Crypt/SSLeay/X509.pm
Crypt-SSLeay-0.51/lib/Crypt/SSLeay/Err.pm
Crypt-SSLeay-0.51/lib/Crypt/SSLeay/CTX.pm
Crypt-SSLeay-0.51/lib/Net/
Crypt-SSLeay-0.51/lib/Net/SSL.pm
Crypt-SSLeay-0.51/certs/
Crypt-SSLeay-0.51/certs/ca-bundle.crt
Crypt-SSLeay-0.51/certs/notacakeynopass.pem
Crypt-SSLeay-0.51/certs/notacacert.pem
Crypt-SSLeay-0.51/MANIFEST
Crypt-SSLeay-0.51/typemap
Crypt-SSLeay-0.51/MANIFEST.SKIP
Crypt-SSLeay-0.51/SSLeay.pm
Crypt-SSLeay-0.51/CHANGES
Crypt-SSLeay-0.51/lwp-ssl-test
Crypt-SSLeay-0.51/net_ssl_test
Crypt-SSLeay-0.51/SSLeay.xs
Crypt-SSLeay-0.51/README
Crypt-SSLeay-0.51/Makefile.PL

Change to the newly extracted directory.

mm1: # cd *0.51
mm1: Crypt-SSLeay-0.51 root# ls
CHANGES MANIFEST.SKIP README SSLeay.xs lib net_ssl_test typemap
MANIFEST Makefile.PL SSLeay.pm certs lwp-ssl-test t

 

Build the Makefile

Use the Tenon perl to create a Makefile. Using the Tenon Perl -(/Library/Tenon/Perl/Executables/perl)
as opposed to the system Perl – (/usr/bin/perl) will incorporate the
Tenon Perl libraries and the Tenon version of Perl. Using the standard Perl
will incorporate the Apple Perl libraries and Perl.

mm1: Crypt-SSLeay-0.51 root# /Library/Tenon/Perl/Executables/Perl Makefile.PL
Found OpenSSL (version OpenSSL 0.9.7) installed at /usr
Which OpenSSL build path do you want to link against? [/usr]

================================================
BUILD INFORMATION
================================================

ssl dir: /usr
libraries: -lssl -lcrypto -lgcc -lRSAglue -lrsaref
include dir: /usr/include
ssl header: openssl/ssl.h
ssl candidate: /usr; /usr/include/openssl; OpenSSL 0.9.7

================================================

Checking if your kit is complete...
Looks good
Note (probably harmless): No library found for -lgcc
Note (probably harmless): No library found for -lRSAglue
Note (probably harmless): No library found for -lrsaref
Writing Makefile for Crypt::SSLeay

Make the Module

Running make builds the module in the local directory.
mm1: Crypt-SSLeay-0.51 root# make
cp lib/Crypt/SSLeay/X509.pm blib/lib/Crypt/SSLeay/X509.pm
cp lib/Net/SSL.pm blib/lib/Net/SSL.pm
cp SSLeay.pm blib/lib/Crypt/SSLeay.pm
cp lib/Crypt/SSLeay/Conn.pm blib/lib/Crypt/SSLeay/Conn.pm
cp lib/Crypt/SSLeay/CTX.pm blib/lib/Crypt/SSLeay/CTX.pm
cp lib/Crypt/SSLeay/MainContext.pm blib/lib/Crypt/SSLeay/MainContext.pm
cp lib/Crypt/SSLeay/Err.pm blib/lib/Crypt/SSLeay/Err.pm
/Library/Tenon/Perl/Executables/Perl /Library/Tenon/Perl/Library/ExtUtils/xsubpp
-typemap /Library/Tenon/Perl/Library/ExtUtils/typemap -typemap typemap SSLeay.xs >
SSLeay.xsc && mv SSLeay.xsc SSLeay.c
cc -c -I/usr/include -g -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict
-aliasing -pipe -I/usr/local/include -O3 -DVERSION=\"0.51\" -DXS_VERSION=\"0.51\"
"-I/Library/Tenon/Perl/Library/darwin-2level/CORE" SSLeay.c
SSLeay.xs: In function 'XS_Crypt__SSLeay__Conn_new':
SSLeay.xs:252: warning: passing argument 2 of 'SSL_set_info_callback' from
incompatible pointer type
Running Mkbootstrap for Crypt::SSLeay ()
chmod 644 SSLeay.bs
rm -f blib/arch/auto/Crypt/SSLeay/SSLeay.bundle
LD_RUN_PATH="/usr/lib" cc -bundle -undefined dynamic_lookup -L/usr/local/lib SSLeay.o -o blib/arch/auto/Crypt/SSLeay/SSLeay.bundle -L/usr/lib -lssl -lcrypto
chmod 755 blib/arch/auto/Crypt/SSLeay/SSLeay.bundle
cp SSLeay.bs blib/arch/auto/Crypt/SSLeay/SSLeay.bs
chmod 644 blib/arch/auto/Crypt/SSLeay/SSLeay.bs
Manifying blib/man3/Crypt::SSLeay.3

Test the Module

Run ‘make test’ to run any standalone tests for the module.
mm1:~/webmail/perl/modules/Crypt-SSLeay-0.51 root# make test
PERL_DL_NONLAZY=1 /Library/Tenon/Perl/Executables/Perl "
-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/net_ssl........ok
t/ssl_context....ok
All tests successful.
Files=2, Tests=2, 0 wallclock secs ( 0.09 cusr + 0.04 csys = 0.13 CPU)

Logically Install the Module

Create a directory, we use lroot, that you can ask the installer to install into creating a file
hierarchy that matches the locations from the ‘/’ (slash) directory that the files would be
installed into if we were installing them on this system.

mm1: Crypt-SSLeay-0.51 root# mkdir lroot
mm1: Crypt-SSLeay-0.51 root# cd lroot
mm1:Crypt-SSLeay-0.51/lroot root# pwd
/Users/anderson/webmail/perl/modules/Crypt-SSLeay-0.51/lroot
mm1:~/webmail/perl/modules/Crypt-SSLeay-0.51/lroot root# cd ..

Use the DESTDIR=<absolute path> parameter to ‘make install’ to install into our logical
root hierarchy instead of installing into the current systems Perl file hierarchy. It might be
obvious, but you must use an absolute pathname here as some scripts get confused when
you pass relative DESDIR directories.

mm1: Crypt-SSLeay-0.51 root# make install DESTDIR=/Users/anderson/webmail/perl/modules/Crypt-SSLeay-0.51/lroot
Installing /Users/anderson/webmail/perl/modules/Crypt-SSLeay-0.51/lroot/Library/Tenon/
Perl/Site/darwin-2level/auto/Crypt/SSLeay/SSLeay.bs
Installing /Users/anderson/webmail/perl/modules/Crypt-SSLeay-0.51/lroot/Library/Tenon/
Perl/Site/darwin-2level/auto/Crypt/SSLeay/SSLeay.bundle
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /Users/anderson/webmail/perl/modules/Crypt-SSLeay-0.51/lroot/Library/Tenon/
Perl/Site/darwin-2level/Crypt/SSLeay.pm
Installing /Users/anderson/webmail/perl/modules/Crypt-SSLeay-0.51/lroot/Library/Tenon/
Perl/Site/darwin-2level/Crypt/SSLeay/Conn.pm
Installing /Users/anderson/webmail/perl/modules/Crypt-SSLeay-0.51/lroot/Library/Tenon/
Perl/Site/darwin-2level/Crypt/SSLeay/CTX.pm
Installing /Users/anderson/webmail/perl/modules/Crypt-SSLeay-0.51/lroot/Library/Tenon/
Perl/Site/darwin-2level/Crypt/SSLeay/Err.pm
Installing /Users/anderson/webmail/perl/modules/Crypt-SSLeay-0.51/lroot/Library/Tenon/
Perl/Site/darwin-2level/Crypt/SSLeay/MainContext.pm
Installing /Users/anderson/webmail/perl/modules/Crypt-SSLeay-0.51/lroot/Library/Tenon/
Perl/Site/darwin-2level/Crypt/SSLeay/X509.pm
Installing /Users/anderson/webmail/perl/modules/Crypt-SSLeay-0.51/lroot/Library/Tenon/
Perl/Site/darwin-2level/Net/SSL.pm
Installing /Users/anderson/webmail/perl/modules/Crypt-SSLeay-0.51/lroot/Library/Tenon/
Perl/Site/ManPages/man3/Crypt::SSLeay.3
Writing /Users/anderson/webmail/perl/modules/Crypt-SSLeay-0.51/lroot/Library/Tenon/
Perl/Site/darwin-2level/auto/Crypt/SSLeay/.packlist
Appending installation info to /Users/anderson/webmail/perl/modules/Crypt-SSLeay-0.51/
lroot/Library/Tenon/Perl/Library/darwin-2level/perllocal.pod

Capture the Result

mm1: Crypt-SSLeay-0.51 root# cd lroot
mm1: Crypt-SSLeay-0.51/lroot root# tar cvfz ../Net.SSL.tenon.tgz .
./
./Library/
./Library/Tenon/
./Library/Tenon/Perl/
./Library/Tenon/Perl/Library/
./Library/Tenon/Perl/Library/darwin-2level/
./Library/Tenon/Perl/Library/darwin-2level/perllocal.pod
./Library/Tenon/Perl/Site/
./Library/Tenon/Perl/Site/darwin-2level/
./Library/Tenon/Perl/Site/darwin-2level/auto/
./Library/Tenon/Perl/Site/darwin-2level/auto/Crypt/
./Library/Tenon/Perl/Site/darwin-2level/auto/Crypt/SSLeay/
./Library/Tenon/Perl/Site/darwin-2level/auto/Crypt/SSLeay/.packlist
./Library/Tenon/Perl/Site/darwin-2level/auto/Crypt/SSLeay/SSLeay.bs
./Library/Tenon/Perl/Site/darwin-2level/auto/Crypt/SSLeay/SSLeay.bundle
./Library/Tenon/Perl/Site/darwin-2level/Crypt/
./Library/Tenon/Perl/Site/darwin-2level/Crypt/SSLeay/
./Library/Tenon/Perl/Site/darwin-2level/Crypt/SSLeay/Conn.pm
./Library/Tenon/Perl/Site/darwin-2level/Crypt/SSLeay/CTX.pm
./Library/Tenon/Perl/Site/darwin-2level/Crypt/SSLeay/Err.pm
./Library/Tenon/Perl/Site/darwin-2level/Crypt/SSLeay/MainContext.pm
./Library/Tenon/Perl/Site/darwin-2level/Crypt/SSLeay/X509.pm
./Library/Tenon/Perl/Site/darwin-2level/Crypt/SSLeay.pm
./Library/Tenon/Perl/Site/darwin-2level/Net/
./Library/Tenon/Perl/Site/darwin-2level/Net/SSL.pm
./Library/Tenon/Perl/Site/ManPages/
./Library/Tenon/Perl/Site/ManPages/man3/
./Library/Tenon/Perl/Site/ManPages/man3/Crypt::SSLeay.3


| Tenon Home | Products | Order | Contact Us | About Tenon | Register | Tech Support | Resources | Press Room | Mailing Lists |

Powered By iTools

Copyright©2006 Tenon Intersystems, 232 Anacapa Street, Suite 2A, Santa Barbara, CA 93101. All rights reserved.
Questions about our website - Contact: webmaster@tenon.com.


Tenon Home Tenon Home Tenon Home Tenon HomeProduct Info TenonOrderingContactAboutRegisterSupportResourcesPressMailing Lists