tinyproxy: fix var/etc placement
Closes Homebrew/homebrew#39748. Closes Homebrew/homebrew#39772. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
f484d07386
commit
61b3f63e66
1 changed files with 31 additions and 9 deletions
|
@ -1,9 +1,7 @@
|
|||
require 'formula'
|
||||
|
||||
class Tinyproxy < Formula
|
||||
homepage "https://www.banu.com/tinyproxy/"
|
||||
url "https://www.banu.com/pub/tinyproxy/1.8/tinyproxy-1.8.3.tar.bz2"
|
||||
sha1 "2538fbd190d3dc357a2e7c2a07ea0fbefb768a13"
|
||||
sha256 "be559b54eb4772a703ad35239d1cb59d32f7cf8a739966742622d57df88b896e"
|
||||
|
||||
bottle do
|
||||
sha1 "edf8eed5ce1ae02bdd09cefba5d3700b6d34c9c9" => :mavericks
|
||||
|
@ -11,36 +9,60 @@ class Tinyproxy < Formula
|
|||
sha1 "566f27174a811803b447822407dc33f26d306219" => :lion
|
||||
end
|
||||
|
||||
option "reverse", "Enable reverse proxying"
|
||||
depends_on "asciidoc" => :build
|
||||
|
||||
option "with-reverse", "Enable reverse proxying"
|
||||
option "with-transparent", "Enable transparent proxying"
|
||||
|
||||
depends_on "asciidoc" => :build
|
||||
deprecated_option "reverse" => "with-reverse"
|
||||
|
||||
# Fix linking error, via MacPorts: https://trac.macports.org/ticket/27762
|
||||
patch :p0 do
|
||||
url "https://trac.macports.org/export/83413/trunk/dports/net/tinyproxy/files/patch-configure.diff"
|
||||
sha1 "e946269b681f3ffaa1acd120c93050cb63bfe743"
|
||||
sha256 "414b8ae7d0944fb8d90bef708864c4634ce1576c5f89dd79539bce1f630c9c8d"
|
||||
end
|
||||
|
||||
def install
|
||||
args = %W[
|
||||
--disable-debug
|
||||
--disable-dependency-tracking
|
||||
--disable-silent-rules
|
||||
--prefix=#{prefix}
|
||||
--localstatedir=#{var}
|
||||
--sysconfdir=#{etc}
|
||||
--disable-regexcheck
|
||||
]
|
||||
|
||||
args << "--enable-reverse" if build.include? "reverse"
|
||||
args << "--enable-reverse" if build.with? "reverse"
|
||||
args << "--enable-transparent" if build.with? "transparent"
|
||||
|
||||
system "./configure", *args
|
||||
|
||||
# Fix broken XML lint
|
||||
# See: http://www.freebsd.org/cgi/query-pr.cgi?pr=154624
|
||||
# See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=154624
|
||||
inreplace ["docs/man5/Makefile", "docs/man8/Makefile"] do |s|
|
||||
s.gsub! "-f manpage", "-f manpage \\\n -L"
|
||||
end
|
||||
|
||||
system "make install"
|
||||
system "make", "install"
|
||||
end
|
||||
|
||||
def post_install
|
||||
(var/"log/tinyproxy").mkpath
|
||||
(var/"run/tinyproxy").mkpath
|
||||
end
|
||||
|
||||
test do
|
||||
pid = fork do
|
||||
exec "#{sbin}/tinyproxy"
|
||||
end
|
||||
sleep 2
|
||||
|
||||
begin
|
||||
assert_match /tinyproxy/, shell_output("curl localhost:8888")
|
||||
ensure
|
||||
Process.kill("SIGINT", pid)
|
||||
Process.wait(pid)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue