summaryrefslogtreecommitdiff
path: root/lang/perl5/files/perllink.in
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2005-08-06 06:18:44 +0000
committerjlam <jlam@pkgsrc.org>2005-08-06 06:18:44 +0000
commit86f92684818eb77da677366cd49b4fa35e87b579 (patch)
tree554688efac79710dce203345436bb3e8cb9748b1 /lang/perl5/files/perllink.in
parent948ada653aefeccbbb05b811348b0025017134ba (diff)
downloadpkgsrc-86f92684818eb77da677366cd49b4fa35e87b579.tar.gz
Update lang/perl5 to 5.8.7. Changes from version 5.8.6 include updates
for many "core" modules, UTF-8 and Unicode bugfixes, and ithreads bugfixes. The major changes are in the pkgsrc infrastructure to handle Perl and Perl modules. All pkgsrc-installed Perl modules are now installed in "vendor" directories, and the perl interpreter has been modifed to search for libraries in the following order: site, vendor, perl. The Perl library is stored in a directory that is named for the Perl ABI version associated with the Perl release, so any updates of Perl to newer versions can be done "in-place" as long as Perl ABI version remains the same. All Perl scripts and man pages are stored in locations that won't conflict between site, vendor, and perl modules, and a new utility perllink(1) now manages symlinks to those scripts and man pages under the usual ${LOCALBASE}/bin and ${LOCALBASE}/man/man1. PERL5_SITEPREFIX may be set to the prefix where local, site-specific modules will be installed, e.g. PERL5_SITEPREFIX=/usr/local. Note that modules installed here are completely unmanaged by pkgsrc. Update the buildlink and tool dependencies on perl to require perl>=5.8.7 to reflect the new locations for Perl modules and the Perl shared library.
Diffstat (limited to 'lang/perl5/files/perllink.in')
-rw-r--r--lang/perl5/files/perllink.in195
1 files changed, 195 insertions, 0 deletions
diff --git a/lang/perl5/files/perllink.in b/lang/perl5/files/perllink.in
new file mode 100644
index 00000000000..44dfacca2d5
--- /dev/null
+++ b/lang/perl5/files/perllink.in
@@ -0,0 +1,195 @@
+#!@SH@
+# $NetBSD: perllink.in,v 1.1 2005/08/06 06:18:45 jlam Exp $
+#
+# Copyright (c) 2005 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Johnny C. Lam.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the NetBSD
+# Foundation, Inc. and its contributors.
+# 4. Neither the name of The NetBSD Foundation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+#
+# This script parses the packlists listed on the command line and either
+# adds or deletes the symlinks in <prefix>/bin and <prefix>/man/man1 that
+# match the files in the packlists.
+#
+
+perlprog="@PERL5@"
+
+usage()
+{
+ echo 1>&2 "usage: $0 [-fnv] [-p prefix] add|delete [packlist ...]"
+ exit 1
+}
+
+opt_action=
+opt_force=
+opt_noaction=
+opt_prefix=
+opt_packlists=
+opt_verbose=
+
+while test $# -gt 0; do
+ opt="$1"
+ case "$opt" in
+ -f|--force) opt_force=yes; shift ;;
+ -n|--noaction) opt_noaction=yes; shift ;;
+ -p) opt_prefix="$2"; shift; shift ;;
+ --prefix=*) opt_prefix="${1#--prefix=}"; shift ;;
+ -v|--verbose) opt_verbose=yes; shift ;;
+ --) break; shift ;;
+ -*) usage ;;
+ [!-]*) break ;;
+ esac
+done
+
+# We expect the action argument, as well as any packlists, to be left
+# in the argument list.
+#
+test $# -gt 0 || usage
+opt_action="$1"; shift
+
+# Get the values of various Config.pm values from perl.
+eval `$perlprog -V:prefix -V:scriptdir -V:man1dir -V:vendorprefix -V:vendorscript -V:vendorman1dir -V:siteprefix -V:sitescript -V:siteman1dir -V:archlib`
+
+# The remaining arguments, if any, are packlists.
+if test $# -gt 0; then
+ opt_packlists="$@"
+elif test -f "$archlib/.packlist"; then
+ opt_packlists="$archlib/.packlist"
+fi
+
+test -n "$opt_prefix" || opt_prefix="$prefix"
+
+# Re-point variables so that if they are under $prefix, then they are
+# recomputed to point under $opt_prefix.
+#
+case "$scriptdir" in
+$prefix/*) scriptdir="$opt_prefix/${scriptdir#$prefix/}" ;;
+"") scriptdir="$opt_prefix/bin" ;;
+esac
+case "$man1dir" in
+$prefix/*) man1dir="$opt_prefix/${man1dir#$prefix/}" ;;
+"") man1dir="$opt_prefix/man/man1" ;;
+esac
+case "$siteprefix" in
+$prefix/*) siteprefix="$opt_prefix/${siteprefix#$prefix/}" ;;
+"") siteprefix="$opt_prefix" ;;
+esac
+case "$sitescript" in
+$prefix/*) sitescript="$opt_prefix/${sitescript#$prefix/}" ;;
+"") sitescript="$scriptdir" ;;
+esac
+case "$siteman1dir" in
+$prefix/*) siteman1dir="$opt_prefix/${siteman1dir#$prefix/}" ;;
+"") siteman1dir="$man1dir" ;;
+esac
+case "$vendorprefix" in
+$prefix/*) vendorprefix="$opt_prefix/${vendorprefix#$prefix/}" ;;
+"") vendorprefix="$opt_prefix" ;;
+esac
+case "$vendorscript" in
+$prefix/*) vendorscript="$opt_prefix/${vendorscript#$prefix/}" ;;
+"") vendorscript="$scriptdir" ;;
+esac
+case "$vendorman1dir" in
+$prefix/*) vendorman1dir="$opt_prefix/${vendorman1dir#$prefix/}" ;;
+"") vendorman1dir="$man1dir" ;;
+esac
+
+destbindir="$opt_prefix/bin"
+destman1dir="$opt_prefix/man/man1"
+
+echo __dummy__ | perl -pe '0' $opt_packlists |
+{ while read file junk; do
+ case "$file" in
+ $scriptdir/*|$sitescript/*|$vendorscript/*) destdir="$destbindir" ;;
+ $man1dir/*|$siteman1dir/*|$vendorman1dir/*) destdir="$destman1dir" ;;
+ esac
+
+ case "$file" in
+ $scriptdir/*) dest="$destdir/${file#$scriptdir/}" ;;
+ $sitescript/*) dest="$destdir/${file#$sitescript/}" ;;
+ $vendorscript/*) dest="$destdir/${file#$vendorscript/}" ;;
+ $man1dir/*) dest="$destdir/${file#$man1dir/}" ;;
+ $siteman1dir/*) dest="$destdir/${file#$siteman1dir/}" ;;
+ $vendorman1dir/*) dest="$destdir/${file#$vendorman1dir/}" ;;
+ *) continue ;;
+ esac
+
+ test "$file" != "$dest" || continue
+
+ # Set $src to be a relative symlink from $file into $destdir.
+ file="${file#/}"
+ destdir="${destdir#/}"
+ while test "${file%%/*}" = "${destdir%%/*}"; do
+ case "$file" in
+ */*) file="${file#*/}" ;;
+ *) file= ;;
+ esac
+ case "$destdir" in
+ */*) destdir="${destdir#*/}" ;;
+ *) destdir= ;;
+ esac
+ done
+ src=""
+ while test -n "$destdir"; do
+ src="../$src"
+ case "$destdir" in
+ */*) destdir="${destdir#*/}" ;;
+ *) destdir= ;;
+ esac
+ done
+ src="$src$file"
+
+ case "$opt_action" in
+ add|delete)
+ if test -n "$opt_force"; then
+ test -z "$opt_verbose" || \
+ echo "print STDERR \"rm $dest\\n\";"
+ test -n "$opt_noaction" || \
+ echo "unlink(\"$dest\");"
+ fi
+ ;;
+ *)
+ usage
+ ;;
+ esac
+ case "$opt_action" in
+ add)
+ test -z "$opt_verbose" || \
+ echo "print STDERR \"ln -s $src $dest\\n\";"
+ test -n "$opt_noaction" || \
+ echo "symlink(\"$src\", \"$dest\");"
+ ;;
+ esac
+done;
+echo "exit(0);"; } | $perlprog -w -