2011-03-10 05:11:03 +00:00
|
|
|
class Botan < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Cryptographic algorithms and formats library in C++"
|
2016-04-17 19:45:00 +00:00
|
|
|
homepage "https://botan.randombit.net/"
|
2015-08-07 19:59:08 +00:00
|
|
|
|
|
|
|
stable do
|
2016-09-06 02:48:37 +00:00
|
|
|
url "https://botan.randombit.net/releases/Botan-1.10.13.tgz"
|
|
|
|
sha256 "23ec973d4b4a4fe04f490d409e08ac5638afe3aa09acd7f520daaff38ba19b90"
|
|
|
|
|
2015-08-07 19:59:08 +00:00
|
|
|
# upstream ticket: https://bugs.randombit.net/show_bug.cgi?id=267
|
|
|
|
patch :DATA
|
|
|
|
end
|
2010-02-12 19:14:45 +00:00
|
|
|
|
2014-10-19 11:42:59 +00:00
|
|
|
bottle do
|
2015-08-08 17:29:53 +00:00
|
|
|
cellar :any
|
2016-09-28 04:41:37 +00:00
|
|
|
sha256 "b04c99b1028e05ee50e28faa590caa40b0cd3d1603fec0da3e61fb64419b39d6" => :sierra
|
2016-09-07 01:33:01 +00:00
|
|
|
sha256 "21599053348caae11ed972522334247733ea85776ca5c8d309bcf1aea39d28fa" => :el_capitan
|
|
|
|
sha256 "70592ff415e7e30c7a50c2aa46a8b4a0357150c5f98fb1fa11bba5ea48ee978b" => :yosemite
|
|
|
|
sha256 "da4e989fedc710e3e65cb6ec387b9fd865740cc1878f660f371522ba255b307f" => :mavericks
|
2014-10-19 11:42:59 +00:00
|
|
|
end
|
|
|
|
|
2015-08-07 19:59:08 +00:00
|
|
|
devel do
|
2016-09-06 02:48:37 +00:00
|
|
|
url "https://botan.randombit.net/releases/Botan-1.11.31.tgz"
|
|
|
|
sha256 "0e751c9182c84f961e90be51f086b1ec254155c3d056cbb37eebff5f5e39ddee"
|
2015-08-07 19:59:08 +00:00
|
|
|
end
|
|
|
|
|
2015-02-04 20:26:18 +00:00
|
|
|
option "with-debug", "Enable debug build of Botan"
|
|
|
|
|
|
|
|
deprecated_option "enable-debug" => "with-debug"
|
2014-10-17 21:36:39 +00:00
|
|
|
|
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
depends_on "openssl"
|
2012-02-15 05:25:01 +00:00
|
|
|
|
2015-08-07 19:59:08 +00:00
|
|
|
needs :cxx11 if build.devel?
|
2014-02-16 03:06:52 +00:00
|
|
|
|
2010-02-12 19:14:45 +00:00
|
|
|
def install
|
2015-08-07 19:59:08 +00:00
|
|
|
ENV.cxx11 if build.devel?
|
|
|
|
|
2013-11-05 05:17:18 +00:00
|
|
|
args = %W[
|
|
|
|
--prefix=#{prefix}
|
2014-11-16 13:41:15 +00:00
|
|
|
--docdir=share/doc
|
2013-11-05 05:17:18 +00:00
|
|
|
--cpu=#{MacOS.preferred_arch}
|
|
|
|
--cc=#{ENV.compiler}
|
|
|
|
--os=darwin
|
|
|
|
--with-openssl
|
|
|
|
--with-zlib
|
|
|
|
--with-bzip2
|
|
|
|
]
|
|
|
|
|
2015-02-04 20:26:18 +00:00
|
|
|
args << "--enable-debug" if build.with? "debug"
|
2011-09-02 20:44:15 +00:00
|
|
|
|
|
|
|
system "./configure.py", *args
|
2012-06-25 10:41:47 +00:00
|
|
|
# A hack to force them use our CFLAGS. MACH_OPT is empty in the Makefile
|
|
|
|
# but used for each call to cc/ld.
|
|
|
|
system "make", "install", "MACH_OPT=#{ENV.cflags}"
|
2010-02-12 19:14:45 +00:00
|
|
|
end
|
2015-02-04 20:26:18 +00:00
|
|
|
|
|
|
|
test do
|
2015-08-07 19:59:08 +00:00
|
|
|
# stable version doesn't have `botan` executable
|
2016-09-06 02:48:37 +00:00
|
|
|
if stable?
|
2015-08-07 19:59:08 +00:00
|
|
|
assert_match "lcrypto", shell_output("#{bin}/botan-config-1.10 --libs")
|
|
|
|
else
|
2016-09-06 02:48:37 +00:00
|
|
|
(testpath/"test.txt").write "Homebrew"
|
|
|
|
(testpath/"testout.txt").write Utils.popen_read("#{bin}/botan base64_enc test.txt")
|
|
|
|
assert_match "Homebrew", shell_output("#{bin}/botan base64_dec testout.txt")
|
2015-08-07 19:59:08 +00:00
|
|
|
end
|
2015-02-04 20:26:18 +00:00
|
|
|
end
|
2010-02-12 19:14:45 +00:00
|
|
|
end
|
2014-02-16 03:06:52 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
--- a/src/build-data/makefile/unix_shr.in
|
|
|
|
+++ b/src/build-data/makefile/unix_shr.in
|
|
|
|
@@ -57,8 +57,8 @@
|
|
|
|
LIBNAME = %{lib_prefix}libbotan
|
|
|
|
STATIC_LIB = $(LIBNAME)-$(SERIES).a
|
|
|
|
|
|
|
|
-SONAME = $(LIBNAME)-$(SERIES).%{so_suffix}.%{so_abi_rev}
|
|
|
|
-SHARED_LIB = $(SONAME).%{version_patch}
|
|
|
|
+SONAME = $(LIBNAME)-$(SERIES).%{so_abi_rev}.%{so_suffix}
|
|
|
|
+SHARED_LIB = $(LIBNAME)-$(SERIES).%{so_abi_rev}.%{version_patch}.%{so_suffix}
|
|
|
|
|
|
|
|
SYMLINK = $(LIBNAME)-$(SERIES).%{so_suffix}
|