Merge pull request #207020 from Homebrew/bump-qpdf-11.10.0
[Homebrew/homebrew-core.git] / Formula / t / tofrodos.rb
blob190d9f609d1b7cf6811d4195eae7840afd96b659
1 class Tofrodos < Formula
2   desc "Converts DOS <-> UNIX text files, alias tofromdos"
3   homepage "https://www.thefreecountry.com/tofrodos/"
4   url "https://www.thefreecountry.com/tofrodos/tofrodos-1.8.3.zip"
5   sha256 "44d76fb024164982aa5e166c1a3c29fa7555c9e0ee8e196cc52595c57a4b55dc"
6   license "GPL-2.0-only"
8   livecheck do
9     url :homepage
10     regex(/href=.*?tofrodos[._-]v?(\d+(?:\.\d+)+)\.(?:t|zip)/i)
11   end
13   bottle do
14     sha256 cellar: :any_skip_relocation, arm64_sequoia: "4f5b16d880a34a9f8f8bcf3c3a5520affe8356fcf24854fd23e09b07ee1b2de8"
15     sha256 cellar: :any_skip_relocation, arm64_sonoma:  "55ad657b7068a6106e846311ca92abbbf94ed236d7c48b263a25eabc95acc434"
16     sha256 cellar: :any_skip_relocation, arm64_ventura: "ef7cc693cfb4c53110c3771bfd4c3843a314ad610417c4e47cf3af5ec4ef6d09"
17     sha256 cellar: :any_skip_relocation, sonoma:        "fbbecca042307e05f058ab8f8d95a97340cc7111114041581059f6815129f15b"
18     sha256 cellar: :any_skip_relocation, ventura:       "e4ea589dde1039b1732d7ada4b8f817b30d90aea37a3ece09c520316505688c3"
19     sha256 cellar: :any_skip_relocation, x86_64_linux:  "6883c12d2a042937a3e93beacc2350d65dcdc5c99230b8325ef022488552a14b"
20   end
22   def install
23     mkdir_p [bin, man1]
25     system "make", "-C", "src", "all"
26     system "make", "-C", "src", "BINDIR=#{bin}", "MANDIR=#{man1}", "install"
27   end
29   test do
30     (testpath/"test.txt").write <<~EOS
31       Example text
32     EOS
34     shell_output("#{bin}/todos -b #{testpath}/test.txt")
35     shell_output("#{bin}/fromdos #{testpath}/test.txt")
36     assert_equal (testpath/"test.txt").read, (testpath/"test.txt.bak").read
37   end
38 end