pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/textproc/p5-XML-SAX - The package supports installatio...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/32a52786b837
branches:  trunk
changeset: 529961:32a52786b837
user:      heinz <heinz%pkgsrc.org@localhost>
date:      Wed Jun 13 23:17:31 2007 +0000

description:
- The package supports installation to DESTDIR. The only issue was the
  creation of the parser registry (ParserDetails.ini) at installation
  time which does not work if using DESTDIR.
  Instead of breaking abstraction barriers (use of _USE_DESTDIR) to make
  this work, this task was moved to INSTALL/DEINSTALL scripts where it
  really belongs, which incidentally also solves the problem described
  above.

- In order to move the creation of the parser registry to the pkgsrc
  scripts, Makefile.PL was changed (through patch-aa) to respect the
  variable SKIP_SAX_INSTALL (inspired by XML::LibXML).

- File::Temp is a part of Perl since 5.6.1 so we do not need an explicit
  DEPENDS line for this.

diffstat:

 textproc/p5-XML-SAX/DEINSTALL        |  11 +++++++++
 textproc/p5-XML-SAX/INSTALL          |  11 +++++++++
 textproc/p5-XML-SAX/Makefile         |  21 ++++++++---------
 textproc/p5-XML-SAX/distinfo         |   4 +-
 textproc/p5-XML-SAX/patches/patch-aa |  43 ++++++++++++++++++++++++++---------
 5 files changed, 66 insertions(+), 24 deletions(-)

diffs (136 lines):

diff -r ceca7bfd9f19 -r 32a52786b837 textproc/p5-XML-SAX/DEINSTALL
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/textproc/p5-XML-SAX/DEINSTALL     Wed Jun 13 23:17:31 2007 +0000
@@ -0,0 +1,11 @@
+# $NetBSD: DEINSTALL,v 1.1 2007/06/13 23:17:31 heinz Exp $
+
+case ${STAGE} in
+
+DEINSTALL)
+        ${PERL5} -I@PERL5_INSTALLVENDORLIB@ -MXML::SAX -e "XML::SAX->remove_parser(q(XML::SAX::PurePerl))->save_parsers()"
+       ${ECHO} "Removed parser from XML::SAX registry."
+       ;;
+
+esac
+
diff -r ceca7bfd9f19 -r 32a52786b837 textproc/p5-XML-SAX/INSTALL
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/textproc/p5-XML-SAX/INSTALL       Wed Jun 13 23:17:31 2007 +0000
@@ -0,0 +1,11 @@
+# $NetBSD: INSTALL,v 1.1 2007/06/13 23:17:31 heinz Exp $
+
+case ${STAGE} in
+
+POST-INSTALL)
+       ${PERL5} -I@PERL5_INSTALLVENDORLIB@ -MXML::SAX -e "XML::SAX->add_parser(q(XML::SAX::PurePerl))->save_parsers()"
+       ${ECHO} "Added parser to XML::SAX registry."
+       ;;
+
+esac
+
diff -r ceca7bfd9f19 -r 32a52786b837 textproc/p5-XML-SAX/Makefile
--- a/textproc/p5-XML-SAX/Makefile      Wed Jun 13 22:29:55 2007 +0000
+++ b/textproc/p5-XML-SAX/Makefile      Wed Jun 13 23:17:31 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2007/02/27 14:03:58 wiz Exp $
+# $NetBSD: Makefile,v 1.18 2007/06/13 23:17:31 heinz Exp $
 
 DISTNAME=      XML-SAX-0.15
 PKGNAME=       p5-${DISTNAME}
@@ -10,21 +10,20 @@
 COMMENT=       Perl interface to the SAX2 XML Parser
 
 PKG_DESTDIR_SUPPORT=   user-destdir
-
-DEPENDS+=      p5-XML-NamespaceSupport>=0.03:../../textproc/p5-XML-NamespaceSupport
-DEPENDS+=      p5-File-Temp-[0-9]*:../../devel/p5-File-Temp
-
 PKG_INSTALLATION_TYPES=        overwrite pkgviews
 
-PERL5_PACKLIST=                auto/XML/SAX/.packlist
+DEPENDS+=      p5-XML-NamespaceSupport>=0.03:../../textproc/p5-XML-NamespaceSupport
+# included in perl>=5.6.1
+#DEPENDS+=     p5-File-Temp-[0-9]*:../../devel/p5-File-Temp
 
-.include "../../mk/bsd.prefs.mk"
+MAKE_ENV=      SKIP_SAX_INSTALL=yes
 
-.if ${_USE_DESTDIR} != "no"
-.include "../../lang/perl5/vars.mk"
+PERL5_PACKLIST=        auto/XML/SAX/.packlist
 
-INSTALL_ENV+=  PERL5LIB=${DESTDIR}${PERL5_INSTALLVENDORLIB}
-.endif
+FILES_SUBST+=  PERL5_INSTALLVENDORLIB=${PERL5_INSTALLVENDORLIB:Q}
+
+post-install:
+       ${ECHO} > ${DESTDIR:Q}${PERL5_INSTALLVENDORLIB}/XML/SAX/ParserDetails.ini
 
 .include "../../lang/perl5/module.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r ceca7bfd9f19 -r 32a52786b837 textproc/p5-XML-SAX/distinfo
--- a/textproc/p5-XML-SAX/distinfo      Wed Jun 13 22:29:55 2007 +0000
+++ b/textproc/p5-XML-SAX/distinfo      Wed Jun 13 23:17:31 2007 +0000
@@ -1,6 +1,6 @@
-$NetBSD: distinfo,v 1.5 2007/02/27 14:03:58 wiz Exp $
+$NetBSD: distinfo,v 1.6 2007/06/13 23:17:32 heinz Exp $
 
 SHA1 (XML-SAX-0.15.tar.gz) = afd1c30a7f577d6e69f831c4f0e49df68c96eccd
 RMD160 (XML-SAX-0.15.tar.gz) = 7fb288043c8328688a8557313c98e37928cb2f3d
 Size (XML-SAX-0.15.tar.gz) = 59346 bytes
-SHA1 (patch-aa) = 5f421c20185ffc0889b04cc412139ecd44545c0d
+SHA1 (patch-aa) = d474262178b0a36da51ed0cdfd56e75272f25d71
diff -r ceca7bfd9f19 -r 32a52786b837 textproc/p5-XML-SAX/patches/patch-aa
--- a/textproc/p5-XML-SAX/patches/patch-aa      Wed Jun 13 22:29:55 2007 +0000
+++ b/textproc/p5-XML-SAX/patches/patch-aa      Wed Jun 13 23:17:31 2007 +0000
@@ -1,18 +1,39 @@
-$NetBSD: patch-aa,v 1.2 2007/02/27 14:03:58 wiz Exp $
+$NetBSD: patch-aa,v 1.3 2007/06/13 23:17:32 heinz Exp $
 
---- Makefile.PL.orig   2006-04-24 00:14:03.000000000 +0000
+--- Makefile.PL.orig   2006-04-24 02:14:03.000000000 +0200
 +++ Makefile.PL
-@@ -28,9 +28,10 @@ sub MY::install {
-         my $dir = File::Basename::dirname($INC{'XML/SAX.pm'});
-         if (-e File::Spec->catfile($dir, 'SAX', 'ParserDetails.ini')) {
-             $write_ini_ok =
+@@ -20,20 +20,22 @@ sub MY::install {
+ 
+     my $write_ini_ok = 0;
+ 
+-    eval { require XML::SAX };
+-    if ($@) {
+-        $write_ini_ok = 1;
+-    }
+-    else {
+-        my $dir = File::Basename::dirname($INC{'XML/SAX.pm'});
+-        if (-e File::Spec->catfile($dir, 'SAX', 'ParserDetails.ini')) {
+-            $write_ini_ok =
 -                ExtUtils::MakeMaker::prompt(
 -                    "Do you want XML::SAX to alter ParserDetails.ini?", "Y"
 -                ) =~ /^y/i;
-+              1;
-+#                ExtUtils::MakeMaker::prompt(
-+#                    "Do you want XML::SAX to alter ParserDetails.ini?", "Y"
-+#                ) =~ /^y/i;
++    unless ( defined $ENV{'SKIP_SAX_INSTALL'} ) {
++        eval { require XML::SAX };
++        if ($@) {
++            $write_ini_ok = 1;
          }
          else {
-             $write_ini_ok = 1;
+-            $write_ini_ok = 1;
++            my $dir = File::Basename::dirname($INC{'XML/SAX.pm'});
++            if (-e File::Spec->catfile($dir, 'SAX', 'ParserDetails.ini')) {
++                $write_ini_ok =
++                    ExtUtils::MakeMaker::prompt(
++                        "Do you want XML::SAX to alter ParserDetails.ini?", "Y"
++                    ) =~ /^y/i;
++            }
++            else {
++                $write_ini_ok = 1;
++            }
+         }
+     }
+     



Home | Main Index | Thread Index | Old Index