From 75a5a43daa18f65a4a4db5ef98a26a031aeedd78 Mon Sep 17 00:00:00 2001 From: "George D. Plymale II" Date: Tue, 19 Dec 2017 18:27:23 -0500 Subject: [PATCH] tnftp 20070806 (new formula) create lukemftp alias --- Aliases/lukemftp | 1 + Formula/tnftp.rb | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 120000 Aliases/lukemftp create mode 100644 Formula/tnftp.rb diff --git a/Aliases/lukemftp b/Aliases/lukemftp new file mode 120000 index 0000000000..a764d2f0f4 --- /dev/null +++ b/Aliases/lukemftp @@ -0,0 +1 @@ +../Formula/tnftp.rb \ No newline at end of file diff --git a/Formula/tnftp.rb b/Formula/tnftp.rb new file mode 100644 index 0000000000..66b8e340d0 --- /dev/null +++ b/Formula/tnftp.rb @@ -0,0 +1,44 @@ +class Tnftp < Formula + desc "NetBSD's FTP client (built from macOS Sierra sources)" + homepage "https://opensource.apple.com/" + url "https://opensource.apple.com/tarballs/lukemftp/lukemftp-16.tar.gz" + version "20070806" + sha256 "ba35a8e3c2e524e5772e729f592ac0978f9027da2433753736e1eb1f1351ae9d" + + keg_only :provided_pre_high_sierra + + depends_on :xcode => :build + + conflicts_with "inetutils", :because => "both install `ftp' binaries" + + def install + # Trying to use Apple's pre-supplied Makefile resulted + # in headaches... they have made the build process + # specifically for installing to /usr/bin and so it + # just doesn't play well with homebrew. + + # so just build straight from ftp's own sources + # from the extracted 20070806 tarball which have + # already been patched + cd "tnftp" do + system "./configure" + system "make", "all" + system "strip", "-x", "src/ftp" # this is done in Apple's `post-install` target + + bin.install "src/ftp" + man1.install "src/ftp.1" + prefix.install_metafiles + end + end + + test do + require "pty" + require "expect" + + PTY.spawn "#{bin}/ftp ftp://anonymous:none@speedtest.tele2.net" do |input, output, _pid| + str = input.expect(/Connected to speedtest.tele2.net./) + output.puts "exit" + assert_match "Connected to speedtest.tele2.net.", str[0] + end + end +end