require 'formula' class Docbook < Formula url 'https://gist.github.com/raw/462528/098ccc609b039cf5b6d11fcd9c8ef333c3861b65/docbook-register' md5 '0fbc35a136190050de3598354655fd82' version '5.0' homepage 'http://docbook.sourceforge.net/' def packages; [ Docbookxml412, Docbookxml42, Docbookxml43, Docbookxml44, Docbookxml45, Docbookxml50, Docbookxsl, ]; end def install bin.install 'docbook-register' packages.each do |pkg| pkg.new.brew { |formula| formula.install } end end def caveats; <<-EOS.undent To use the DocBook package in your XML toolchain, you need to register it with the global XML catalog with this command: sudo docbook-register EOS end end class Docbookxml < Formula def install rm_rf 'docs' docbook = Formula.factory 'docbook' (docbook.prefix+'docbook/xml'+version).install Dir['*'] end end class Docbookxml412