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
|
|
|
|
|
|
|
def install
|
2012-12-24 18:52:08 +00:00
|
|
|
# Install 4.1.2 *after* 4.2, because we need to borrow the catalog.xml
|
|
|
|
# file from the 4.2 package.
|
|
|
|
packages = [Docbookxml42,
|
|
|
|
Docbookxml412,
|
2012-02-15 05:57:56 +00:00
|
|
|
Docbookxml43,
|
|
|
|
Docbookxml44,
|
|
|
|
Docbookxml45,
|
|
|
|
Docbookxml50,
|
2012-08-08 20:24:18 +00:00
|
|
|
Docbookxsl,
|
|
|
|
Docbookxslns]
|
2012-02-15 05:57:56 +00:00
|
|
|
|
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"
|
|
|
|
|
2010-07-03 12:17:36 +00:00
|
|
|
packages.each do |pkg|
|
2012-02-15 05:57:56 +00:00
|
|
|
pkg.new.brew do |f|
|
|
|
|
f.install
|
2012-12-24 18:52:08 +00:00
|
|
|
catalog = prefix/f.catalog/'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
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Docbookxml < Formula
|
2010-07-03 12:17:36 +00:00
|
|
|
def install
|
|
|
|
rm_rf 'docs'
|
|
|
|
docbook = Formula.factory 'docbook'
|
2012-12-24 18:52:08 +00:00
|
|
|
(docbook.prefix/'docbook/xml'/version).install Dir['*']
|
2010-07-03 12:17:36 +00:00
|
|
|
end
|
2012-02-15 05:57:56 +00:00
|
|
|
|
2012-12-24 18:52:08 +00:00
|
|
|
def catalog
|
|
|
|
"docbook/xml/#{version}"
|
|
|
|
end
|
2010-07-03 12:17:36 +00:00
|
|
|
end
|
2012-02-15 05:57:56 +00:00
|
|
|
|
|
|
|
class Docbookxml412 < Docbookxml
|
2010-07-03 12:17:36 +00:00
|
|
|
url 'http://www.docbook.org/xml/4.1.2/docbkx412.zip'
|
2012-09-04 01:59:06 +00:00
|
|
|
sha1 'b9ae7a41056bfaf885581812d60651b7b5531519'
|
2010-07-03 12:17:36 +00:00
|
|
|
version '4.1.2'
|
2012-12-24 18:52:08 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
cp Formula.factory('docbook').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
|
|
|
|
|
|
|
|
super
|
|
|
|
end
|
2010-07-03 12:17:36 +00:00
|
|
|
end
|
2012-02-15 05:57:56 +00:00
|
|
|
|
|
|
|
class Docbookxml42 < Docbookxml
|
2010-07-03 12:17:36 +00:00
|
|
|
url 'http://www.docbook.org/xml/4.2/docbook-xml-4.2.zip'
|
2012-09-04 01:59:06 +00:00
|
|
|
sha1 '5e3a35663cd028c5c5fbb959c3858fec2d7f8b9e'
|
2010-07-03 12:17:36 +00:00
|
|
|
end
|
2012-02-15 05:57:56 +00:00
|
|
|
|
|
|
|
class Docbookxml43 < Docbookxml
|
2010-07-03 12:17:36 +00:00
|
|
|
url 'http://www.docbook.org/xml/4.3/docbook-xml-4.3.zip'
|
2012-09-04 01:59:06 +00:00
|
|
|
sha1 'e79a59e9164c1013b8cc9f64f96f909a184ca016'
|
2010-07-03 12:17:36 +00:00
|
|
|
end
|
2012-02-15 05:57:56 +00:00
|
|
|
|
|
|
|
class Docbookxml44 < Docbookxml
|
2010-07-03 12:17:36 +00:00
|
|
|
url 'http://www.docbook.org/xml/4.4/docbook-xml-4.4.zip'
|
2012-09-04 01:59:06 +00:00
|
|
|
sha1 '7c4d91c82ad3747e1b5600c91782758e5d91c22b'
|
2010-07-03 12:17:36 +00:00
|
|
|
end
|
2012-02-15 05:57:56 +00:00
|
|
|
|
|
|
|
class Docbookxml45 < Docbookxml
|
2010-07-03 12:17:36 +00:00
|
|
|
url 'http://www.docbook.org/xml/4.5/docbook-xml-4.5.zip'
|
2012-09-04 01:59:06 +00:00
|
|
|
sha1 'b9124233b50668fb508773aa2b3ebc631d7c1620'
|
2010-07-03 12:17:36 +00:00
|
|
|
end
|
2012-02-15 05:57:56 +00:00
|
|
|
|
|
|
|
class Docbookxml50 < Docbookxml
|
2010-07-03 12:17:36 +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
|
|
|
end
|
2012-02-15 05:57:56 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Docbookxsl < Formula
|
2012-02-15 05:57:56 +00:00
|
|
|
homepage 'http://docbook.sourceforge.net/'
|
2013-02-20 13:09:22 +00:00
|
|
|
url 'http://downloads.sourceforge.net/project/docbook/docbook-xsl/1.78.0/docbook-xsl-1.78.0.tar.bz2'
|
|
|
|
sha1 '39a62791e7c1479e22d13d12a9ecbb2273d66229'
|
2012-02-15 05:57:56 +00:00
|
|
|
|
2010-07-03 12:17:36 +00:00
|
|
|
def install
|
2013-02-20 13:09:22 +00:00
|
|
|
doc_files = %w[AUTHORS BUGS COPYING NEWS README RELEASE-NOTES.txt TODO VERSION VERSION.xsl]
|
|
|
|
xsl_files = %w[assembly catalog.xml common docsrc eclipse epub epub3 extensions
|
|
|
|
fo highlighting html htmlhelp images javahelp lib log manpages
|
|
|
|
params profiling roundtrip slides template tests tools webhelp
|
|
|
|
website xhtml xhtml-1_1 xhtml5]
|
2010-07-03 12:17:36 +00:00
|
|
|
docbook = Formula.factory 'docbook'
|
2012-12-24 18:52:08 +00:00
|
|
|
(docbook.prefix/'docbook/xsl'/version).install xsl_files + doc_files
|
2013-03-01 14:29:20 +00:00
|
|
|
|
|
|
|
(docbook.bin/'dbtoepub').write <<-EOS.undent
|
|
|
|
#!/bin/sh
|
|
|
|
exec "#{docbook.prefix}/docbook/xsl/#{version}/epub/bin/dbtoepub" "$@"
|
|
|
|
EOS
|
2010-07-03 12:17:36 +00:00
|
|
|
end
|
2012-02-15 05:57:56 +00:00
|
|
|
|
2012-12-24 18:52:08 +00:00
|
|
|
def catalog
|
|
|
|
"docbook/xsl/#{version}"
|
|
|
|
end
|
2010-07-03 12:17:36 +00:00
|
|
|
end
|
2012-08-08 20:24:18 +00:00
|
|
|
|
|
|
|
class Docbookxslns < Formula
|
|
|
|
homepage 'http://docbook.sourceforge.net/'
|
2013-02-20 13:09:22 +00:00
|
|
|
url 'http://downloads.sourceforge.net/project/docbook/docbook-xsl-ns/1.78.0/docbook-xsl-ns-1.78.0.tar.bz2'
|
|
|
|
sha1 '377c7bc16af6779c827ac9e818b0f665c7a038f2'
|
2012-08-08 20:24:18 +00:00
|
|
|
|
|
|
|
def install
|
2013-02-20 13:09:22 +00:00
|
|
|
doc_files = %w[AUTHORS BUGS COPYING NEWS README README.ns RELEASE-NOTES.txt TODO VERSION VERSION.xsl]
|
2012-08-08 20:24:18 +00:00
|
|
|
xsl_files = %w[assembly catalog.xml common docsrc eclipse epub epub3 extensions
|
|
|
|
fo highlighting html htmlhelp images javahelp lib log manpages
|
|
|
|
params profiling roundtrip slides template tests tools webhelp
|
|
|
|
website xhtml xhtml-1_1 xhtml5]
|
|
|
|
docbook = Formula.factory 'docbook'
|
2012-12-24 18:52:08 +00:00
|
|
|
(docbook.prefix/'docbook/xsl-ns'/version).install xsl_files + doc_files
|
2012-08-08 20:24:18 +00:00
|
|
|
end
|
|
|
|
|
2012-12-24 18:52:08 +00:00
|
|
|
def catalog
|
|
|
|
"docbook/xsl-ns/#{version}"
|
|
|
|
end
|
2012-08-08 20:24:18 +00:00
|
|
|
end
|