aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXu Cheng2015-03-21 15:49:47 +0800
committerXu Cheng2015-03-21 18:20:57 +0800
commit421c51aaaa9d1950f69e0bd1427292e52d4c1468 (patch)
treee839a21433b87bec22f4bd0ebe49e70a3d0719ac
parent0ee87462e4eee9e21e64bdf08759aa560bb67cfd (diff)
downloadhomebrew-421c51aaaa9d1950f69e0bd1427292e52d4c1468.tar.bz2
ps2eps: add test and fix install
Closes #37561. Signed-off-by: Xu Cheng <xucheng@me.com>
-rw-r--r--Library/Formula/ps2eps.rb27
1 files changed, 17 insertions, 10 deletions
diff --git a/Library/Formula/ps2eps.rb b/Library/Formula/ps2eps.rb
index f2c513f31..e7262492e 100644
--- a/Library/Formula/ps2eps.rb
+++ b/Library/Formula/ps2eps.rb
@@ -1,18 +1,25 @@
-require 'formula'
-
class Ps2eps < Formula
- homepage 'http://www.tm.uka.de/~bless/ps2eps'
- url 'http://www.tm.uka.de/~bless/ps2eps-1.68.tar.gz'
- sha1 '253b949b70e73beb68760aafc5a20357db17371a'
-
- depends_on 'ghostscript'
+ homepage "https://www.tm.uka.de/~bless/ps2eps"
+ url "https://www.tm.uka.de/~bless/ps2eps-1.68.tar.gz"
+ sha256 "b08f12eed88965d1891261fb70e87c7e3a3f3172ebc31bdb7994a7ce854dd925"
- skip_clean 'bin' # Don't strip +x on ps2eps
+ depends_on "ghostscript"
def install
- system "#{ENV.cc} #{ENV.cflags} src/C/bbox.c -o bbox"
- bin.install "bin/ps2eps", "bbox"
+ system ENV.cc, "src/C/bbox.c", "-o", "bbox"
+ bin.install "bbox"
+ (libexec/"bin").install "bin/ps2eps"
+ (bin/"ps2eps").write <<-EOS.undent
+ #!/bin/sh
+ perl -S #{libexec}/bin/ps2eps $*
+ EOS
share.install "doc/man"
doc.install "doc/pdf", "doc/html"
end
+
+ test do
+ cp test_fixtures("test.ps"), testpath/"test.ps"
+ system bin/"ps2eps", testpath/"test.ps"
+ assert (testpath/"test.eps").exist?
+ end
end