From 6545e26154ecc8745117cd2c3916e6095ac00f5b Mon Sep 17 00:00:00 2001 From: Kurt Jaeger Date: Tue, 27 Feb 2018 07:15:54 +0000 Subject: [PATCH] textproc/p5-XML-SAX: fix checksum mismatch for ParserDetails.ini - The file %%SITE_PERL%%/XML/SAX/ParserDetails.ini is updated by ports that depending textproc/p5-XML-SAX. - For example, textproc/p5-XML-SAX-Expat, textproc/p5-XML-Simple and textproc/p5-XML-LibXML append something to the .ini file. - This causes checksum mismatch when executing `pkg check -s textproc/p5-XML-SAX` The fix provides a pkg-install program to handle the file in post-install. PR: 197011 Submitted by: Tatsuki Makino Reviewed by: John Hein, mat, Walter Schwarzenfeld --- textproc/p5-XML-SAX/Makefile | 3 +++ textproc/p5-XML-SAX/files/patch-Makefile.PL | 2 +- textproc/p5-XML-SAX/files/pkg-install.in | 19 +++++++++++++++++++ textproc/p5-XML-SAX/pkg-plist | 2 +- 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 textproc/p5-XML-SAX/files/pkg-install.in diff --git a/textproc/p5-XML-SAX/Makefile b/textproc/p5-XML-SAX/Makefile index 2d87ea09d3fb..624a87a4213c 100644 --- a/textproc/p5-XML-SAX/Makefile +++ b/textproc/p5-XML-SAX/Makefile @@ -20,5 +20,8 @@ RUN_DEPENDS:= ${BUILD_DEPENDS} NO_ARCH= yes USES= perl5 USE_PERL5= configure +SUB_FILES= pkg-install +SUB_LIST= PERL=${PERL} +PKGDEINSTALL= ${PKGINSTALL} .include diff --git a/textproc/p5-XML-SAX/files/patch-Makefile.PL b/textproc/p5-XML-SAX/files/patch-Makefile.PL index fa6ac04728ad..418da31993d8 100644 --- a/textproc/p5-XML-SAX/files/patch-Makefile.PL +++ b/textproc/p5-XML-SAX/files/patch-Makefile.PL @@ -22,7 +22,7 @@ install_sax_pureperl : pure_install -\t\@\$(PERL) -MXML::SAX -e "XML::SAX->add_parser(q(XML::SAX::PurePerl))->save_parsers()" -+\t\@\$(PERL) -I\$(DESTDIR)\$(INSTALLSITELIB) -MXML::SAX -e "XML::SAX->add_parser(q(XML::SAX::PurePerl))->save_parsers()" ++#\t\@\$(PERL) -I\$(DESTDIR)\$(INSTALLSITELIB) -MXML::SAX -e "XML::SAX->add_parser(q(XML::SAX::PurePerl))->save_parsers()" INSTALL diff --git a/textproc/p5-XML-SAX/files/pkg-install.in b/textproc/p5-XML-SAX/files/pkg-install.in new file mode 100644 index 000000000000..5dd23d39b24b --- /dev/null +++ b/textproc/p5-XML-SAX/files/pkg-install.in @@ -0,0 +1,19 @@ +#!/bin/sh + +PERL="%%PERL%%" + +case $2 in + POST-INSTALL) + $PERL -MXML::SAX -e 'XML::SAX->add_parser(q(XML::SAX::PurePerl))->save_parsers();' + ;; + DEINSTALL) + $PERL -MFile::Basename=dirname -MFile::Spec -MXML::SAX << 'PERLSCRIPT' +XML::SAX->remove_parser(q(XML::SAX::PurePerl))->save_parsers(); +unless (@{XML::SAX->parsers()} > 0) { + $dir = $INC{q(XML/SAX.pm)}; $dir = dirname($dir); + $file = File::Spec->catfile($dir, q(SAX), XML::SAX::PARSER_DETAILS); + unlink($file); +} +PERLSCRIPT + ;; +esac diff --git a/textproc/p5-XML-SAX/pkg-plist b/textproc/p5-XML-SAX/pkg-plist index bfa90b84129e..dcdd6898f65e 100644 --- a/textproc/p5-XML-SAX/pkg-plist +++ b/textproc/p5-XML-SAX/pkg-plist @@ -7,7 +7,7 @@ %%SITE_PERL%%/XML/SAX.pm %%SITE_PERL%%/XML/SAX/DocumentLocator.pm %%SITE_PERL%%/XML/SAX/Intro.pod -%%SITE_PERL%%/XML/SAX/ParserDetails.ini +@comment %%SITE_PERL%%/XML/SAX/ParserDetails.ini %%SITE_PERL%%/XML/SAX/ParserFactory.pm %%SITE_PERL%%/XML/SAX/PurePerl.pm %%SITE_PERL%%/XML/SAX/PurePerl/DTDDecls.pm