bibtex2html: modernize and add test
Closes Homebrew/homebrew#35935. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
1d06a94dcd
commit
4be6903596
1 changed files with 25 additions and 10 deletions
|
@ -1,9 +1,7 @@
|
||||||
require 'formula'
|
|
||||||
|
|
||||||
class Bibtex2html < Formula
|
class Bibtex2html < Formula
|
||||||
homepage 'http://www.lri.fr/~filliatr/bibtex2html/'
|
homepage "http://www.lri.fr/~filliatr/bibtex2html/"
|
||||||
url 'http://www.lri.fr/~filliatr/ftp/bibtex2html/bibtex2html-1.98.tar.gz'
|
url "http://www.lri.fr/~filliatr/ftp/bibtex2html/bibtex2html-1.98.tar.gz"
|
||||||
sha1 'daaa082885a30dae38263614565298d4862b8331'
|
sha1 "daaa082885a30dae38263614565298d4862b8331"
|
||||||
|
|
||||||
bottle do
|
bottle do
|
||||||
cellar :any
|
cellar :any
|
||||||
|
@ -12,17 +10,34 @@ class Bibtex2html < Formula
|
||||||
sha1 "32377bea1f584fedf5d2abb604a1d46e5e92ac5c" => :mountain_lion
|
sha1 "32377bea1f584fedf5d2abb604a1d46e5e92ac5c" => :mountain_lion
|
||||||
end
|
end
|
||||||
|
|
||||||
depends_on 'objective-caml'
|
depends_on "objective-caml"
|
||||||
depends_on 'hevea'
|
depends_on "hevea"
|
||||||
|
depends_on :tex => :optional
|
||||||
|
|
||||||
def install
|
def install
|
||||||
# See: https://trac.macports.org/ticket/26724
|
# See: https://trac.macports.org/ticket/26724
|
||||||
inreplace 'Makefile.in' do |s|
|
inreplace "Makefile.in" do |s|
|
||||||
s.remove_make_var! 'STRLIB'
|
s.remove_make_var! "STRLIB"
|
||||||
end
|
end
|
||||||
|
|
||||||
system "./configure", "--prefix=#{prefix}"
|
system "./configure", "--prefix=#{prefix}"
|
||||||
system "make"
|
system "make"
|
||||||
system "make install"
|
system "make", "install"
|
||||||
|
end
|
||||||
|
|
||||||
|
test do
|
||||||
|
(testpath/"test.bib").write <<-EOS.undent
|
||||||
|
@article{Homebrew,
|
||||||
|
title = {Something},
|
||||||
|
author = {Someone},
|
||||||
|
journal = {Something},
|
||||||
|
volume = {1},
|
||||||
|
number = {2},
|
||||||
|
pages = {3--4}
|
||||||
|
}
|
||||||
|
EOS
|
||||||
|
system "#{bin}/bib2bib", "test.bib", "--remove", "pages", "-ob", "out.bib"
|
||||||
|
assert_not_match /pages\s*=\s*{3--4}/, File.read("out.bib")
|
||||||
|
assert_match /pages\s*=\s*{3--4}/, File.read("test.bib")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue