For the Makefile, we can use $(PWD) make macro from make(1posix)
as POSIX requires all environment variables be accessible as
macros, and $PWD is a standard sh(1) environment variable.
lei.sh must quiet the stderr of realpath before falling back to
readlink(1) which is available on NetBSD.
bindir = \$(prefix)/bin
symlink-install : lib/PublicInbox.pm
mkdir -p \$(bindir)
- lei=\$\$(realpath lei.sh) && cd \$(bindir) && \\
+ lei="\$(PWD)/lei.sh" && cd \$(bindir) && \\
for x in \$(EXE_FILES); do \\
ln -sf "\$\$lei" \$\$(basename "\$\$x"); \\
done
#!/bin/sh -e
# symlink this file to a directory in PATH to run lei (or anything in script/*)
# without needing perms to install globally. Used by "make symlink-install"
-p=$(realpath "$0" || readlink "$0") # neither is POSIX, but common
+p=$(realpath "$0" 2>/dev/null || readlink "$0") # neither is POSIX, but common
p=$(dirname "$p") c=$(basename "$0") # both are POSIX
exec ${PERL-perl} -w -I"$p"/lib "$p"/script/"${c%.sh}" "$@"
: this script is too short to copyright