2011-11-24 07:44:32 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Epubcheck < Formula
|
|
|
|
homepage 'http://code.google.com/p/epubcheck/'
|
2012-06-27 15:37:14 +00:00
|
|
|
url 'http://epubcheck.googlecode.com/files/epubcheck-1.2.zip'
|
2011-11-24 07:44:32 +00:00
|
|
|
sha1 '86036eadad8408070791b3da368958239ed8a410'
|
|
|
|
|
2012-07-26 19:45:29 +00:00
|
|
|
devel do
|
|
|
|
url 'http://epubcheck.googlecode.com/files/epubcheck-3.0b5.zip'
|
|
|
|
sha1 'd5f9d60733f587946fc853f561ca2f13e3b8f83d'
|
|
|
|
end
|
|
|
|
|
2011-11-24 07:44:32 +00:00
|
|
|
def install
|
2012-08-29 16:08:53 +00:00
|
|
|
if build.devel?
|
2012-07-26 19:45:29 +00:00
|
|
|
libexec.install "epubcheck-3.0b5.jar", "lib"
|
|
|
|
(bin/'epubcheck').write <<-EOS.undent
|
|
|
|
#!/bin/sh
|
|
|
|
java -jar "#{libexec}/epubcheck-3.0b5.jar" "$@"
|
|
|
|
EOS
|
|
|
|
else
|
|
|
|
libexec.install "epubcheck-1.2.jar", "lib"
|
|
|
|
(bin/'epubcheck').write <<-EOS.undent
|
|
|
|
#!/bin/sh
|
|
|
|
java -jar "#{libexec}/epubcheck-1.2.jar" "$@"
|
|
|
|
EOS
|
|
|
|
end
|
2011-11-24 07:44:32 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def test
|
|
|
|
puts <<-EOS.undent
|
|
|
|
To test epubcheck, find a epub file that doesn't have any errors and then:
|
|
|
|
epubcheck file.epub
|
|
|
|
|
|
|
|
The reply should look like:
|
2012-07-26 19:45:29 +00:00
|
|
|
Epubcheck Version 1.2 or 3.0b5
|
2011-11-24 07:44:32 +00:00
|
|
|
|
|
|
|
No errors or warnings detected
|
|
|
|
EOS
|
|
|
|
end
|
2012-08-29 16:08:53 +00:00
|
|
|
end
|