From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 142D51F61C for ; Fri, 16 Dec 2022 14:39:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1671201574; bh=aTvZHuHdQZueMYl3u7tG1SCdmopIXGWMKmzuGoeVyfQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=u3/kQfDDaisSA4gO93l1HnfluUo84P763+5s2qysAhCS4DXmPCrIDekHfHtzctpGu ZyMHLwfj6uiNZQriY3kxz1An5/OPb5bI17jA+aqTEoxg7iBU8TwfnHKK8pebF6vyGd qaxJfa3NnGUyLW4Rvl10agOUcCGcsGIU+sYqmKcM= From: Eric Wong To: mwrap-perl@80x24.org Subject: [PATCH 2/3] support symlink install Date: Fri, 16 Dec 2022 14:39:32 +0000 Message-Id: <20221216143933.22430-3-e@80x24.org> In-Reply-To: <20221216143933.22430-1-e@80x24.org> References: <20221216143933.22430-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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