Thread: perl install problem with pg7.1

perl install problem with pg7.1

From
AGottinger@t-online.de (Achim Gottinger)
Date:
Hi devs,

If I try to install postgress7.1 in a temporary directory using $DESTDIR
it fails with the
following message:

*****
* Skipping the installation of the Perl module for lack of permissions.
* To install it, change to the directory
/mnt/cdrom/tmp/portage/postgresql-7.1/work/postgresql-7.1/src/interfaces/perl5,

* become the appropriate user, and do `make install'.
*****

this also happens if I run

make PREFIX=[mytmpdir] install

(this worked for all other perl modules I made packages from).

Installing directly works (make install), but I must make a package for
postgress so I need to install to a temporary dir.

Here is the output from perl -V:
--------------------------------------------------------------------------

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
 Platform:   osname=linux, osvers=2.4.2-ac13, archname=i686-linux   uname='linux linux.bagwan 2.4.2-ac13 #3 smp sam apr
701:08:28 cest
 
2001 i686 unknown '   config_args='-des -Dprefix=/usr -Dd_dosuid -Dd_semctl_semun -Di_gdbm
-Di_db -Di_ndbm -Duseshrplib -Duselargefiles -Darchname=i686-linux'   hint=recommended, useposix=true,
d_sigaction=define  usethreads=undef use5005threads=undef useithreads=undef
 
usemultiplicity=undef   useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef   use64bitint=undef
use64bitall=undefuselongdouble=undef Compiler:   cc='cc', ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE
 
-D_FILE_OFFSET_BITS=64',   optimize='-O2 -mpentiumpro -march=pentiumpro',   cppflags='-fno-strict-aliasing'
ccversion='',gccversion='2.95.3 20010315 (release)',
 
gccosandvers=''   intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234   d_longlong=define, longlongsize=8,
d_longdbl=define,longdblsize=12   ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
 
lseeksize=8   alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries:   ld='cc', ldflags ='
-L/usr/local/lib'  libpth=/usr/local/lib /lib /usr/lib   libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil
perllibs=-lnsl-ldl -lm -lc -lcrypt -lutil   libc=/lib/libc-2.2.2.so, so=so, useshrplib=true, libperl=libperl.so Dynamic
Linking:  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic
 
-Wl,-rpath,/usr/lib/perl5/5.6.1/i686-linux/CORE'   cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Built under linux Compiled at Apr
162001 17:23:11 @INC:   /usr/lib/perl5/5.6.1/i686-linux   /usr/lib/perl5/5.6.1
/usr/lib/perl5/site_perl/5.6.1/i686-linux  /usr/lib/perl5/site_perl/5.6.1   /usr/lib/perl5/site_perl/5.6.0/i686-linux
/usr/lib/perl5/site_perl/5.6.0  /usr/lib/perl5/site_perl
 
---------------------------------------------------------------------------------

I'm using the pgsql_perl5 version included in postgress7.1 and i applied
the readline4.2
patch.

Any suggestions?

bye achim~



Re: perl install problem with pg7.1

From
Peter Eisentraut
Date:
Achim Gottinger writes:

> If I try to install postgress7.1 in a temporary directory using $DESTDIR
> it fails with the
> following message:
>
> *****
> * Skipping the installation of the Perl module for lack of permissions.
> * To install it, change to the directory
> /mnt/cdrom/tmp/portage/postgresql-7.1/work/postgresql-7.1/src/interfaces/perl5,
>
> * become the appropriate user, and do `make install'.
> *****

DESTDIR doesn't work in the Perl and Python subtrees yet.  Which might be
one of the reasons it's not documented yet.  ;-)

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter



Re: perl install problem with pg7.1

From
Lamar Owen
Date:
Achim Gottinger wrote:
> If I try to install postgress7.1 in a temporary directory using $DESTDIR
> it fails with the
> following message:
> *****
> * Skipping the installation of the Perl module for lack of permissions.
> * To install it, change to the directory
> /mnt/cdrom/tmp/portage/postgresql-7.1/work/postgresql-7.1/src/interfaces/perl5,
> 
> * become the appropriate user, and do `make install'.
> *****

The perl build doesn't directly support DESTDIR.  If you know anything
at all about RPM spec files, see the build procedure in the Source RPM.

But, to make it easy, here's what I have to do in the RPM build:

First, I patch the GNUmakefile in the perl interfaces directory (while
the patch here is against 7.1beta4, it applies cleanly against the
released 7.1):
----------------------
diff -uNr postgresql-7.1beta4.orig/src/interfaces/perl5/GNUmakefile
postgresql-7.1beta4/src/interfaces/perl5/GNUmakefile
--- postgresql-7.1beta4.orig/src/interfaces/perl5/GNUmakefile    Thu Nov 16
19:08:57 2000
+++ postgresql-7.1beta4/src/interfaces/perl5/GNUmakefile    Mon Jan 29
00:00:31 2001
@@ -36,8 +36,8 @@install: Makefile    $(MAKE) -f Makefile clean
-    POSTGRES_LIB="$(libdir)" \
-      POSTGRES_INCLUDE="$(includedir)" \
+    POSTGRES_LIB="$(RPM_BUILD_ROOT)$(libdir)" \
+      POSTGRES_INCLUDE="$(RPM_BUILD_ROOT)$(includedir)" \      $(PERL) $(srcdir)/Makefile.PL    $(MAKE) -f Makefile
all   -@if [ -w "`$(MAKE) --quiet -f Makefile echo-installdir`" ]; then \
 
------------------------
You will need to change the $RPM_BUILD_ROOT to $DESTDIR.

The spec file does the build in three stages.  Stage one is a standard
make all after the appropriate configure line -- this builds the
Makefile and runs a compile pass on the client -- it is actually
unnecessary, but the build system does it anyway as part of the main
build.  

Stage two is a make DESTDIR=$RPM_BUILD_ROOT install. This builds the Pg
module yet again -- but linked to libpq.so in the right location this
time.  But the install stage fails, as you've seen. 

Stage three is rather funky, as it bypasses the GNUmakefile (which has
already done all it needs to do), as well as Makefile.PL, which is not
needed at all for the actual install. As stage two's build has built the
right Makefile, but passes the wrong values to it, thus the third
half-stage is needed to finish the install -- which is more than just
putting the right files in the right location. Here's the relevant
section of the spec file that does the build stage three:

-------------------make PREFIX=$RPM_BUILD_ROOT/usr -C src/interfaces/perl5 -f Makefile
install
# Get rid of the packing list generated by the perl Makefile, and build
my own...find $RPM_BUILD_ROOT/usr/lib/perl5 -name .packlist -exec rm -f {} \;find $RPM_BUILD_ROOT/usr/lib/perl5 -type f
-print| \    sed -e "s|$RPM_BUILD_ROOT/|/|g"  | \    sed -e "s|.*/man/.*|&\*|" > perlfiles.listfind
$RPM_BUILD_ROOT/usr/lib/perl5-type d -name Pg -print | \    sed -e "s|$RPM_BUILD_ROOT/|%dir /|g" >> perlfiles.list#
checkand fixup Pg manpage location....if [ ! -e $RPM_BUILD_ROOT%{_mandir}/man3/Pg.* ]then    mkdir -p
$RPM_BUILD_ROOT%{_mandir}/man3   cp `find $RPM_BUILD_ROOT -name 'Pg.3*' -print`
 
$RPM_BUILD_ROOT%{_mandir}/man3fipushd src/interfacesmkdir -p $RPM_BUILD_ROOT/usr/share/pgsql/perl5cp -a perl5/test.pl
$RPM_BUILD_ROOT/usr/share/pgsql/perl5popd#remove perllocal.pod and Pg.bs from the file list - only occurs with
 
5.6
perl -pi -e "s/^.*perllocal.pod$//" perlfiles.listperl -pi -e "s/^.*Pg.bs$//" perlfiles.listmkdir -p
$RPM_BUILD_ROOT/usr/lib/perl5/site_perl/%{_arch}-linux/auto/Pg
------------------

Whew!

It  took quite a bit of time to get that to work right with more than
one version of perl (and the work of more people than just me -- Thomas
Lockhart and Trond Eivind Glomsrød both had big parts of getting it
right), but if someone else can use it, it will make it more
worthwhile.  Don't let the %{} rpm macros throw you -- substitute the
appropriate locations for your situation.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11