2010-07-03 12:17:36 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Docbook < Formula
|
2010-07-03 12:17:36 +00:00
|
|
|
homepage 'http://docbook.sourceforge.net/'
|
2012-02-15 05:57:56 +00:00
|
|
|
url 'http://www.docbook.org/xml/5.0/docbook-5.0.zip'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 '49f274e67efdee771300cba4da1f3e4bc00be1ec'
|
2010-07-03 12:17:36 +00:00
|
|
|
|
2014-02-24 15:11:23 +00:00
|
|
|
bottle do
|
2014-10-21 20:14:11 +00:00
|
|
|
revision 1
|
|
|
|
sha1 "b6666858a43379c827ba9a62df987bcbcfffc6f3" => :yosemite
|
|
|
|
sha1 "ac3a230baa6c7a2d9accada9d956a566f3520151" => :mavericks
|
|
|
|
sha1 "8cbf8d315805395f2ca483161daa2c8bc3c4e19c" => :mountain_lion
|
2014-02-24 15:11:23 +00:00
|
|
|
end
|
|
|
|
|
2013-09-18 02:25:42 +00:00
|
|
|
resource 'xml412' do
|
|
|
|
url 'http://www.docbook.org/xml/4.1.2/docbkx412.zip'
|
|
|
|
sha1 'b9ae7a41056bfaf885581812d60651b7b5531519'
|
|
|
|
version '4.1.2'
|
|
|
|
end
|
|
|
|
|
|
|
|
resource 'xml42' do
|
|
|
|
url 'http://www.docbook.org/xml/4.2/docbook-xml-4.2.zip'
|
|
|
|
sha1 '5e3a35663cd028c5c5fbb959c3858fec2d7f8b9e'
|
|
|
|
end
|
|
|
|
|
|
|
|
resource 'xml43' do
|
|
|
|
url 'http://www.docbook.org/xml/4.3/docbook-xml-4.3.zip'
|
|
|
|
sha1 'e79a59e9164c1013b8cc9f64f96f909a184ca016'
|
|
|
|
end
|
|
|
|
|
|
|
|
resource 'xml44' do
|
|
|
|
url 'http://www.docbook.org/xml/4.4/docbook-xml-4.4.zip'
|
|
|
|
sha1 '7c4d91c82ad3747e1b5600c91782758e5d91c22b'
|
|
|
|
end
|
|
|
|
|
|
|
|
resource 'xml45' do
|
|
|
|
url 'http://www.docbook.org/xml/4.5/docbook-xml-4.5.zip'
|
|
|
|
sha1 'b9124233b50668fb508773aa2b3ebc631d7c1620'
|
|
|
|
end
|
|
|
|
|
|
|
|
resource 'xml50' do
|
|
|
|
url 'http://www.docbook.org/xml/5.0/docbook-5.0.zip'
|
|
|
|
sha1 '49f274e67efdee771300cba4da1f3e4bc00be1ec'
|
|
|
|
end
|
2012-02-15 05:57:56 +00:00
|
|
|
|
2013-09-18 02:25:42 +00:00
|
|
|
def install
|
2012-12-24 18:52:08 +00:00
|
|
|
(etc/'xml').mkpath
|
2012-02-15 05:57:56 +00:00
|
|
|
system "xmlcatalog", "--noout", "--create", "#{etc}/xml/catalog"
|
|
|
|
|
2013-09-18 02:25:42 +00:00
|
|
|
%w{42 412 43 44 45 50}.each do |version|
|
|
|
|
resource("xml#{version}").stage do |r|
|
|
|
|
if version == "412"
|
|
|
|
cp prefix/'docbook/xml/4.2/catalog.xml', 'catalog.xml'
|
|
|
|
|
|
|
|
inreplace 'catalog.xml' do |s|
|
|
|
|
s.gsub! 'V4.2 ..', 'V4.1.2 '
|
|
|
|
s.gsub! '4.2', '4.1.2'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
rm_rf 'docs'
|
|
|
|
(prefix/'docbook/xml'/r.version).install Dir['*']
|
|
|
|
|
|
|
|
catalog = prefix/"docbook/xml/#{r.version}/catalog.xml"
|
|
|
|
|
2012-02-15 05:57:56 +00:00
|
|
|
system "xmlcatalog", "--noout", "--del",
|
|
|
|
"file://#{catalog}", "#{etc}/xml/catalog"
|
|
|
|
system "xmlcatalog", "--noout", "--add", "nextCatalog",
|
|
|
|
"", "file://#{catalog}", "#{etc}/xml/catalog"
|
|
|
|
end
|
2010-07-03 12:17:36 +00:00
|
|
|
end
|
|
|
|
end
|
2010-04-07 05:58:35 +00:00
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
2012-02-15 05:57:56 +00:00
|
|
|
To use the DocBook package in your XML toolchain,
|
|
|
|
you need to add the following to your ~/.bashrc:
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2012-02-15 05:57:56 +00:00
|
|
|
export XML_CATALOG_FILES="#{etc}/xml/catalog"
|
2010-04-07 05:58:35 +00:00
|
|
|
EOS
|
|
|
|
end
|
2010-07-03 12:17:36 +00:00
|
|
|
end
|