mwrap (Perl version) user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: mwrap-perl@80x24.org
Subject: [PATCH 2/3] support symlink install
Date: Fri, 16 Dec 2022 14:39:32 +0000	[thread overview]
Message-ID: <20221216143933.22430-3-e@80x24.org> (raw)
In-Reply-To: <20221216143933.22430-1-e@80x24.org>

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

  parent reply	other threads:[~2022-12-16 14:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16 14:39 [PATCH 0/3] fleshing out some things Eric Wong
2022-12-16 14:39 ` [PATCH 1/3] support changing bt_req_depth dynamically Eric Wong
2022-12-16 14:39 ` Eric Wong [this message]
2022-12-16 14:39 ` [PATCH 3/3] various documentation updates Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221216143933.22430-3-e@80x24.org \
    --to=e@80x24.org \
    --cc=mwrap-perl@80x24.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mwrap-perl.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).