jbigkit 2.1

Closes Homebrew/homebrew#39152.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Alex Dunn 2015-04-28 11:15:34 -07:00 committed by Mike McQuaid
parent 581c77619d
commit 56c4a64312

View file

@ -1,12 +1,14 @@
require 'formula'
class Jbigkit < Formula
homepage 'http://www.cl.cam.ac.uk/~mgk25/jbigkit/'
url 'http://www.cl.cam.ac.uk/~mgk25/download/jbigkit-2.0.tar.gz'
sha1 'cfb7d3121f02a74bfb229217858a0d149b6589ef'
homepage "https://www.cl.cam.ac.uk/~mgk25/jbigkit/"
url "https://www.cl.cam.ac.uk/~mgk25/jbigkit/download/jbigkit-2.1.tar.gz"
mirror "https://mirrors.kernel.org/debian/pool/main/j/jbigkit/jbigkit_2.1.orig.tar.gz"
sha256 "de7106b6bfaf495d6865c7dd7ac6ca1381bd12e0d81405ea81e7f2167263d932"
head "https://www.cl.cam.ac.uk/~mgk25/git/jbigkit",
:using => :git
option :universal
option 'with-check', "Verify the library during install"
option "with-check", "Verify the library during install"
def install
# Set for a universal build and patch the Makefile.
@ -14,26 +16,27 @@ class Jbigkit < Formula
ENV.universal_binary if build.universal?
system "make", "CC=#{ENV.cc}", "CCFLAGS=#{ENV.cflags}"
# It needs j1 to make the tests happen in sequence.
ENV.deparallelize
system "make test" if build.with? "check"
if build.with? "check"
# It needs j1 to make the tests happen in sequence.
ENV.deparallelize
system "make", "test"
end
# Install the files using three common styles of syntax:
prefix.install %w[contrib examples]
cd 'pbmtools' do
bin.install %w(pbmtojbg jbgtopbm pbmtojbg85 jbgtopbm85)
man1.install %w(pbmtojbg.1 jbgtopbm.1)
man5.install %w(pbm.5 pgm.5)
cd "pbmtools" do
bin.install %w[pbmtojbg jbgtopbm pbmtojbg85 jbgtopbm85]
man1.install %w[pbmtojbg.1 jbgtopbm.1]
man5.install %w[pbm.5 pgm.5]
end
cd 'libjbig' do
lib.install Dir['lib*.a']
(prefix+'src').install Dir['j*.c', 'j*.txt']
include.install Dir['j*.h']
cd "libjbig" do
lib.install Dir["lib*.a"]
(prefix/"src").install Dir["j*.c", "j*.txt"]
include.install Dir["j*.h"]
end
(share/"jbigkit").install "examples", "contrib"
end
test do
system "#{bin}/jbgtopbm #{prefix}/examples/ccitt7.jbg | #{bin}/pbmtojbg - testoutput.jbg"
system "/usr/bin/cmp", "#{prefix}/examples/ccitt7.jbg", "testoutput.jbg"
system "#{bin}/jbgtopbm #{share}/jbigkit/examples/ccitt7.jbg | #{bin}/pbmtojbg - testoutput.jbg"
system "/usr/bin/cmp", share/"jbigkit/examples/ccitt7.jbg", "testoutput.jbg"
end
end