homebrew-core/Formula/dbxml.rb

59 lines
1.9 KiB
Ruby
Raw Normal View History

class Dbxml < Formula
desc "Embeddable XML database with XQuery support and other advanced features"
2016-04-17 20:06:45 +00:00
homepage "https://www.oracle.com/us/products/database/berkeley-db/xml/overview/index.html"
url "http://download.oracle.com/berkeley-db/dbxml-6.0.18.tar.gz"
sha256 "5851f60a47920718b701752528a449f30b16ddbf5402a2a5e8cde8b4aecfabc8"
revision 2
2015-10-13 02:39:12 +00:00
bottle do
cellar :any
2017-01-15 15:32:41 +00:00
sha256 "f12996781a7a784ff65b5fbb33b5285f996fda729e7fcd4104890ea55010c549" => :sierra
sha256 "babca444db17952084979d91bb17680f3a8a3d009f03cef87686bb7bd4ae6054" => :el_capitan
sha256 "3a64c61d48a1f0c864d6f780c0b73ccd82a26f24958d64c1ddff6c5f35ea9b2f" => :yosemite
2015-10-13 02:39:12 +00:00
end
depends_on "xerces-c"
depends_on "xqilla"
depends_on "berkeley-db"
def install
inreplace "dbxml/configure" do |s|
s.gsub! "lib/libdb-*.la | sed 's\/.*db-\\\(.*\\\).la", "lib/libdb-*.a | sed 's/.*db-\\(.*\\).a"
s.gsub! "lib/libdb-*.la", "lib/libdb-*.a"
end
cd "dbxml" do
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--with-xqilla=#{HOMEBREW_PREFIX}",
"--with-xerces=#{HOMEBREW_PREFIX}",
"--with-berkeleydb=#{HOMEBREW_PREFIX}"
system "make", "install"
end
end
test do
(testpath/"simple.xml").write <<-EOS.undent
<breakfast_menu>
<food>
<name>Belgian Waffles</name>
<calories>650</calories>
</food>
<food>
<name>Homestyle Breakfast</name>
<calories>950</calories>
</food>
</breakfast_menu>
EOS
(testpath/"dbxml.script").write <<-EOS.undent
createContainer ""
putDocument simple "simple.xml" f
cquery 'sum(//food/calories)'
print
quit
EOS
assert_equal "1600", shell_output("#{bin}/dbxml -s #{testpath}/dbxml.script").chomp
end
end