diff --git a/Formula/cvs-fast-export.rb b/Formula/cvs-fast-export.rb new file mode 100644 index 00000000000..bc0b85c5919 --- /dev/null +++ b/Formula/cvs-fast-export.rb @@ -0,0 +1,33 @@ +class CvsFastExport < Formula + desc "Export an RCS or CVS history as a fast-import stream" + homepage "http://www.catb.org/~esr/cvs-fast-export/" + url "http://www.catb.org/~esr/cvs-fast-export/cvs-fast-export-1.55.tar.gz" + sha256 "af58e16667c6e02e8431ff666effe306d3b30086fab483170257890da1afc21b" + license "GPL-2.0-or-later" + + depends_on "asciidoc" => :build + depends_on "docbook-xsl" => :build + depends_on "cvs" => :test + + def install + ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog" + + system "make", "install", "prefix=#{prefix}" + end + + test do + cvsroot = testpath/"cvsroot" + cvsroot.mkpath + system "cvs", "-d", cvsroot, "init" + + test_content = "John Barleycorn" + + mkdir "cvsexample" do + (testpath/"cvsexample/testfile").write(test_content) + ENV["CVSROOT"] = cvsroot + system "cvs", "import", "-m", "example import", "cvsexample", "homebrew", "start" + end + + assert_match test_content, shell_output("find #{testpath}/cvsroot | #{bin}/cvs-fast-export") + end +end