Handle Slackware 14.2 in a cleaner way via pkgsrc

Didn't like the hack I was using to work around an old perl before. So
when I noticed that using pkgsrc in Slackware pretty soon puts down a
recent perl as a dependency to many things I decided that using that
would be better than overlaying a newer List::Util version on perl 5.22.

This change detects the newest perl on the system at install time and
puts that in the script interpreter line. It removes the wrapper that
included a library tree with new versions of core Perl modules.
This commit is contained in:
Mike Small 2020-07-03 11:45:52 -04:00
parent 04d4063eaf
commit 69348dc2d4
4 changed files with 26 additions and 23 deletions

View File

@ -1,15 +1,16 @@
check:
perl -wc frfac
perlcritic frfac
frfac:
sed "1d;2i #!`./latest_perl`" frfac.in > frfac
install:
check:
`./latest_perl` -wc frfac.in
perlcritic frfac.in
install: frfac
install -o root -g wheel -m 0755 -d /usr/local/bin
install -o root -g wheel -m 0555 frfac /usr/local/bin
install_with_newcore_hack:
install -o root -g wheel -m 0755 -d /usr/local/bin
install -o root -g wheel -m 0555 frfac /usr/local/share/perl5/
install -o root -g wheel -m 0555 frfac.wrapper /usr/local/bin/frfac
clean:
rm -f frfac
uninstall:
rm -f /usr/local/bin/frfac /usr/local/share/perl5/frfac
rm -f /usr/local/bin/frfac

View File

@ -1,4 +1,4 @@
#!/usr/bin/env perl
#!/usr/bin/perl
# Print the URI of the most recent rfi francais facile episode.
# Feed this to a downloader. (This script doesn't itself download.)

View File

@ -1,13 +0,0 @@
#!/bin/sh
# Use a newer List::Util than that in core of the
# system Perl. E.g. Slackware 14.2's perl is
# 5.22.2 and only has version 1.41 of List::Util.
# That version lacks the uniq function.
# The directory /usr/local/share/newperlcore is
# expected to have a new List::Util under it
# install via...
# perl Makefile.PL INSTALL_BASE=/usr/local/share/newperlcore
perl -I /usr/local/share/newperlcore /usr/local/share/perl5/frfac

15
latest_perl Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
bestv=0
for p in $(whereis perl)
do
if [ "$p" != "${p%bin/perl}" ];
then
v=$($p -V:PERL_VERSION | sed "s/[^']*'//;s/'.*\$//")
if [ $v -gt $bestv ]; then
best=$p
bestv=$($p -V:PERL_VERSION |
sed "s/[^']*'//;s/'.*\$//")
fi
fi
done
echo $best