diff --git a/Makefile b/Makefile index 4c0006f..70e6992 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/frfac b/frfac.in similarity index 98% rename from frfac rename to frfac.in index 6c51f09..3080f03 100755 --- a/frfac +++ b/frfac.in @@ -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.) diff --git a/frfac.wrapper b/frfac.wrapper deleted file mode 100644 index 9e72736..0000000 --- a/frfac.wrapper +++ /dev/null @@ -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 - diff --git a/latest_perl b/latest_perl new file mode 100755 index 0000000..3dff960 --- /dev/null +++ b/latest_perl @@ -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