Files
haikuports/dev-db/postgresql/postgresql12-12.0.recipe

232 lines
7.7 KiB
Bash

SUMMARY="A powerful object-relational database system"
DESCRIPTION="PostgreSQL is a powerful, open source object-relational database \
system that uses and extends the SQL language combined with many features \
that safely store and scale the most complicated data workloads. The origins \
of PostgreSQL date back to 1986 as part of the POSTGRES project at the \
University of California at Berkeley and has more than 30 years of active \
development on the core platform.
PostgreSQL has earned a strong reputation for its proven architecture, \
reliability, data integrity, robust feature set, extensibility, and the \
dedication of the open source community behind the software to consistently \
deliver performant and innovative solutions. PostgreSQL runs on all major \
operating systems, has been ACID-compliant since 2001, and has powerful \
add-ons such as the popular PostGIS geospatial database extender. It is no \
surprise that PostgreSQL has become the open source relational database of \
choice for many people and organisations.
Getting started with using PostgreSQL has never been easier - pick a project \
you want to build, and let PostgreSQL safely and robustly store your data."
HOMEPAGE="https://www.postgresql.org/"
COPYRIGHT="1996-2019 PostgreSQL Global Development Group"
LICENSE="PostgreSQL"
REVISION="8"
SOURCE_URI="http://ftp.postgresql.org/pub/source/v$portVersion/postgresql-$portVersion.tar.bz2"
CHECKSUM_SHA256="cda2397215f758b793f741c86be05468257b0e6bcb1a6113882ab5d0df0855c6"
SOURCE_DIR="postgresql-$portVersion"
PATCHES="postgresql12-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
portVersionCompat="$portVersion compat >= ${portVersion%.*}"
PROVIDES="
postgresql12$secondaryArchSuffix = $portVersionCompat
cmd:psql$secondaryArchSuffix = $portVersionCompat
lib:libecpg$secondaryArchSuffix = $portVersionCompat
lib:libecpg_compat$secondaryArchSuffix = $portVersionCompat
lib:libpgtypes$secondaryArchSuffix = $portVersionCompat
lib:libpq$secondaryArchSuffix = $portVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libcrypto$secondaryArchSuffix
lib:libicudata$secondaryArchSuffix
lib:libicui18n$secondaryArchSuffix
lib:libicuuc$secondaryArchSuffix
lib:libldap$secondaryArchSuffix
lib:libpam$secondaryArchSuffix
lib:libreadline$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libxml2$secondaryArchSuffix
lib:libxslt$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
CONFLICTS="
postgresql$secondaryArchSuffix
postgresql11$secondaryArchSuffix
"
PROVIDES_server="
postgresql12${secondaryArchSuffix}_server = $portVersionCompat
cmd:clusterdb$secondaryArchSuffix = $portVersionCompat
cmd:createdb$secondaryArchSuffix = $portVersionCompat
cmd:createlang$secondaryArchSuffix = $portVersionCompat
cmd:createuser$secondaryArchSuffix = $portVersionCompat
cmd:dropdb$secondaryArchSuffix = $portVersionCompat
cmd:droplang$secondaryArchSuffix = $portVersionCompat
cmd:dropuser$secondaryArchSuffix = $portVersionCompat
cmd:ecpg$secondaryArchSuffix = $portVersionCompat
cmd:initdb$secondaryArchSuffix = $portVersionCompat
cmd:pg_archivecleanup$secondaryArchSuffix = $portVersionCompat
cmd:pg_basebackup$secondaryArchSuffix = $portVersionCompat
cmd:pg_checksums$secondaryArchSuffix = $portVersionCompat
cmd:pg_config$secondaryArchSuffix = $portVersionCompat
cmd:pg_controldata$secondaryArchSuffix = $portVersionCompat
cmd:pg_ctl$secondaryArchSuffix = $portVersionCompat
cmd:pg_dump$secondaryArchSuffix = $portVersionCompat
cmd:pg_dumpall$secondaryArchSuffix = $portVersionCompat
cmd:pg_isready$secondaryArchSuffix = $portVersionCompat
cmd:pg_receivewal$secondaryArchSuffix = $portVersionCompat
cmd:pg_receivexlog$secondaryArchSuffix = $portVersionCompat
cmd:pg_recvlogical$secondaryArchSuffix = $portVersionCompat
cmd:pg_resetwal$secondaryArchSuffix = $portVersionCompat
cmd:pg_resetxlog$secondaryArchSuffix = $portVersionCompat
cmd:pg_restore$secondaryArchSuffix = $portVersionCompat
cmd:pg_rewind$secondaryArchSuffix = $portVersionCompat
cmd:pg_test_fsync$secondaryArchSuffix = $portVersionCompat
cmd:pg_test_timing$secondaryArchSuffix = $portVersionCompat
cmd:pg_upgrade$secondaryArchSuffix = $portVersionCompat
cmd:pg_verify_checksums$secondaryArchSuffix = $portVersionCompat
cmd:pg_waldump$secondaryArchSuffix = $portVersionCompat
cmd:pg_xlogdump$secondaryArchSuffix = $portVersionCompat
cmd:pgbench$secondaryArchSuffix = $portVersionCompat
cmd:postgres$secondaryArchSuffix = $portVersionCompat
cmd:postmaster$secondaryArchSuffix = $portVersionCompat
cmd:reindexdb$secondaryArchSuffix = $portVersionCompat
cmd:vacuumdb$secondaryArchSuffix = $portVersionCompat
"
REQUIRES_server="
haiku$secondaryArchSuffix
postgresql12$secondaryArchSuffix == $portVersion base
lib:libcrypto$secondaryArchSuffix
lib:libicudata$secondaryArchSuffix
lib:libicui18n$secondaryArchSuffix
lib:libicuuc$secondaryArchSuffix
lib:libldap_2.4$secondaryArchSuffix
lib:libpam$secondaryArchSuffix
lib:libpq$secondaryArchSuffix
lib:libreadline$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libxml2$secondaryArchSuffix
lib:libxslt$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_devel="
postgresql12${secondaryArchSuffix}_devel = $portVersion
devel:libecpg$secondaryArchSuffix = $portVersion
devel:libecpg_compat$secondaryArchSuffix = $portVersion
devel:libpgcommon$secondaryArchSuffix = $portVersion
devel:libpgcommon_shlib$secondaryArchSuffix = $portVersion
devel:libpgfeutils$secondaryArchSuffix = $portVersion
devel:libpgport$secondaryArchSuffix = $portVersion
devel:libpgport_shlib$secondaryArchSuffix = $portVersion
devel:libpgtypes$secondaryArchSuffix = $portVersion
devel:libpq$secondaryArchSuffix = $portVersion
"
REQUIRES_devel="
postgresql12$secondaryArchSuffix == $portVersion base
"
CONFLICTS_server="
postgresql
postgresql$secondaryArchSuffix
postgresql11$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libcrypto$secondaryArchSuffix >= 3
devel:libicudata$secondaryArchSuffix >= 74
devel:libicui18n$secondaryArchSuffix >= 74
devel:libicuuc$secondaryArchSuffix >= 74
devel:libldap_2.4$secondaryArchSuffix
devel:libpam$secondaryArchSuffix
devel:libreadline$secondaryArchSuffix
devel:libssl$secondaryArchSuffix >= 3
devel:libxml2$secondaryArchSuffix
devel:libxslt$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:awk
cmd:bison
cmd:flex
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
cmd:touch
"
if [ "$targetArchitecture" = riscv64 ]; then
spinlocks="--disable-spinlocks"
fi
BUILD()
{
libtoolize --force --copy --install
touch src/template/haiku # AFAIK it should be empty
touch config/missing # shouldn't be required
CFLAGS="-D_BSD_SOURCE -O2" LDFLAGS="-lnetwork" runConfigure ./configure \
--with-icu \
--with-ldap \
--with-libxml \
--with-libxslt \
--with-openssl \
--with-pam \
--with-template=haiku \
--disable-thread-safety \
$spinlocks
make $jobArgs
}
INSTALL()
{
make install
# remove leftover static libraries
rm $libDir/{libecpg,libecpg_compat,libpgtypes,libpq}.a
prepareInstalledDevelLibs \
libecpg \
libecpg_compat \
libpgcommon \
libpgcommon_shlib \
libpgfeutils \
libpgport \
libpgport_shlib \
libpgtypes \
libpq
fixPkgconfig
mkdir -p $developLibDir/postgresql/pgxs
mv $libDir/postgresql/pgxs $developLibDir/postgresql/
# we want to keep the psql command in the base package
mv $binDir/psql psql_tmp
# all other commands go in the server package
packageEntries server \
$binDir \
$dataDir/postgresql \
$libDir/postgresql
mkdir -p $binDir
mv psql_tmp $binDir/psql
packageEntries devel \
$developDir
}
TEST()
{
LIBRARY_PATH="$sourceDir/src/interfaces/libpq${LIBRARY_PATH:+:$LIBRARY_PATH}"
make check
}