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:
parent
04d4063eaf
commit
69348dc2d4
19
Makefile
19
Makefile
@ -1,15 +1,16 @@
|
|||||||
check:
|
frfac:
|
||||||
perl -wc frfac
|
sed "1d;2i #!`./latest_perl`" frfac.in > frfac
|
||||||
perlcritic 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 0755 -d /usr/local/bin
|
||||||
install -o root -g wheel -m 0555 frfac /usr/local/bin
|
install -o root -g wheel -m 0555 frfac /usr/local/bin
|
||||||
|
|
||||||
install_with_newcore_hack:
|
clean:
|
||||||
install -o root -g wheel -m 0755 -d /usr/local/bin
|
rm -f frfac
|
||||||
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
|
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f /usr/local/bin/frfac /usr/local/share/perl5/frfac
|
rm -f /usr/local/bin/frfac
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env perl
|
#!/usr/bin/perl
|
||||||
# Print the URI of the most recent rfi francais facile episode.
|
# Print the URI of the most recent rfi francais facile episode.
|
||||||
# Feed this to a downloader. (This script doesn't itself download.)
|
# Feed this to a downloader. (This script doesn't itself download.)
|
||||||
|
|
@ -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
15
latest_perl
Executable 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
|
Loading…
Reference in New Issue
Block a user