temporal_tables 1.1.0 (new formula)
Closes #8848. Signed-off-by: Alex Dunn <dunn.alex@gmail.com>
This commit is contained in:
parent
cc4a955104
commit
30fa5a0d44
1 changed files with 37 additions and 0 deletions
37
Formula/temporal_tables.rb
Normal file
37
Formula/temporal_tables.rb
Normal file
|
@ -0,0 +1,37 @@
|
|||
class TemporalTables < Formula
|
||||
desc "Temporal Tables PostgreSQL Extension"
|
||||
homepage "http://pgxn.org/dist/temporal_tables/"
|
||||
url "https://github.com/arkhipov/temporal_tables/archive/v1.1.0.tar.gz"
|
||||
sha256 "1fe210a349d1418d097f229c36f30a1daef1ff17cf0f027685171c52e366308a"
|
||||
|
||||
depends_on "postgresql"
|
||||
|
||||
def install
|
||||
ENV["PG_CONFIG"] = Formula["postgresql"].opt_bin/"pg_config"
|
||||
|
||||
# Use stage directory to prevent installing to pg_config-defined dirs,
|
||||
# which would not be within this package's Cellar.
|
||||
mkdir "stage"
|
||||
system "make", "install", "DESTDIR=#{buildpath}/stage"
|
||||
|
||||
lib.install Dir["stage/**/lib/*"]
|
||||
(share/"postgresql/extension").install Dir["stage/**/share/postgresql/extension/*"]
|
||||
end
|
||||
|
||||
test do
|
||||
pg_bin = Formula["postgresql"].opt_bin
|
||||
pg_port = "55562"
|
||||
system "#{pg_bin}/initdb", testpath/"test"
|
||||
pid = fork { exec "#{pg_bin}/postgres", "-D", testpath/"test", "-p", pg_port }
|
||||
|
||||
begin
|
||||
sleep 2
|
||||
|
||||
system "#{pg_bin}/createdb", "-p", pg_port, "test"
|
||||
system "#{pg_bin}/psql", "-p", pg_port, "-d", "test", "--command", "CREATE EXTENSION temporal_tables;"
|
||||
ensure
|
||||
Process.kill 9, pid
|
||||
Process.wait pid
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue