diff --git a/Formula/mfterm.rb b/Formula/mfterm.rb new file mode 100644 index 0000000000..58588da3f7 --- /dev/null +++ b/Formula/mfterm.rb @@ -0,0 +1,33 @@ +class Mfterm < Formula + desc "Terminal for working with Mifare Classic 1-4k Tags" + homepage "https://github.com/4ZM/mfterm" + url "https://github.com/4ZM/mfterm/releases/download/v1.0.7/mfterm-1.0.7.tar.gz" + sha256 "b6bb74a7ec1f12314dee42973eb5f458055b66b1b41316ae0c5380292b86b248" + + head do + url "https://github.com/4ZM/mfterm.git" + + depends_on "autoconf" => :build + depends_on "automake" => :build + end + + depends_on "libnfc" + depends_on "libusb" + depends_on "openssl" + + def install + ENV.prepend "CPPFLAGS", "-I#{Formula["openssl"].opt_include}" + ENV.prepend "LDFLAGS", "-L#{Formula["openssl"].opt_lib}" + + if build.head? + chmod 0755, "./autogen.sh" + system "./autogen.sh" + end + system "./configure", "--prefix=#{prefix}", "--disable-dependency-tracking" + system "make", "install" + end + + test do + system "#{bin}/mfterm", "--version" + end +end