Files
chromebrew/packages/postgresql.rb
chromebrew-actions[bot] 38439537ab gparted -> 1.8.1 in updater-gparted-1.8.1 — gparted: 1.8.0 → 1.8.1 (#15055)
* gparted -> 1.8.1 in updater-gparted-1.8.1

* updater-gparted-1.8.1: Package File Update Run on linux/amd64 container.

* updater-gparted-1.8.1: Package File Update Run on linux/arm/v7 container.

* updater-gparted-1.8.1: Package File Update Run on linux/amd64 container.

* Cleanup gparted.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Update dependencies to use :executable instead of :executable_only

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

---------

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
Co-authored-by: github-merge-queue <github-merge-queue@users.noreply.github.com>
Co-authored-by: chromebrew-actions[bot] <chromebrew-actions[bot]@users.noreply.github.com>
Co-authored-by: satmandu <satmandu@users.noreply.github.com>
Co-authored-by: Satadru Pramanik <satadru@gmail.com>
2026-03-19 00:13:29 +00:00

97 lines
3.1 KiB
Ruby

require 'buildsystems/meson'
class Postgresql < Meson
description 'PostgreSQL is a powerful, open source object-relational database system.'
homepage 'https://www.postgresql.org'
version "18.3-#{CREW_ICU_VER}"
license 'PostgreSQL and GPL-2'
compatibility 'aarch64 armv7l x86_64'
source_url "https://ftp.postgresql.org/pub/source/v#{version.split('-').first}/postgresql-#{version.split('-').first}.tar.bz2"
source_sha256 'd95663fbbf3a80f81a9d98d895266bdcb74ba274bcc04ef6d76630a72dee016f'
binary_compression 'tar.zst'
binary_sha256({
aarch64: '98260cc3aa908dd412715f01706df848c14513b84208ef3320c39e9b3a8c3aa0',
armv7l: '98260cc3aa908dd412715f01706df848c14513b84208ef3320c39e9b3a8c3aa0',
x86_64: 'a43dd827d31b6be6fc8b1d0ef3e147f6292cc87a7498b57d025c913eef24edb2'
})
depends_on 'brotli' => :build
depends_on 'curl' # R
depends_on 'docbook_xml45' => :build
depends_on 'expat' => :build
depends_on 'fop' # R
depends_on 'gcc_lib' # R
depends_on 'glibc' # R
depends_on 'icu4c' => :executable
depends_on 'krb5' # R
depends_on 'libcyrussasl' => :build
depends_on 'liburing' => :executable
depends_on 'libxml2' # R
depends_on 'libxslt' # R
depends_on 'linux_pam' => :executable
depends_on 'llvm_dev' => :build
depends_on 'lz4' => :executable
depends_on 'numactl' => :executable
depends_on 'openldap' # R
depends_on 'openssl' # R
depends_on 'pandoc' => :build
depends_on 'perl' # R
depends_on 'python3' # R
depends_on 'readline' => :executable
depends_on 'tcl' # R
depends_on 'wget2' # R
depends_on 'zlib' # R
depends_on 'zstd' => :executable
print_source_bashrc
PGDATA = "#{CREW_PREFIX}/share/pgsql/data".freeze
def self.patch
system "sed -i 's,PGDATA=\"/usr/local/pgsql/data\",PGDATA=\"#{PGDATA}\",' contrib/start-scripts/linux"
end
meson_install_extras do
# This conditional is needed for installation only.
unless Dir.exist? PGDATA
FileUtils.mkdir_p PGDATA
FileUtils.chmod 0o700, PGDATA
end
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/var/log/"
FileUtils.touch "#{CREW_DEST_PREFIX}/var/log/pgsql.log"
File.write 'postgresenv', <<~POSTGRESEOF
# PostgreSQL configuration
export PGDATA="#{PGDATA}"
# Start server on login
if [ -x #{CREW_PREFIX}/bin/pg_ctl ]; then
pg_ctl -l #{CREW_PREFIX}/var/log/pgsql.log start
fi
POSTGRESEOF
FileUtils.install 'postgresenv', "#{CREW_DEST_PREFIX}/etc/env.d/postgres", mode: 0o644
end
def self.postinstall
# This conditional is needed for installation only. If this package is updated in the future,
# there is no need to initialize the data directory and display messages again.
system "initdb -D #{PGDATA}" unless File.exist? "#{PGDATA}/PG_VERSION"
ExitMessage.add <<~EOM
To start postgres: pg_ctl -l logfile start
To stop postgres: pg_ctl stop
Create a database: createdb <dbname>
Connect to database: psql <dbname>
To configure, edit #{CREW_PREFIX}/etc/env.d/postgres
EOM
end
def self.postremove
puts 'WARNING: This will delete all databases!'.orange
Package.agree_to_remove(PGDATA)
end
end