# Maintainer: Natanael Copa pkgname=postgresql pkgver=9.3.3 pkgrel=0 pkgdesc="A sophisticated object-relational DBMS" url="http://www.postgresql.org/" arch="all" license="BSD" depends="postgresql-client" install="$pkgname.pre-upgrade" depends_dev="readline-dev openssl-dev zlib-dev libxml2-dev" makedepends="$depends_dev" subpackages="$pkgname-dev $pkgname-doc libpq $pkgname-client $pkgname-contrib" patches="initdb.patch" source="ftp://ftp.$pkgname.org/pub/source/v$pkgver/$pkgname-$pkgver.tar.bz2 $patches $pkgname.initd $pkgname.confd pg-restore.initd pg-restore.confd " _builddir="$srcdir"/$pkgname-$pkgver prepare() { cd "$_builddir" for i in $patches; do msg $i patch -p1 -i "$srcdir"/$i || return 1 done # sanity check of conf.d ( . "$srcdir"/postgresql.confd _datadir=/var/lib/postgresql/${pkgver%.*}/data if [ "$_datadir" != "$PGDATA" ]; then die "PGDATA is $PGDATA while $_datadir is expected" fi ) || return 1 } build() { cd "$_builddir" ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --mandir=/usr/share/man \ --with-openssl \ || return 1 make world || return 1 } package() { cd "$_builddir" make DESTDIR="$pkgdir" install install-docs || return 1 install -D -m755 "$srcdir"/postgresql.initd \ "$pkgdir"/etc/init.d/postgresql || return 1 install -D -m644 "$srcdir"/postgresql.confd \ "$pkgdir"/etc/conf.d/postgresql || return 1 install -D -m755 "$srcdir"/pg-restore.initd \ "$pkgdir"/etc/init.d/pg-restore || return 1 install -D -m644 "$srcdir"/pg-restore.confd \ "$pkgdir"/etc/conf.d/pg-restore || return 1 } libpq() { depends= pkgdesc="PostgreSQL libraries" mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/libpq.so* "$subpkgdir"/usr/lib/ } client() { depends= pkgdesc="PostgreSQL client" mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/psql "$subpkgdir"/usr/bin/ } contrib() { depends= pkgdesc="Extension modules distributed with PostgreSQL" cd "$_builddir" make DESTDIR="$subpkgdir" -C contrib install || return 1 } md5sums="0247b0a24e76a3f20cc50c06d0aa2412 postgresql-9.3.3.tar.bz2 00f0fc07fb8447f7e174c4cee0661722 initdb.patch 01cc8d4a4cbc77a7b6f84344155232d5 postgresql.initd 9741f3d5f0611ce39f85f70f2cab2b00 postgresql.confd d2a51db4436e550d56bb1e96699faef4 pg-restore.initd bf45384752b320b369f1425939763178 pg-restore.confd" sha256sums="e925d8abe7157bd8bece6b7c0dd0c343d87a2b4336f85f4681ce596af99c3879 postgresql-9.3.3.tar.bz2 36a65229bf31b20a95ff2e2cac1a6ece0c61afdcd0b544759ad12f34d1b98a39 initdb.patch a2ed1adeb70b0098e7e50f74aa601175b56f643a53836d8d325fcac07eb9e614 postgresql.initd 7fd24959d5fa49b1405cb94438665f060335266ea20224f234c6bcb5dce3403b postgresql.confd d73701e9a5fff2d7088ee50d7c7fc8a2fa19f651237d8b880c579e0e09515609 pg-restore.initd 31414d8b57c4cd2116b6014de3f1329875151910753fbd616daec4554866d02f pg-restore.confd" sha512sums="2d8163b31042dc66dc52371e265cc081c52783da403652fef4985b177d2961fdf106767112595fde6ef79e3122fcc318a3daeb5dea59a1cd211b8744acd65462 postgresql-9.3.3.tar.bz2 6f7fdceb1a5aba3f00894ae88afdf25e5f9c7a0ffc00b11211011a6415ea73639d6a67f516cab66c6487484bab26ded3c93471d6d41ac0d3822926c22274f2ba initdb.patch 215d3e2a08a018148f901a80e4c915b314188d50874e465a2181259b0dd5f95d4b18e2e3a9e428a1cdff03f51f8ce67245f4503157d542e11519d2d9fba08a80 postgresql.initd 17f0a81cc06a76aeadd0b1bd14cffffee2c64405615ef13895403e854569f936b295c54786d2c5aa84dc617edb615257c05a8e04185151f88a4e762eb7e67844 postgresql.confd e7f8e08edc54c54c513786f8ea34cb6deac61106cff8004fbe56b9b32b22a4d5acdff256e864ef242b91d7704595fd9ec27ccbcef70da5d5c85f049d92304bf2 pg-restore.initd c14a5684e914abb3b0ee71bbf15eed71a9264deacaa404a6e3af6bfc330d93e7598624d0ed11a94263106cc660f7f54c8ff57e759033cf606a795f69ff6c1c7c pg-restore.confd"