DBIx-Perform

 view release on metacpan or  search on metacpan

INSTALL  view on Meta::CPAN

Compress-Raw-Zlib-2.006
IO-Compress-Base-2.006
IO-Compress-Zlib-2.006
Compress-Zlib-2.006
Archive-Zip-1.20
Getopt-ArgvFile-1.11
ExtUtils-CBuilder-0.19
ExtUtils-ParseXS-2.18
Module-Build-0.2808
Module-ScanDeps-0.76
PAR-Dist-0.25
PAR-0.976
PAR-Packer-0.976

A basic stand alone executable is not too difficult.
Inside the DBIx-Perform-0.694 directory, do:

$ pp -z 9 -M Curses/Widgets/Label.pm -M Perform/Widgets/TextField.pm bin/perform

This creates a file "a.out".  Replace bin/perform with bin/pformbld for the
other program.

A lighter version that needs perl and 3 of the above modules, AutoLoader,
PAR-Dist, and PAR, can be built by adding "-P" to the options for pp. 
This creates a file "a.pl".

However, the target system must have ncurses and the Informix shared libraries
installed.

A complete version that includes the shared libraries is difficult but possible.
It is also not really a good idea, as start up time could be more than 1 min.
First, there are two shared libraries, Informix.sl and Curses.sl, to build.
Informix.sl depends on 6 Informix library files (see pp command at bottom for
the list), and Curses.sl depends on the 4 libraries ncurses, form, menu, and
panel.  Easiest (to avoid having to edit the paths hard coded into the shared
libraries with a hex editor) is to copy all ten libraries to the root directory.
Then use a feature of the HP-UX linker, ld:  the "+origin" flag.
+origin was added in a patch, so ld must be new enough to support this.
Check the man page for ld to see if "+origin" is present.

Build the Perl modules Curses-1.15 and DBD-Informix-2007.0226, but don't
install yet.  Inside blib/arch/auto/ will be Curses/Curses.sl and
Informix/informix.sl respectively.  These shared libraries must be linked
differently, with the following commands:

$ ld -b -L/ Curses.o  -o blib/arch/auto/Curses/Curses.sl +origin -lpanel +origin -lmenu +origin -lform +origin -lncurses +b \$ORIGIN

$ ld -b Informix.o dbdimp.o dbdattr.o sqltoken.o sqltype.o ixblob.o odbctype.o kludge.o link.o esqlcver.o esqlc_v6.o -L/ +origin -lifsql +origin -lifasf +origin -lifgen +origin -lifos +origin -lifgls -lc -lm -lcrypt /usr/informix/lib/esql/checkapi.o ...

The libraries can be checked with chatr (or ldd).  All the links should be
$ORIGIN//libncurses.sl and similar.  The default way would produce something
like /usr/local/lib/libncurses.sl.  Now install these 2 modules.

Next, there is a bug in PAR that prevents added libraries from being run.
They are unpacked into a /tmp/par-username/cache-xxx directory without
execute permission.  So, must change PAR-0.976/lib/PAR.pm.  After line
884 (which says "$par_temp = $1;"), add the following, then rebuild and
reinstall PAR:

        foreach my $i (<$par_temp/lib*.sl>) {
            chmod 0755, $i;
        }


Then issue the following command to build the PAR standalone executable:

$ pp -z 9 -l /libncurses.sl -l /libpanel.sl -l /libmenu.sl -l /libform.sl -l /libifglx.sl -l /libifgls.sl -l /libifgen.sl -l /libifasf.sl -l /libifos.sl -l /libifsql.sl -M Curses/Widgets/Label.pm -M Perform/Widgets/TextField.pm bin/perform



=========================================================================
"make test" has not been updated, and will likely print many errors.

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

USAGE
"make install" installs scripts "pformbld" and "perform".

To run a Perform script "example.per":

1st have appropriate environment variables set for the database.
The crucial one is DB_NAME.


Here is an example of the environment variables needed for Informix 7.2:
$ export DB_HOST=$(hostname)
$ export DBPATH=/usr/informix
$ export DB_NAME=mydatabase
$ export DB_CLASS=Informix
$ export DB_USER=informix
$ export DB_PASSWORD=mydbpasswd
$ export DBD_INFORMIX_USERNAME=informix
$ export DBD_INFORMIX_PASSWORD=$DB_PASSWORD
$ export DBD_INFORMIX_PASSWORD2=$DB_PASSWORD
$ export DBD_INFORMIX_USERNAME2=informix

Might also need to set the terminal:
$ export TERM=vt100
$ export TERMINFO=/usr/lib/terminfo

And these are optional:
$ export BGCOLOR=blue
$ export FIELDBGCOLOR=blue
$ export DBDATE="Y4MD-"


The 2nd step need only be done once.  Create "example.yml" with:

$ pformbld example.per


3rd, run the script with:

$ perform example


Lastly, if the script calls external C functions, will need to build
a C executable.  For details, read the comments at the head of 
Perform/src/perl_perform_tools.c.  Once a source file "cfuncs.ec" with
the external functions is compiled to an executable "cfuncs", the
Perform script can be run with those functions with an extra parameter:



( run in 1.195 second using v1.01-cache-2.11-cpan-f56aa216473 )