From owner-freebsd-ports Mon Oct 15 4:20:24 2001 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 110A037B410 for ; Mon, 15 Oct 2001 04:20:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9FBK1S21671; Mon, 15 Oct 2001 04:20:01 -0700 (PDT) (envelope-from gnats) Received: from 3wgraphics.com (ppp067.comintern.ru [213.148.2.67]) by hub.freebsd.org (Postfix) with ESMTP id 899A137B406 for ; Mon, 15 Oct 2001 04:11:58 -0700 (PDT) Received: from root by 3wgraphics.com with local (Exim 3.33 #1) id 15t5c6-000ASH-00 for FreeBSD-gnats-submit@freebsd.org; Mon, 15 Oct 2001 15:08:54 +0400 Message-Id: Date: Mon, 15 Oct 2001 15:08:54 +0400 From: skv@protey.ru Reply-To: skv@protey.ru To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: ports/31283: New port: p5-DBD-InterBase-0.28.4 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 31283 >Category: ports >Synopsis: New port: p5-DBD-InterBase-0.28.4 >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Oct 15 04:20:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Sergey Skvortsov >Release: FreeBSD 4.4-STABLE i386 >Organization: >Environment: >Description: New port: p5-DBD-InterBase-0.28.4 >How-To-Repeat: >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # p5-DBD-InterBase # p5-DBD-InterBase/Makefile # p5-DBD-InterBase/distinfo # p5-DBD-InterBase/pkg-comment # p5-DBD-InterBase/pkg-descr # p5-DBD-InterBase/pkg-plist # p5-DBD-InterBase/files # p5-DBD-InterBase/files/patch-Makefile.PL # echo c - p5-DBD-InterBase mkdir -p p5-DBD-InterBase > /dev/null 2>&1 echo x - p5-DBD-InterBase/Makefile sed 's/^X//' >p5-DBD-InterBase/Makefile << 'END-of-p5-DBD-InterBase/Makefile' X# New ports collection makefile for: DBD::InterBase X# Date created: 15 Oct 2001 X# Whom: Sergey Skvortsov X# X# $FreeBSD$ X# X XPORTNAME= DBD-InterBase XPORTVERSION= 0.28.4 XCATEGORIES= databases perl5 XMASTER_SITES= ${MASTER_SITE_PERL_CPAN} XMASTER_SITE_SUBDIR= DBD XPKGNAMEPREFIX= p5- X XMAINTAINER= skv@protey.ru X XBUILD_DEPENDS= ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/DBI.pm:${PORTSDIR}/databases/p5-DBI XLIB_DEPENDS= gds:${PORTSDIR}/databases/firebird XRUN_DEPENDS= ${BUILD_DEPENDS} X XPERL_CONFIGURE= yes X Xpost-patch: X @${PERL} -pi -e 's,%%IB_BASE%%,${PREFIX}/firebird,g' \ X ${WRKSRC}/Makefile.PL X XMAN3= Bundle::DBD::InterBase.3 DBD::InterBase.3 DBD::InterBase::FAQ.3 X XMANPREFIX= ${PREFIX}/lib/perl5/${PERL_VERSION} X X.include END-of-p5-DBD-InterBase/Makefile echo x - p5-DBD-InterBase/distinfo sed 's/^X//' >p5-DBD-InterBase/distinfo << 'END-of-p5-DBD-InterBase/distinfo' XMD5 (DBD-InterBase-0.28.4.tar.gz) = 4fdfd1179e00c4d72de99a251ae49c32 END-of-p5-DBD-InterBase/distinfo echo x - p5-DBD-InterBase/pkg-comment sed 's/^X//' >p5-DBD-InterBase/pkg-comment << 'END-of-p5-DBD-InterBase/pkg-comment' XDBI driver for InterBase RDBMS server END-of-p5-DBD-InterBase/pkg-comment echo x - p5-DBD-InterBase/pkg-descr sed 's/^X//' >p5-DBD-InterBase/pkg-descr << 'END-of-p5-DBD-InterBase/pkg-descr' XDBD::InterBase is a Perl module which works with the DBI module to provide Xaccess to InterBase databases. X XWWW: http://search.cpan.org/search?dist=DBD-InterBase END-of-p5-DBD-InterBase/pkg-descr echo x - p5-DBD-InterBase/pkg-plist sed 's/^X//' >p5-DBD-InterBase/pkg-plist << 'END-of-p5-DBD-InterBase/pkg-plist' Xlib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/auto/DBD/InterBase/.packlist Xlib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/Bundle/DBD/InterBase.pm Xlib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/DBD/InterBase.pm Xlib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/DBD/InterBase/FAQ.pm Xlib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/auto/DBD/InterBase/InterBase.bs Xlib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/auto/DBD/InterBase/InterBase.so X@dirrm lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/auto/DBD/InterBase X@unexec rmdir %D/lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/auto/DBD 2>/dev/null || true END-of-p5-DBD-InterBase/pkg-plist echo c - p5-DBD-InterBase/files mkdir -p p5-DBD-InterBase/files > /dev/null 2>&1 echo x - p5-DBD-InterBase/files/patch-Makefile.PL sed 's/^X//' >p5-DBD-InterBase/files/patch-Makefile.PL << 'END-of-p5-DBD-InterBase/files/patch-Makefile.PL' X--- Makefile.PL.orig Fri Jul 13 12:48:14 2001 X+++ Makefile.PL Mon Oct 15 14:37:54 2001 X@@ -30,51 +30,11 @@ X my $ib_dir_prefix; X X # init stuff X-my $IB_Bin_path = ''; X-my $isql_name; X-my @ib_bin_dirs; X-my @ib_inc_dirs; X-my $ib_lib_dir = ''; X- X-################################################################################ X-# OS specific configuration X-################################################################################ X-if ($Config::Config{osname} eq 'MSWin32') X-{ X- $isql_name = 'isql.exe'; X- X- # try to find InterBase installation via the registry X- my $ib_bin_dir = ''; X- my $ib_inc_dir = ''; X- eval X- { X- require Win32::TieRegistry; X- Win32::TieRegistry->import('$Registry'); X- $Registry->Delimiter("/"); X- X- my $sw = $Registry->{"LMachine/Software/"}; X- X- # We have to check more than one keys, because different X- # releases of InterBase have used different key hierarchies. X- my $key = $sw->{"InterBase Corp/InterBase/CurrentVersion/"} || X- $sw->{"Borland/InterBase/CurrentVersion/"}; X- X- if (defined($key)) X- { X- $ib_bin_dir = $key->{"/ServerDirectory"}; X- $ib_inc_dir = $key->{"/RootDirectory"} . "SDK\\include"; X- $ib_lib_dir = $key->{"/RootDirectory"} . "SDK\\"; X- } X- }; X- @ib_bin_dirs = ($ib_bin_dir); X- @ib_inc_dirs = ($ib_inc_dir); X-} X-else X-{ X- $isql_name = 'isql'; X- @ib_bin_dirs = (qw(/usr/interbase/bin /opt/interbase/bin /usr/bin /usr/local/bin)); X- @ib_inc_dirs = (qw(/usr/interbase/include /opt/interbase/include /usr/include)); X-} X+my $IB_BASE='%%IB_BASE%%'; X+my $IB_Bin_path = $IB_BASE.'/bin'; X+my $isql_name = 'isql'; X+my $ib_lib_dir = $IB_BASE.'/lib'; X+my $ib_inc = $IB_BASE.'/include'; X X ################################################################################ X # sub test_files - checks if at least one of the files in the list exists X@@ -92,171 +52,12 @@ X } X X ################################################################################ X-# sub dir_choice - promts for a directory X-# Paramters: X-# 0: prompt string X-# 1: reference to direcotry list X-# 2: reference to file list X-# Return value: directory name X-################################################################################ X-sub dir_choice X-{ X- my($prompt, $dirs, $files) = @_; X- my %dirs = ('a' => 'other'); X- my $i; X- my $ret; X- X- test_files($_, $files) && ($dirs{++$i} = $_) for @$dirs; X- while() X- { X- print "\n$prompt\n\n"; X- print "$_) $dirs{$_}\n" for sort keys %dirs; X- X- my $choice = prompt("Your choice:"); X- next unless $dirs{$choice}; X- X- $ret = ($choice eq 'a') ? prompt("Directory:", $ret) : $dirs{$choice}; X- return $ret if test_files($ret, $files); X- print "\nDirectory is bad\n"; X- } X-} X- X-################################################################################ X-# sub make_test_conf - configure for test (save to ./t/test.conf) X-# Parameters: X-# Return value: X-################################################################################ X-sub make_test_conf X-{ X- my $test_conf = './t/test.conf'; X- my ($dsn, $user, $pass, $path); X- X- # read cached config if available X- if (-r $test_conf) X- { X- print "Reading cached test configuration...\n"; X- open F, $test_conf or die "Can't open $test_conf: $!"; X- local @ARGV = ($test_conf); X- ($dsn, $user, $pass) = map {chomp;$_} <>; X- ($path) = $dsn =~ /(?!db|database)=([^;]+);/; X- close F; X- } X- X- # ask for database path X- for (1..3) X- { X- $path = prompt("\nFull path to your test database:", $path); X- last if $path; X- } X- X- die "Must specify a test database" unless $path; X- X- #PFW - isql on windows doesn't seem to work without the localhost in the db path X- my $hostpath = $path; X- if ($path =~ /^localhost:(.+)/) { X- $hostpath = $1; X- } X- # if DB doesn't exist ask for creation X- unless (-f $hostpath) X- { X- print <<"EOM"; X-Can't find $path X-Trying to create the test database.. X-Please enter a username with CREATE DATABASE permission. X-EOM X- X- $user = prompt("Username:", $user); X- $pass = prompt("Password:", $pass); X- create_test_db($path, $user, $pass); X- } X- else X- { X- $user = prompt("Username:", $user); X- $pass = prompt("Password:", $pass); X- } X- X- # save test config to file X- open F, ">$test_conf" or die "Can't write $test_conf: $!"; X- print F "dbi:InterBase:db=$path;ib_dialect=3\n$user\n$pass\n"; X- close F; X-} X- X-################################################################################ X-# sub create_test_db - Creates the test database X-# Parameters: X-# 0: path to testdatabase to be created X-# 1: username used to connect to the DB X-# 2: password X-# Return value: X-################################################################################ X-sub create_test_db X-{ X- my ($path, $user, $pass) = @_; X- X- # create the SQL file with CREATE statement X- open(T, ">./t/create.sql") or die "Can't write to t/create.sql"; X- while() X- { X- s/__TESTDB__/$path/; X- s/__USER__/$user/; X- s/__PASS__/$pass/; X- print T; X- } X- close T; X- X- # try to find isql X- my $isql; X- if (-x "$IB_Bin_path/$isql_name") X- { $isql = "$IB_Bin_path/$isql_name"; } X- else X- { X- for (split /:/, $ENV{PATH}) X- { X- s#/+$##g; X- if (-x "$_/$isql_name") X- { $isql = "$_/$isql_name"; last; } X- } X- } X- X- EXEC: X- { X- for (1..3) X- { X- $isql = prompt("Enter full path to isql: ", $isql); X- last EXEC if (-x $isql); X- } X- die "Unable to execute isql. Aborting.."; X- } X- X- #PFW - isql on windows doesn't seem to work without the localhost in the db path X- my $hostpath = $path; X- if ($path =~ /^localhost:(.+)/) { X- $hostpath = $1; X- } X- # if test db directory doesn't exist -> try to create X- my $dir = dirname $hostpath; X- unless (-d $dir) X- { X- print "Can't find $dir. Trying to mkdir..\n"; X- system('mkdir', '-p', $dir) == 0 X- or die "Can't mkdir -p $dir"; X- } X- X- # try to execute isql and create the test database X- system($isql, '-i', './t/create.sql') == 0 X- or die "Fail calling $isql -i t/create/sql: $?"; X-} X- X-################################################################################ X # MAIN X ################################################################################ X X # See lib/ExtUtils/MakeMaker.pm for details of how to influence X # the contents of the Makefile that is written. X X-# prompt for InterBase bin directory X-$IB_Bin_path = dir_choice("InterBase bin directory", [@ib_bin_dirs], [qw(gfix gfix.exe)]); X- X unless(-x $IB_Bin_path) X { X carp "I cannot find your InterBase installation.\nDBD::InterBase cannot build or run without InterBase.\n"; X@@ -270,10 +71,6 @@ X $IBVERSION =~ s/^gfix version //o; X my $is_final = $IBVERSION =~ /\.6\d+$/ ? 1 : 0; X X-# prompt for IB include dir X-my $ib_inc = dir_choice("Interbase include directory", [@ib_inc_dirs], [qw(gds.h ibase.h)]); X- X- X # we use a hash for the MakeMaker parameters X my %MakeParams = ( X 'NAME' => 'DBD::InterBase', X@@ -283,183 +80,13 @@ X 'CCFLAGS' => '', X 'INC' => "-I\"$ib_inc\" -I\"$dbi_arch_dir\"", X 'OBJECT' => "InterBase.o dbdimp.o", X- 'LIBS' => [''], X+ 'LIBS' => "-L$ib_lib_dir -lgds", X 'OPTIMIZE' => $Config::Config{'optimize'}, X 'XSPROTOARG' => '-noprototypes', X 'dist' => {COMPRESS=>'gzip -9f', SUFFIX=>'gz'}, X 'realclean' => '*.xsi test.conf', X ); X X-# the OS specific build environment setup X-my $os = $Config::Config{'osname'}; X-if ($os eq 'MSWin32') X-{ X- # set up PPM package parameters X- $MakeParams{'AUTHOR'} = 'Edwin Pratomo (edpratomo@users.sourceforge.net'; X- $MakeParams{'ABSTRACT'} = 'DBD::InterBase is a DBI driver for InterBase, written using InterBase C API.'; X- X- my $vc_dir = ''; X- if ($Config::Config{'cc'} eq "cl") X- { X- # try to find Microsoft Visual C++ compiler X- eval X- { X- require Win32::TieRegistry; X- Win32::TieRegistry->import('$Registry'); X- $Registry->Delimiter("/"); X- X- my $sw = $Registry->{"LMachine/Software/"}; X- X- X- X- # We have to check more than one keys, because different X- # releases of Visual C++ have used different key hierarchies. X- my $key X- = $sw->{"Microsoft/VisualStudio/6.0/Setup/Microsoft Visual C++"} || X- $sw->{"Microsoft/VisualStudio/7.0/Setup/VC"}; X- X- if (defined($key)) X- { X- $vc_dir = $key->{"/ProductDir"}; X- } X- }; X- my @vc_dirs = ($vc_dir . "/bin"); X- X- my $VC_PATH = dir_choice("Visual C++ directory", [@vc_dirs], [qw(cl.exe)]); X- X- unless (-x $VC_PATH){ X- carp "I can't find your MS VC++ installation.\nDBD::InterBase cannot build.\n"; X- exit 1; X- } X- X- my $vc_inc = $VC_PATH . "/include"; X- my $vc_lib = $VC_PATH . "/lib"; X- X- $INC .= " -I\"$vc_inc\""; X- X- my $ib_lib = dir_choice("Interbase lib directory", [$ib_lib_dir . "lib_ms"], X- [qw(gds32_ms.lib)]); X- X- my $cur_libs = $Config::Config{'libs'} ; X- my $cur_lddlflags = $Config::Config{'lddlflags'} ; X- X- eval " X- sub MY::const_loadlibs { X- ' X-LDLOADLIBS = \"$ib_lib/gds32_ms.lib\" \"$ib_lib/ib_util_ms.lib\" $cur_libs X-LDDLFLAGS = /LIBPATH:\"$vc_lib\" $cur_lddlflags X- ' X- } "; X- } X- else X- { X- # Borland C++ 5.5 X- my $bcc = $Config::Config{'bcc_path'} . "\\"; X- X- my $BCC_PATH = dir_choice("Borland C++ directory", X- [qw(c:/borland/bcc55), $bcc], X- [qw(bin/bcc32.exe)]); X- X- unless(-x $BCC_PATH) X- { X- carp "I can't find your Borland C++ installation.\nDBD::InterBase cannot build.\n"; X- exit 1; X- } X- X- my $bcc_inc = $BCC_PATH . "include"; X- $MakeParams{'CCFLAGS'} = '-a4 -w- -DWIN32 -DNO_STRICT -DNDEBUG -D_CONSOLE -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DPERL_MSVCRT_READFIX'; X- $MakeParams{'OPTIMIZE'} = "-O2"; X- $MakeParams{'INC'} .= " -I\"$bcc_inc\""; X- X- eval " X- sub MY::const_loadlibs { X- ' X-LDLOADLIBS = \$(LIBC) import32.lib gds32.lib cw32.lib X-LDDLFLAGS = -L\"$ib_lib_dir\\lib\" -L\"$BCC_PATH\\lib\" X- ' X- } X- "; X- } X- # Will I need Cygwin rules too? X-} X-elsif ($os eq 'solaris') X-{ X- $MakeParams{'LIBS'} = '-lgdsmt -lm -lc'; X-} X-elsif ($os eq 'linux') X-{ X- # This is for both: X- # o Free IB 4.0 for Red Hat Linux 4.2 X- # o Commercial IB 5.1.1 for Red Hat Linux 5.1 X- my $ib_lib = dir_choice("Interbase lib directory", X- [qw(/usr/interbase/lib /opt/interbase/lib /usr/lib /usr/local/lib)], X- [qw(libgds.a libgds.so)]); X- X- $MakeParams{'LIBS'} = "-L$ib_lib -lgds -ldl "; X- X- # o Commercial IB 5.1.1 for Red Hat Linux 6.x X- # requires a compatibilty library to resolve X- # symbols such as _xstat that were removed X- # from glibc 2.1. IB 5.6 and later don't need X- # this, but it doesn't hurt to list the library. X- if (-f ('/lib/libNoVersion-2.1.2.so')) X- { X- $MakeParams{'LIBS'} .= ' -lNoVersion-2.1.2' X- } X-} X-elsif ($os eq 'freebsd') X-{ X- my $ib_lib = dir_choice("Interbase lib directory", X- [qw(/usr/interbase/lib /usr/lib)], X- [qw(libgds.a libgds.so)]); X- $MakeParams{'LIBS'} = "-L$ib_lib -lgds"; X-} X-elsif ($os eq 'hpux') X-{ X- $MakeParams{'LIBS'} = '-lgds -ldld'; X-} X-elsif ($os eq 'sco') X-{ X- # Uncomment this line if you use InterBase 4.0 for SCO OSR5: X- # $LIBS = '-b elf -B dynamic -lgds -lsocket -lcrypt_i'; X- X- # Uncomment this line if you use InterBase 5.5 for SCO OSR5: X- $MakeParams{'LIBS'} = '-lgds -lsocket -lcrypt_i -lc -lm'; X-} X-elsif ($os eq 'sunos') X-{ X- $MakeParams{'LIBS'} = '-lgdslib -ldl'; X-} X-elsif ($os eq 'irix') X-{ X- $MakeParams{'LIBS'} = '-lgds -lsun'; X-} X-elsif ($os eq 'aix') X-{ X- $MakeParams{'LIBS'} = '-lgdsshr'; X-} X-elsif ($os eq 'dgux') X-{ X- $MakeParams{'LIBS'} = '-lgds -lgdsf -ldl -ldgc'; X-} X-elsif ($os eq 'osf1') X-{ X- $MakeParams{'LIBS'} = '-lgds'; X-} X-elsif ($os eq 'sysv') X-{ X- $MakeParams{'LIBS'} = '-lgds -lnsl -lsocket -ldl'; X-} X-else X-{ X- carp "DBD::InterBase is not supported on platform $os.\n"; X- exit 1; X-} X- X-# create the test config file X-make_test_conf(); X- X-# and last but not least write the makefile X WriteMakefile(%MakeParams); X X package MY; END-of-p5-DBD-InterBase/files/patch-Makefile.PL exit >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message