Skip to content

Commit

Permalink
Fix usage of ${PERL5}.
Browse files Browse the repository at this point in the history
${PERL5} points to a specific version of perl, say, perl5.22.1, it is
fine to use it in a ports Makefile to do Perly things, but ports using
it must use ${PERL}, that points to /usr/local/bin/perl so that if the
minor version is updated, the shebang keep working.

While there, make some ports use shebangfix, regen a few patches, and
bump PORTREVISION where a shebang went from PERL5 to PERL.

PR:		205367
With hat:	portmgr
Sponsored by:	Absolight
  • Loading branch information
mat813 committed Dec 17, 2015
1 parent fbcb74c commit 9e7703a
Show file tree
Hide file tree
Showing 70 changed files with 462 additions and 605 deletions.
4 changes: 2 additions & 2 deletions Mk/bsd.gecko.mk
Expand Up @@ -448,14 +448,14 @@ MOZ_SED_ARGS+= -e's|@CPPFLAGS@|${CPPFLAGS}|g' \
-e 's|@LDFLAGS@|${LDFLAGS}|g' \
-e 's|@LIBS@|${LIBS}|g' \
-e 's|@LOCALBASE@|${LOCALBASE}|g' \
-e 's|@PERL@|${PERL5}|g' \
-e 's|@PERL@|${PERL}|g' \
-e 's|@MOZDIR@|${PREFIX}/lib/${MOZILLA}|g' \
-e 's|%%PREFIX%%|${PREFIX}|g' \
-e 's|%%CFLAGS%%|${CFLAGS}|g' \
-e 's|%%LDFLAGS%%|${LDFLAGS}|g' \
-e 's|%%LIBS%%|${LIBS}|g' \
-e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
-e 's|%%PERL%%|${PERL5}|g' \
-e 's|%%PERL%%|${PERL}|g' \
-e 's|%%MOZILLA%%|${MOZILLA}|g' \
-e 's|%%MOZILLA_BIN%%|${MOZILLA_BIN}|g' \
-e 's|%%MOZDIR%%|${PREFIX}/lib/${MOZILLA}|g'
Expand Down
5 changes: 3 additions & 2 deletions archivers/rpm2cpio/Makefile
Expand Up @@ -13,7 +13,8 @@ COMMENT= Convert .rpm files for extraction with /usr/bin/cpio, needs just perl

NO_WRKSUBDIR= yes

USES= perl5
USES= perl5 shebangfix
SHEBANG_FILES= ${PORTNAME}
NO_BUILD= yes
NO_ARCH= yes
REINPLACE_ARGS=
Expand All @@ -22,7 +23,7 @@ PLIST_FILES= bin/rpm2cpio.pl

do-extract:
@${MKDIR} ${WRKSRC}
@${REINPLACE_CMD} -e 's|^#!/usr/bin/perl|#!${PERL}|' ${FILESDIR}/${PORTNAME} >${WRKDIR}/${PORTNAME}
@${CP} ${FILESDIR}/${PORTNAME} ${WRKDIR}/${PORTNAME}

do-install:
${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}.pl
Expand Down
4 changes: 0 additions & 4 deletions benchmarks/dbs/Makefile
Expand Up @@ -26,10 +26,6 @@ PORTEXAMPLES= *

OPTIONS_DEFINE= DOCS EXAMPLES

post-patch:
@${REINPLACE_CMD} -e \
's|/usr/local/bin/perl|${PERL}|' ${WRKSRC}/script/dbs_view

pre-build:
cd ${WRKSRC}/src; ${MAKE} dir

Expand Down
9 changes: 2 additions & 7 deletions converters/nomyso/Makefile
Expand Up @@ -10,19 +10,14 @@ DISTNAME= ${PORTNAME}${PORTVERSION:S/.//}
MAINTAINER= ports@FreeBSD.org
COMMENT= Convert MASM/TASM files to NASM compatible sources

USES= perl5 zip
USES= perl5 zip dos2unix shebangfix
SHEBANG_FILES= nomyso.pl
USE_PERL5= run
NO_WRKSUBDIR= yes
NO_BUILD= yes

PLIST_FILES= bin/${PORTNAME}.pl

post-patch:
@${REINPLACE_CMD} -E \
-e 's|[[:cntrl:]]$$||' \
-e 's|/usr/bin/perl|${PERL}|' \
${WRKSRC}/${PORTNAME}.pl

do-install:
@${INSTALL_SCRIPT} \
${WRKSRC}/${PORTNAME}.pl \
Expand Down
8 changes: 2 additions & 6 deletions devel/p5-Sys-Virt/Makefile
Expand Up @@ -21,19 +21,15 @@ TEST_DEPENDS= p5-CPAN-Changes>=0:${PORTSDIR}/devel/p5-CPAN-Changes \
p5-Test-Pod>=0:${PORTSDIR}/devel/p5-Test-Pod \
p5-Test-Pod-Coverage>=0:${PORTSDIR}/devel/p5-Test-Pod-Coverage

USES= perl5 pkgconfig
USES= perl5 pkgconfig shebangfix
SHEBANG_FILES= examples/*.pl
USE_PERL5= configure
MAKE_JOBS_UNSAFE= yes

OPTIONS_DEFINE= EXAMPLES

PORTEXAMPLES= *

.include <bsd.port.options.mk>

post-patch:
@${REINPLACE_CMD} -e '1 s|/usr/bin/perl|${PERL}|' ${WRKSRC}/examples/*.pl

post-install:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/Sys/Virt/Virt.so
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
Expand Down
4 changes: 1 addition & 3 deletions dns/ddclient/Makefile
Expand Up @@ -36,9 +36,7 @@ PLIST_FILES= etc/ddclient.conf.sample etc/periodic/daily/ddclient_force \
post-patch:
@${GREP} -lR '/usr' ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} -e \
's|/usr|${PREFIX}|g'
@${REINPLACE_CMD} -e \
's|%%PERL%%|${PERL}| ; \
s|%%ETCDIR%%|${PREFIX}/etc| ; \
@${REINPLACE_CMD} -e 's|%%ETCDIR%%|${PREFIX}/etc| ; \
s|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/ddclient

do-install:
Expand Down
7 changes: 0 additions & 7 deletions dns/ddclient/files/patch-ddclient
@@ -1,12 +1,5 @@
--- ./ddclient.orig 2011-07-25 19:41:39.000000000 -0700
+++ ./ddclient 2011-07-25 19:41:48.000000000 -0700
@@ -1,5 +1,4 @@
-#!/usr/bin/perl -w
-#!/usr/local/bin/perl -w
+#!%%PERL%% -w
######################################################################
# $Id: ddclient 157 2013-12-26 09:02:05Z wimpunk $
#
@@ -19,6 +18,7 @@
use Getopt::Long;
use Sys::Hostname;
Expand Down
4 changes: 2 additions & 2 deletions german/BBBike/Makefile
Expand Up @@ -66,8 +66,8 @@ post-patch:
@${RM} ${WRKSRC}/tmp/.keep_me

do-build:
cd ${WRKSRC}/ext && ${MAKE} PERL=${PERL5} all install
cd ${WRKSRC}/ext && ${MAKE} PERL=${PERL5} clean
cd ${WRKSRC}/ext && ${MAKE} PERL=${PERL} all install
cd ${WRKSRC}/ext && ${MAKE} PERL=${PERL} clean
${FIND} ${WRKSRC}/lib -name "*.so" | ${XARGS} ${CHMOD} u+w
${FIND} ${WRKSRC}/lib -name "*.so" | ${XARGS} ${STRIP_CMD}
${FIND} ${WRKSRC}/lib -name "*.so" | ${XARGS} ${CHMOD} u-w
Expand Down
3 changes: 2 additions & 1 deletion graphics/ImageMagick/Makefile
Expand Up @@ -2,6 +2,7 @@

PORTNAME= ImageMagick
DISTVERSION= 6.9.2-8
PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= graphics perl5
MASTER_SITES= http://www.imagemagick.org/download/ \
Expand Down Expand Up @@ -106,7 +107,7 @@ _IMAGEMAGICK_THREADS_IGNORE_MSG=. Define WITH_THREADS
.endif

.if ${PORT_OPTIONS:MPERL}
CONFIGURE_ARGS+= --with-perl=${PERL5} \
CONFIGURE_ARGS+= --with-perl=${PERL} \
--with-perl-options="MAKE=${MAKE_CMD}"
PLIST_SUB+= WITH_PERL=''
# PerlMagick does not work with threads, if perl is not threaded, and vice versa
Expand Down
3 changes: 2 additions & 1 deletion graphics/ImageMagick7/Makefile
Expand Up @@ -2,6 +2,7 @@

PORTNAME= ImageMagick
DISTVERSION= 7.0.0-0~beta${DATE}
PORTREVISION= 1
CATEGORIES= graphics perl5
MASTER_SITES= http://www.imagemagick.org/download/ \
http://www.imagemagick.org/download/beta/ \
Expand Down Expand Up @@ -112,7 +113,7 @@ _IMAGEMAGICK_THREADS_IGNORE_MSG=. Define WITH_THREADS
.endif

.if ${PORT_OPTIONS:MPERL}
CONFIGURE_ARGS+= --with-perl=${PERL5} \
CONFIGURE_ARGS+= --with-perl=${PERL} \
--with-perl-options="MAKE=${MAKE_CMD}"
PLIST_SUB+= WITH_PERL=''
# PerlMagick does not work with threads, if perl is not threaded, and vice versa
Expand Down
6 changes: 2 additions & 4 deletions graphics/cadubi/Makefile
Expand Up @@ -28,10 +28,8 @@ PORTDOCS= *

OPTIONS_DEFINE= DOCS

do-configure:
@${REINPLACE_CMD} -e \
's|/usr/local/stow/perl-5.8.x/bin/perl|${PERL}|; \
s|$$Bin/help|${DATADIR}/help|' \
post-patch:
@${REINPLACE_CMD} -e 's|$$Bin/help|${DATADIR}/help|' \
${WRKSRC}/cadubi

do-install:
Expand Down
7 changes: 2 additions & 5 deletions graphics/cbview/Makefile
Expand Up @@ -19,17 +19,14 @@ RUN_DEPENDS= unrar:${PORTSDIR}/archivers/unrar \
p5-String-ShellQuote>=0:${PORTSDIR}/textproc/p5-String-ShellQuote

NO_BUILD= yes
USES= perl5
USES= perl5 shebangfix
SHEBANG_FILES= ${PORTNAME}

PLIST_FILES= bin/${PORTNAME}

PORTDOCS= Changes README TODO
OPTIONS_DEFINE= DOCS

post-patch:
@${REINPLACE_CMD} -e 's|/usr/bin/perl -w|${PERL}|' \
${WRKSRC}/${PORTNAME}

do-install:
${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/

Expand Down
4 changes: 2 additions & 2 deletions graphics/p5-ming/Makefile
Expand Up @@ -24,7 +24,8 @@ OPTIONS_DEFINE= EXAMPLES

CONFIGURE_ARGS= --enable-perl
GNU_CONFIGURE= yes
USES= autoreconf bison gmake libtool localbase perl5
USES= autoreconf bison gmake libtool localbase perl5 shebangfix
SHEBANG_FILES= examples/*.cgi

PORTEXAMPLES= *

Expand All @@ -39,7 +40,6 @@ post-patch:
@${REINPLACE_CMD} -e '/ming_is_compiled()/ s|^|#|; /LIBS/d' ${WRKSRC}/Makefile.PL
@${REINPLACE_CMD} -e 's|\.3pm|.3|g' ${WRKSRC}/Makefile.PL ${WRKSRC}/mkdoc
@${REINPLACE_CMD} -e 's|GvCV(\(.*\)) = \(.*\);|GvCV_set(\1, \2);|' ${WRKSRC}/Exports.c
@${REINPLACE_CMD} -e '1 s|/usr/bin/perl|${PERL}|' ${WRKSRC}/examples/*.cgi

post-install:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/SWF/SWF.so
Expand Down
4 changes: 2 additions & 2 deletions irc/pisg/Makefile
Expand Up @@ -10,7 +10,8 @@ MASTER_SITES= SF
MAINTAINER= ports@FreeBSD.org
COMMENT= Perl IRC Statistics Generator

USES= perl5
USES= perl5 shebangfix
SHEBANG_FILES= pisg
NO_BUILD= YES

OPTIONS_DEFINE= LOGCHARSET DOCS
Expand All @@ -28,7 +29,6 @@ pre-patch:
@${REINPLACE_CMD} -e 's|lang.txt|${PREFIX}/share/pisg/lang.txt|; \
s|layout/|${PREFIX}/share/pisg/layout/|' \
${WRKSRC}/modules/Pisg.pm
@${REINPLACE_CMD} -e 's|/usr/bin/perl|${PERL}|' ${WRKSRC}/pisg

do-install:
${MKDIR} ${STAGEDIR}${PREFIX}/etc/pisg
Expand Down
8 changes: 3 additions & 5 deletions irc/xchat-mircryption/Makefile
Expand Up @@ -4,7 +4,7 @@

PORTNAME= mircryption
DISTVERSION= 0.3.3
PORTREVISION= 4
PORTREVISION= 5
PORTEPOCH= 1
CATEGORIES= irc security
MASTER_SITES= http://mircryption.sourceforge.net/Downloads/
Expand All @@ -16,7 +16,8 @@ COMMENT= Free encryption add-on for the popular XChat irc client

RUN_DEPENDS= xchat:${PORTSDIR}/irc/xchat

USES= zip dos2unix
USES= zip dos2unix shebangfix
SHEBANG_FILES= extras/mcps_masterkey_on_start.pl
ALL_TARGET= freebsd
CFLAGS+= -fPIC
USE_LDCONFIG= yes
Expand All @@ -40,9 +41,6 @@ post-patch:
-e 's|^(LDFLAGS.+)"$$|\1 ${LDFLAGS}"|' \
-e 's|^(LOAD).*$$|LOAD=${CXX}|' \
${WRKSRC}/${MAKEFILE}
${REINPLACE_CMD} -E \
-e 's|/usr/bin/perl|${PERL5}|' \
${WRKSRC}/extras/mcps_masterkey_on_start.pl

do-install:
${MKDIR} ${STAGEDIR}${PREFIX}/lib/xchat/plugins
Expand Down
10 changes: 5 additions & 5 deletions mail/adcomplain/Makefile
Expand Up @@ -11,7 +11,8 @@ EXTRACT_SUFX= .uu
MAINTAINER= ports@FreeBSD.org
COMMENT= Complain about inappropriate commercial use (f.e. SPAM) of usenet/e-mail

USES= perl5
USES= perl5 shebangfix
SHEBANG_FILES= adcomplain.pl

EXTRACT_CMD= /usr/bin/uudecode
EXTRACT_BEFORE_ARGS= <
Expand All @@ -20,10 +21,9 @@ NO_WRKSUBDIR= yes
NO_BUILD= yes
PLIST_FILES= bin/adcomplain

post-patch:
cd ${WRKSRC}; \
${CP} adcomplain.pl adcomplain.pl.old; \
${SED} 's=%PERL5%=${PERL}=' < adcomplain.pl.old > adcomplain.pl
# fix-shebang normally runs before the patches in ${FILESDIR} are applied. In
# this case, we need it to run after, so that it can fix the right shebang.
TARGET_ORDER_OVERRIDE= 750:fix-shebang

do-install:
${INSTALL_SCRIPT} ${WRKSRC}/adcomplain.pl \
Expand Down

0 comments on commit 9e7703a

Please sign in to comment.