From 0e7427bb42160552b5e37424b89970a20d93fcfd Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 16 Dec 2022 14:39:32 +0000 Subject: support symlink install This is useful for users w/o root permissions. --- .gitignore | 1 + INSTALL | 44 ++++++++++++++++++++++++++++++++++++++++++++ MANIFEST | 2 ++ Makefile.PL | 12 ++++++++++++ README | 10 +++++----- exe.sh | 8 ++++++++ 6 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 INSTALL create mode 100755 exe.sh diff --git a/.gitignore b/.gitignore index 71cb379..a89b4a0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /MYMETA. /MYMETA.* /MANIFEST.gen +/Makefile.old /Makefile /Mwrap.bs /Mwrap.c diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..80ff748 --- /dev/null +++ b/INSTALL @@ -0,0 +1,44 @@ +Dependencies: liburcu (Userspace RCU) is required at runtime. + +`pkg-config', GNU make, and standard Perl build tools are also required. + + FreeBSD: pkg install pkg-config liburcu +Debian-based systems: apt-get install pkg-config liburcu-dev + + +Newer versions of xxhash can unlock a small bit of performance: + + pkg install xxhash + apt-get install libxxhash-dev + + +If using mwrap-rproxy, Plack is also required: + + pkg install p5-Plack p5-Plack-Middleware-Deflater + apt-get install libplack-perl libplack-middleware-deflater-perl + +symlink-install +--------------- + +For users who lack permissions and/or wish to minimize their +installation footprint, the "symlink-install" target is available. +The following commands installs symlinks to $HOME/bin +pointing to the source tree: + + perl Makefile.PL + make symlink-install prefix=$HOME + +standard MakeMaker installation (Perl) +-------------------------------------- + +To use MakeMaker, you need to ensure ExtUtils::MakeMaker is available. +This is typically installed with Perl, but RPM-based systems will likely +need to install the `perl-ExtUtils-MakeMaker' package. + +Once the dependencies are installed, you should be able to build and +install the system (into /usr/local) with: + + perl Makefile.PL + make + make check + make install # root permissions may be needed diff --git a/MANIFEST b/MANIFEST index 4e3c487..096cec9 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,5 +1,6 @@ .gitignore COPYING +INSTALL MANIFEST Makefile.PL Mwrap.xs @@ -7,6 +8,7 @@ README check.h dlmalloc_c.h examples/mwrap.psgi +exe.sh gcc.h httpd.h jhash.h diff --git a/Makefile.PL b/Makefile.PL index e7e24cf..f953d51 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -123,5 +123,17 @@ pure_all :: build.env check:: all check-manifest prove -bvw -j\$(N) + +# Install symlinks to ~/bin (which is hopefuly in PATH) which point to +# this source tree. +# prefix + bindir matches git.git Makefile: +prefix = \$(HOME) +bindir = \$(prefix)/bin +symlink-install : all + mkdir -p \$(bindir) + exe=\$\$(realpath exe.sh) && cd \$(bindir) && \\ + for x in \$(EXE_FILES); do \\ + ln -sf "\$\$exe" \$\$(basename "\$\$x"); \\ + done EOF } diff --git a/README b/README index e7375b0..ba95d47 100644 --- a/README +++ b/README @@ -19,15 +19,15 @@ require rebuilding Perl. Tested on the `perl' package distributed with: -* Debian GNU/Linux 10 +* Debian GNU/Linux 10 and 11 -It may work on FreeBSD, NetBSD, OpenBSD and DragonFly BSD. +* FreeBSD 12.x -== Install +It may work on NetBSD, OpenBSD and DragonFly BSD. - # FreeBSD: pkg install pkg-config liburcu +== Install - # Debian-based systems: apt-get install pkg-config liburcu-dev +See `INSTALL' document == Usage diff --git a/exe.sh b/exe.sh new file mode 100755 index 0000000..c3ee2d3 --- /dev/null +++ b/exe.sh @@ -0,0 +1,8 @@ +#!/bin/sh -e +# symlink this file to a directory in PATH to run 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=$(dirname "$p") c=$(basename "$0") # both are POSIX +exec ${PERL-perl} -w -I"$p"/blib/lib -I"$p"/blib/arch \ + "$p"/script/"${c%.sh}" "$@" +: this script is too short to copyright -- cgit v1.2.3-24-ge0c7