2011-02-23 18:51:26 +00:00
|
|
|
class Gengetopt < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Generate C code to parse command-line arguments via getopt_long"
|
2015-03-28 21:23:36 +00:00
|
|
|
homepage "https://www.gnu.org/software/gengetopt/"
|
|
|
|
url "http://ftpmirror.gnu.org/gengetopt/gengetopt-2.22.6.tar.gz"
|
|
|
|
mirror "https://ftp.gnu.org/gnu/gengetopt/gengetopt-2.22.6.tar.gz"
|
|
|
|
sha256 "30b05a88604d71ef2a42a2ef26cd26df242b41f5b011ad03083143a31d9b01f7"
|
2011-02-23 18:51:26 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--mandir=#{man}"
|
2011-09-29 02:37:56 +00:00
|
|
|
|
|
|
|
ENV.deparallelize
|
2015-03-28 21:23:36 +00:00
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
ggo = <<-EOS.undent
|
|
|
|
package "homebrew"
|
|
|
|
version "0.9.5"
|
|
|
|
purpose "The missing package manager for OS X"
|
|
|
|
|
|
|
|
option "verbose" v "be verbose"
|
|
|
|
EOS
|
|
|
|
|
|
|
|
pipe_output("#{bin}/gengetopt --file-name=test", ggo, 0)
|
|
|
|
assert File.exist? "test.h"
|
|
|
|
assert File.exist? "test.c"
|
|
|
|
assert_match(/verbose_given/, File.read("test.h"))
|
2011-02-23 18:51:26 +00:00
|
|
|
end
|
|
|
|
end
|