Skip to content

Commit

Permalink
tnftp 20070806 (new formula)
Browse files Browse the repository at this point in the history
create lukemftp alias
  • Loading branch information
George D. Plymale II authored and JCount committed Dec 20, 2017
1 parent c68aa1c commit 75a5a43
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions Aliases/lukemftp
44 changes: 44 additions & 0 deletions 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

0 comments on commit 75a5a43

Please sign in to comment.