pkgsrc-Changes archive

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

CVS commit: pkgsrc/sysutils/p5-PerlPowerTools



Module Name:    pkgsrc
Committed By:   scole
Date:           Sun Nov 30 06:24:16 UTC 2025

Modified Files:
        pkgsrc/sysutils/p5-PerlPowerTools: Makefile PLIST distinfo
Added Files:
        pkgsrc/sysutils/p5-PerlPowerTools/patches: patch-bin_fortune
            patch-bin_hangman patch-bin_mimedecode patch-bin_spell
            patch-bin_words patch-lib_PerlPowerTools.pm

Log Message:
Update to version 1.053nb1
- robots: add needed .../devel/p5-Curses dependency
- mimedecode: change 'PerlPowerTools::MIME::Parser->new;' to 'MIME::Parser->new;'
- PerlPowerTools.pm: add get_dictionary_path() for system dictionary
- with hangman & spell & words commands, fallback to system dictionary
- fortune: fix offensive => is_offensive, add /usr/share/games/fortune to search path
- keep utilties and man pages in separate directory, but move perl modules to perllib dir


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 pkgsrc/sysutils/p5-PerlPowerTools/Makefile \
    pkgsrc/sysutils/p5-PerlPowerTools/PLIST \
    pkgsrc/sysutils/p5-PerlPowerTools/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_fortune \
    pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_hangman \
    pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_mimedecode \
    pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_spell \
    pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_words \
    pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-lib_PerlPowerTools.pm

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/sysutils/p5-PerlPowerTools/Makefile
diff -u pkgsrc/sysutils/p5-PerlPowerTools/Makefile:1.1 pkgsrc/sysutils/p5-PerlPowerTools/Makefile:1.2
--- pkgsrc/sysutils/p5-PerlPowerTools/Makefile:1.1      Mon Nov 17 04:44:45 2025
+++ pkgsrc/sysutils/p5-PerlPowerTools/Makefile  Sun Nov 30 06:24:16 2025
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.1 2025/11/17 04:44:45 scole Exp $
+# $NetBSD: Makefile,v 1.2 2025/11/30 06:24:16 scole Exp $
 
 DISTNAME=      PerlPowerTools-1.053
 PKGNAME=       p5-${DISTNAME}
+PKGREVISION=   1
 CATEGORIES=    sysutils perl5
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=briandfoy/}
 GITHUB_PROJECT=        PerlPowerTools
@@ -13,7 +14,6 @@ COMMENT=      BSD utilities written in pure P
 LICENSE=       (${PERL5_LICENSE}) AND 2-clause-bsd AND artistic-2.0 AND gnu-gpl-v2
 
 USE_LANGUAGES= # none
-USE_TOOLS+=    cp gmake ls perl
 
 SUBST_CLASSES+=                moreperl
 SUBST_STAGE.moreperl=  post-extract
@@ -23,36 +23,35 @@ SUBST_SED.moreperl= -e 1s,/usr/bin/env.p
 
 DEPENDS+=      p5-App-a2p-[0-9]*:../../devel/p5-App-a2p
 DEPENDS+=      p5-App-find2perl-[0-9]*:../../devel/p5-App-find2perl
+DEPENDS+=      p5-Curses-[0-9]*:../../devel/p5-Curses
 DEPENDS+=      p5-MIME-tools-[0-9]*:../../mail/p5-MIME-tools
 
 TEST_DEPENDS+= p5-IPC-Run3-[0-9]*:../../devel/p5-IPC-Run3
 TEST_DEPENDS+= p5-Test-Pod-[0-9]*:../../devel/p5-Test-Pod
 TEST_DEPENDS+= p5-Test-Warnings-[0-9]*:../../devel/p5-Test-Warnings
 
-# xxx install in a separate directory.  may be a simpler way to do.
-# if installing to default location, makefile (& plist) can be much
-# simplified, but trying avoid path and name conflicts with system
-# utilities and other packages
-
-# xxx "file" command not working, needs path to magic and file format
-# changed.  probably other commands should be checked out a bit more
+# xxx
+# file: still broken, need /etc/magic and/or updated format
+# units: has some built-in units, fix to grok/usr/share/misc/units.lib ?
 
 PPT_DNAME=             p5-PerlPowerTools
 PLIST_SUBST+=          PPT_DNAME="${PPT_DNAME}"
 
-GENERATE_PLIST+=       ( cd ${DESTDIR}${PREFIX} && ${LS} \
-                       ${PPT_DNAME}/lib/perl5/*/auto/PerlPowerTools/.packlist \
-                       ${PPT_DNAME}/lib/perl5/*/perllocal.pod );
-
-do-configure:
-       cd ${WRKSRC} && ${PERL5} Makefile.PL \
-               INSTALL_BASE=${DESTDIR}${PREFIX}/${PPT_DNAME}
-
-do-build:
-       cd ${WRKSRC} && ${GMAKE}
+INSTALLATION_DIRS+=    ${PREFIX}/${PPT_DNAME}/bin \
+                       ${PREFIX}/${PPT_DNAME}/man/man1 \
+                       ${PERL5_INSTALLVENDORMAN3DIR}
 
+# install utilities and related man pages in separate directory
 do-install:
-       cd ${WRKSRC} && ${GMAKE} install
+       ${INSTALL_SCRIPT} ${WRKSRC}/blib/script/* ${DESTDIR}${PREFIX}/${PPT_DNAME}/bin
+       ${INSTALL_MAN} ${WRKSRC}/blib/man1/* ${DESTDIR}${PREFIX}/${PPT_DNAME}/man/man1
+       ${INSTALL_MAN} ${WRKSRC}/blib/man3/* ${DESTDIR}/${PERL5_INSTALLVENDORMAN3DIR}
+       ${INSTALL_LIB_DIR} ${DESTDIR}${PERL5_INSTALLVENDORLIB}
+       ${INSTALL_LIB_DIR} ${DESTDIR}${PERL5_INSTALLVENDORLIB}/PerlPowerTools
+       ${INSTALL_DATA} ${WRKSRC}/blib/lib/PerlPowerTools.pm ${WRKSRC}/blib/lib/ppt.pm \
+               ${DESTDIR}${PERL5_INSTALLVENDORLIB}
+       ${INSTALL_DATA} ${WRKSRC}/blib/lib/PerlPowerTools/SymbolicMode.pm \
+               ${DESTDIR}${PERL5_INSTALLVENDORLIB}/PerlPowerTools
 
 .include "../../lang/perl5/module.mk"
 .include "../../mk/bsd.pkg.mk"
Index: pkgsrc/sysutils/p5-PerlPowerTools/PLIST
diff -u pkgsrc/sysutils/p5-PerlPowerTools/PLIST:1.1 pkgsrc/sysutils/p5-PerlPowerTools/PLIST:1.2
--- pkgsrc/sysutils/p5-PerlPowerTools/PLIST:1.1 Mon Nov 17 04:44:45 2025
+++ pkgsrc/sysutils/p5-PerlPowerTools/PLIST     Sun Nov 30 06:24:16 2025
@@ -1,4 +1,9 @@
-@comment $NetBSD: PLIST,v 1.1 2025/11/17 04:44:45 scole Exp $
+@comment $NetBSD: PLIST,v 1.2 2025/11/30 06:24:16 scole Exp $
+${PERL5_SUB_INSTALLVENDORLIB}/PerlPowerTools.pm
+${PERL5_SUB_INSTALLVENDORLIB}/PerlPowerTools/SymbolicMode.pm
+${PERL5_SUB_INSTALLVENDORLIB}/ppt.pm
+${PERL5_SUB_INSTALLVENDORMAN3DIR}/PerlPowerTools.3
+${PERL5_SUB_INSTALLVENDORMAN3DIR}/ppt.3
 ${PPT_DNAME}/bin/addbib
 ${PPT_DNAME}/bin/apply
 ${PPT_DNAME}/bin/ar
@@ -122,9 +127,6 @@ ${PPT_DNAME}/bin/words
 ${PPT_DNAME}/bin/wump
 ${PPT_DNAME}/bin/xargs
 ${PPT_DNAME}/bin/yes
-${PPT_DNAME}/lib/perl5/PerlPowerTools.pm
-${PPT_DNAME}/lib/perl5/PerlPowerTools/SymbolicMode.pm
-${PPT_DNAME}/lib/perl5/ppt.pm
 ${PPT_DNAME}/man/man1/addbib.1
 ${PPT_DNAME}/man/man1/apply.1
 ${PPT_DNAME}/man/man1/ar.1
@@ -247,5 +249,3 @@ ${PPT_DNAME}/man/man1/words.1
 ${PPT_DNAME}/man/man1/wump.1
 ${PPT_DNAME}/man/man1/xargs.1
 ${PPT_DNAME}/man/man1/yes.1
-${PPT_DNAME}/man/man3/PerlPowerTools.3
-${PPT_DNAME}/man/man3/ppt.3
Index: pkgsrc/sysutils/p5-PerlPowerTools/distinfo
diff -u pkgsrc/sysutils/p5-PerlPowerTools/distinfo:1.1 pkgsrc/sysutils/p5-PerlPowerTools/distinfo:1.2
--- pkgsrc/sysutils/p5-PerlPowerTools/distinfo:1.1      Mon Nov 17 04:44:45 2025
+++ pkgsrc/sysutils/p5-PerlPowerTools/distinfo  Sun Nov 30 06:24:16 2025
@@ -1,5 +1,11 @@
-$NetBSD: distinfo,v 1.1 2025/11/17 04:44:45 scole Exp $
+$NetBSD: distinfo,v 1.2 2025/11/30 06:24:16 scole Exp $
 
 BLAKE2s (PerlPowerTools-1.053.tar.gz) = 61176fe39ee977de6e21063301741d61af23dfdec42b17269b210db5a7e025ce
 SHA512 (PerlPowerTools-1.053.tar.gz) = a4b201be1ec3972c584824fc2ce6e79bffd437098f510852f3cdd9517cd12db94e61593dd72c80da4b9cba7cbe133f6a9d8b707f933deeb96d148f3fff577c0f
 Size (PerlPowerTools-1.053.tar.gz) = 420226 bytes
+SHA1 (patch-bin_fortune) = f6fbf8e4c67069b087a518252db55560ec31af7e
+SHA1 (patch-bin_hangman) = 450c8de4b8765bcb2285f8dde9a02548ffc426cb
+SHA1 (patch-bin_mimedecode) = f64affe71c894c3349bda1d10f96ef3826f8a392
+SHA1 (patch-bin_spell) = 8f0ffa7bf00ad861fd5bbaed7119caa1405ed884
+SHA1 (patch-bin_words) = e1d936d08d9e25432f1a7d85fab23c12cdc6db83
+SHA1 (patch-lib_PerlPowerTools.pm) = 53e301c769a03345593fc74df961dc13fa06aa5b

Added files:

Index: pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_fortune
diff -u /dev/null pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_fortune:1.1
--- /dev/null   Sun Nov 30 06:24:16 2025
+++ pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_fortune Sun Nov 30 06:24:16 2025
@@ -0,0 +1,45 @@
+$NetBSD: patch-bin_fortune,v 1.1 2025/11/30 06:24:16 scole Exp $
+
+Try to use system fortune, fix function name
+
+--- bin/fortune.orig   2025-11-04 14:05:44.000000000 +0000
++++ bin/fortune
+@@ -252,8 +252,16 @@ sub find_path
+ sub fortune_dirs
+ {
+     my @searchdirs;
+-    push @searchdirs, @FORTDIRS unless $opts{o};
+-    push @searchdirs, @OFFDIRS if ( $opts{o} || $opts{a} );
++    my $sys_fort = "/usr/share/games/fortune";
++    if ( -d "$home/fortunes" ) {
++      # non-offensive & offensive in separate dirs
++      push @searchdirs, @FORTDIRS unless $opts{o};
++      push @searchdirs, @OFFDIRS if ( $opts{a} || $opts{o} );
++    } elsif ( -d $sys_fort ) {
++      # non-offensive & offensive in same dir
++      push @searchdirs, $sys_fort;
++      @OFFDIRS = ();
++    }
+     return @searchdirs;
+ }
+ 
+@@ -293,7 +301,7 @@ sub is_fortune_file
+           warn "$msg FALSE (no \".dat\" file)\n" if $debug;
+           return 0;
+     }
+-    if ( $opts{o} and not offensive( $path ) ) {
++    if ( $opts{o} and not is_offensive( $path ) ) {
+           warn "$msg FALSE (inoffensive files not allowed)\n" if $debug;
+           return 0;
+     }
+@@ -1098,6 +1106,10 @@ readme
+ ./fortunes/startrek
+ ./fortunes/zippy
+ 
++  OR
++
++/usr/share/games/fortune/
++
+ =head1 BUGS
+ 
+ Currently there is no installer and the fortunes listed above are not
Index: pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_hangman
diff -u /dev/null pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_hangman:1.1
--- /dev/null   Sun Nov 30 06:24:16 2025
+++ pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_hangman Sun Nov 30 06:24:16 2025
@@ -0,0 +1,33 @@
+$NetBSD: patch-bin_hangman,v 1.1 2025/11/30 06:24:16 scole Exp $
+
+try to use system dictionary if no wordlist
+
+--- bin/hangman.orig   2025-11-04 14:05:44.000000000 +0000
++++ bin/hangman
+@@ -13,6 +13,7 @@ License: gpl
+ 
+ 
+ use strict;
++use PerlPowerTools;
+ 
+ srand();
+ my( $cont ) = "y";
+@@ -72,7 +73,7 @@ while( $cont =~ /^y/io ) {
+ print "\nTHANKS FOR PLAYING!\n";
+ 
+ sub get_a_word {
+-      my $wordlist = "wordlist.txt";
++      my $wordlist = get_dictionary_path("wordlist.txt");
+       my( $fh, $word );
+       my( $random ) = rand();
+ 
+@@ -129,7 +130,8 @@ hangman's gallows.
+ =head1 FILES
+ 
+ F<wordlist.txt> - make a list of words you'd like to use and put it
+-in the current directory.
++in the current directory.  If F<wordlist.txt> not found, try to
++use system dictionary file.
+ 
+ =head1 AUTHOR
+ 
Index: pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_mimedecode
diff -u /dev/null pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_mimedecode:1.1
--- /dev/null   Sun Nov 30 06:24:16 2025
+++ pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_mimedecode      Sun Nov 30 06:24:16 2025
@@ -0,0 +1,15 @@
+$NetBSD: patch-bin_mimedecode,v 1.1 2025/11/30 06:24:16 scole Exp $
+
+Use MIME::Parser directly in case of non-default path install
+
+--- bin/mimedecode.orig        2025-11-04 14:05:44.000000000 +0000
++++ bin/mimedecode
+@@ -43,7 +43,7 @@ my %opt = ( 'd' => '.' );
+ 
+ getopts('d:',\%opt);
+ 
+-my $parser = PerlPowerTools::MIME::Parser->new;
++my $parser = MIME::Parser->new;
+ $parser->output_dir($opt{'d'});
+ 
+ if (@ARGV)
Index: pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_spell
diff -u /dev/null pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_spell:1.1
--- /dev/null   Sun Nov 30 06:24:16 2025
+++ pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_spell   Sun Nov 30 06:24:16 2025
@@ -0,0 +1,20 @@
+$NetBSD: patch-bin_spell,v 1.1 2025/11/30 06:24:16 scole Exp $
+
+search for system dictionary
+
+--- bin/spell.orig     2025-11-04 14:05:44.000000000 +0000
++++ bin/spell
+@@ -16,11 +16,12 @@ use strict;
+ 
+ use File::Basename qw(basename);
+ use Getopt::Std qw(getopts);
++use PerlPowerTools;
+ 
+ use constant EX_SUCCESS => 0;
+ use constant EX_FAILURE => 1;
+ 
+-use constant DICT_FILE => '/usr/dict/words';
++use constant DICT_FILE => get_dictionary_path('/usr/dict/words');
+ 
+ my $Program = basename($0);
+ 
Index: pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_words
diff -u /dev/null pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_words:1.1
--- /dev/null   Sun Nov 30 06:24:16 2025
+++ pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-bin_words   Sun Nov 30 06:24:16 2025
@@ -0,0 +1,32 @@
+$NetBSD: patch-bin_words,v 1.1 2025/11/30 06:24:16 scole Exp $
+
+try to use system dictionary if no wordlist
+
+--- bin/words.orig     2025-11-04 14:05:44.000000000 +0000
++++ bin/words
+@@ -16,6 +16,7 @@ use strict;
+ use File::Basename qw(basename dirname);
+ use File::Spec qw();
+ use Getopt::Std qw(getopts);
++use PerlPowerTools;
+ 
+ use constant EX_SUCCESS => 0;
+ use constant EX_FAILURE => 1;
+@@ -56,6 +57,7 @@ if (-d $wordlist) {
+     exit EX_FAILURE;
+ }
+ my $dict;
++$wordlist = get_dictionary_path($wordlist);
+ unless (open $dict, '<', $wordlist) {
+     warn "$Program: unable to open '$wordlist': $!\n";
+     exit EX_FAILURE;
+@@ -134,7 +136,8 @@ B<words> accepts the following options:
+ 
+ By default, B<words> looks for a word-file named 'wordlist' in the
+ same directory as the executable.  Use the B<-w> option to specify the
+-path to an alternate word list.
++path to an alternate word list.  If no word file found, attempt to use
++a system dictionary wordlist instead.
+ 
+ =item B<-m> I<min-length>
+ 
Index: pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-lib_PerlPowerTools.pm
diff -u /dev/null pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-lib_PerlPowerTools.pm:1.1
--- /dev/null   Sun Nov 30 06:24:16 2025
+++ pkgsrc/sysutils/p5-PerlPowerTools/patches/patch-lib_PerlPowerTools.pm       Sun Nov 30 06:24:16 2025
@@ -0,0 +1,38 @@
+$NetBSD: patch-lib_PerlPowerTools.pm,v 1.1 2025/11/30 06:24:16 scole Exp $
+
+Add get_dictionary_path to look for default dictionary
+
+--- lib/PerlPowerTools.pm.orig 2025-11-04 14:05:44.000000000 +0000
++++ lib/PerlPowerTools.pm
+@@ -1,6 +1,31 @@
+ package PerlPowerTools;
+ 
+ our $VERSION = '1.053';
++
++use strict;
++use warnings;
++use Exporter;
++
++our @ISA= qw ( Exporter );
++
++our @EXPORT = qw( get_dictionary_path );
++
++#
++# return path to existing dictionary file. arg is string path to
++# preferred dictionary.  die if no dictionary found
++#
++sub get_dictionary_path {
++    my $pdict = shift @_;
++
++    my @dicts = qw ( /usr/share/dict/words /usr/dict/words );
++    unshift @dicts, ( $pdict ) if $pdict;
++
++    foreach ( @dicts ) {
++        return $_ if -e $_;
++    }
++    die "unable to open any dictionary from ", join(":", @dicts);
++}
++
+ 1;
+ 
+ =encoding utf8



Home | Main Index | Thread Index | Old Index