From 3a59a317bdc961765707f9ffc5f2ca2c429b70f2 Mon Sep 17 00:00:00 2001 From: ilovezfs Date: Thu, 12 May 2016 08:16:51 -0700 Subject: [PATCH] sproxy: fix permissions error in `make install` - instead of using `share.install prefix+"man"`, tweak the Makefile directly so that it honors $(mandir) - fix sandbox violation by passing `PREFIX=$(prefix)` to `Makefile.PL`s ERROR: Can't create '/usr/local/share/man/man3' Do not have write permissions on '/usr/local/share/man/man3' Sandbox: perl5.18(39244) deny(1) file-write-create /usr/local/share/man/man3 - add a test Closes #1049. Signed-off-by: ilovezfs --- Formula/sproxy.rb | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Formula/sproxy.rb b/Formula/sproxy.rb index 9b0c3d0b5d..1274e9ae99 100644 --- a/Formula/sproxy.rb +++ b/Formula/sproxy.rb @@ -11,12 +11,31 @@ class Sproxy < Formula sha256 "344332d9ca503184f80ab8ea6505574316d4bd994070d86dc2ddc138b77e331e" => :mountain_lion end + # Only needed due to the change to "Makefile.am" + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + def install + # Prevents "ERROR: Can't create '/usr/local/share/man/man3'"; also fixes an + # audit violation triggered if the man page is installed in #{prefix}/man. + # After making the change below and running autoreconf, the default ends up + # being the same as #{man}, so there's no need for us to pass --mandir to + # configure, though, as a result of this change, that flag would be honored. + # Reported 10th May 2016 to https://www.joedog.org/support/ + inreplace "doc/Makefile.am", "$(prefix)/man", "$(mandir)" + inreplace "lib/Makefile.am", "Makefile.PL", "Makefile.PL PREFIX=$(prefix)" + + # Only needed due to the change to "Makefile.am" + system "autoreconf", "-fiv" + system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}" system "make" system "make", "install" - # Makefile doesn't honor mandir, so move manpages post-install - share.install prefix+"man" + end + + test do + assert_match "SPROXY v#{version}-", shell_output("#{bin}/sproxy -V") end end