Skip to content

Commit

Permalink
amap: fix openssl build
Browse files Browse the repository at this point in the history
Also: Install required files in etc, add linking/version tests.

Closes #4545.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
  • Loading branch information
DomT4 committed Sep 7, 2016
1 parent 8640fc2 commit d0b9c61
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Formula/amap.rb
Expand Up @@ -3,7 +3,7 @@ class Amap < Formula
homepage "https://www.thc.org/thc-amap/"
url "https://www.thc.org/releases/amap-5.4.tar.gz"
sha256 "a75ea58de75034de6b10b0de0065ec88e32f9e9af11c7d69edbffc4da9a5b059"
revision 1
revision 2

bottle do
cellar :any
Expand All @@ -16,11 +16,28 @@ class Amap < Formula
depends_on "openssl"

def install
# Last release was 2011 & there's nowhere supported to report this.
openssl = Formula["openssl"]
inreplace "configure" do |s|
s.gsub! 'SSL_IPATH=""', "SSL_IPATH=\"#{openssl.opt_include}/openssl\""
s.gsub! 'SSL_PATH=""', "SSL_PATH=\"#{openssl.opt_lib}\""
s.gsub! 'CRYPTO_PATH=""', "CRYPTO_PATH=\"#{openssl.opt_lib}\""
end

system "./configure", "--prefix=#{prefix}"
system "make"

# --prefix doesn't work as we want it to so install manually
bin.install "amap", "amap6", "amapcrap"
etc.install "appdefs.resp", "appdefs.rpc", "appdefs.trig"
man1.install "amap.1"
end

test do
output = shell_output("otool -L #{bin}/amap")
assert_match Formula["openssl"].opt_lib.to_s, output
# We can do more than this, but unsure how polite it is to port-scan
# someone's domain every time this goes through CI.
assert_match version.to_s, shell_output("#{bin}/amap", 255)
end
end

0 comments on commit d0b9c61

Please sign in to comment.