From 5495b7d07707996e89d3f36bc01988d72ef835d2 Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Sun, 2 Nov 2014 23:56:36 +0000 Subject: aescrypt-packetizer 3.0.9 (new formula) Closes #32846. --- Library/Formula/aescrypt-packetizer.rb | 64 ++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Library/Formula/aescrypt-packetizer.rb (limited to 'Library/Formula') diff --git a/Library/Formula/aescrypt-packetizer.rb b/Library/Formula/aescrypt-packetizer.rb new file mode 100644 index 000000000..2b96bdc60 --- /dev/null +++ b/Library/Formula/aescrypt-packetizer.rb @@ -0,0 +1,64 @@ +require "formula" + +class AescryptPacketizer < Formula + homepage "https://www.aescrypt.com" + url "https://www.aescrypt.com/download/v3/linux/aescrypt-3.0.9.tgz" + sha256 "3f3590f9b7e50039611ba9c0cf1cae1b188a44bd39cfc41553db7ec5709c0882" + + head do + url "https://github.com/paulej/AESCrypt.git" + + depends_on "automake" => :build + depends_on "autoconf" => :build + depends_on "libtool" => :build + end + + depends_on :xcode => :build + + option "with-default-names", "Build with the binaries named as expected upstream" + + def install + if build.head? + cd "linux" + system "autoreconf", "-ivf" + system "./configure", "prefix=#{prefix}", "--enable-iconv", + "--disable-gui" + system "make", "install" + end + + if build.stable? + cd "src" + # https://www.aescrypt.com/mac_aes_crypt.html + inreplace "Makefile", "#LIBS=-liconv", "LIBS=-liconv" + system "make", "prefix=#{prefix}" + + bin.install "aescrypt" + bin.install "aescrypt_keygen" + end + + # To prevent conflict with our other aescrypt, rename the binaries. + if build.without? "default-names" + mv "#{bin}/aescrypt", "#{bin}/paescrypt" + mv "#{bin}/aescrypt_keygen", "#{bin}/paescrypt_keygen" + end + end + + def caveats; <<-EOS.undent + To avoid conflicting with our other AESCrypt package the binaries + have been renamed paescrypt and paescrypt_keygen, unless you chose + to exercise the default-names option. + EOS + end + + test do + path = testpath/"secret.txt" + original_contents = "What grows when it eats, but dies when it drinks?" + path.write original_contents + + system bin/"paescrypt", "-e", "-p", "fire", path + assert File.exist?("#{path}.aes") + + system bin/"paescrypt", "-d", "-p", "fire", "#{path}.aes" + assert_equal original_contents, path.read + end +end -- cgit v1.2.3