afio: head and test added

Closes Homebrew/homebrew#44702.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
This commit is contained in:
Baptiste Fontaine 2015-10-07 10:43:31 +02:00
parent d6062f5e48
commit 5ed87b8354

View file

@ -3,6 +3,7 @@ class Afio < Formula
homepage "http://members.chello.nl/~k.holtman/afio.html"
url "http://members.chello.nl/~k.holtman/afio-2.5.1.tgz"
sha256 "363457a5d6ee422d9b704ef56d26369ca5ee671d7209cfe799cab6e30bf2b99a"
head "https://github.com/kholtman/afio.git"
bottle do
cellar :any
@ -11,12 +12,14 @@ class Afio < Formula
sha1 "68ecadc2fc7e8dd268ac9e6a63fc12927d60f897" => :lion
end
# Note - The Freecode website is being no longer being updated and alternative links should be found from now on.
# Note - The Freecode website is no longer being updated and alternative
# links should be found from now on.
option "bzip2", "Use bzip2(1) instead of gzip(1) for compression/decompression"
option "with-bzip2", "Use bzip2(1) instead of gzip(1) for compression/decompression"
deprecated_option "bzip2" => "with-bzip2"
def install
if build.include? "bzip2"
if build.with? "bzip2"
inreplace "Makefile", "-DPRG_COMPRESS='\"gzip\"'", "-DPRG_COMPRESS='\"bzip2\"'"
inreplace "afio.c", "with -o: gzip files", "with -o: bzip2 files"
inreplace "afio.1", "gzip", "bzip2"
@ -27,8 +30,21 @@ class Afio < Formula
bin.install "afio"
man1.install "afio.1"
prefix.install "ANNOUNCE-#{version}" => "ANNOUNCE"
prefix.install %w[HISTORY INSTALLATION README SCRIPTS]
prefix.install "ANNOUNCE-2.5.1" => "ANNOUNCE"
prefix.install %w[INSTALLATION SCRIPTS]
share.install Dir["script*"]
end
test do
path = testpath/"test"
path.write "homebrew"
pipe_output("#{bin}/afio -o archive", "test\n")
system "#{bin}/afio", "-r", "archive"
path.unlink
system "#{bin}/afio", "-t", "archive"
system "#{bin}/afio", "-i", "archive"
assert_equal "homebrew", path.read.chomp
end
end