wok-next annotate postgresql/receipt @ rev 19925

libftdi: update bdeps
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Oct 14 23:27:36 2017 +0200 (2017-10-14)
parents 4048d48a47c1
children f971bef7006e
rev   line source
pascal@1149 1 # SliTaz package receipt.
pascal@1149 2
pascal@1149 3 PACKAGE="postgresql"
al@19693 4 VERSION="9.5.4"
pascal@1506 5 CATEGORY="misc"
al@19693 6 SHORT_DESC="Advanced object-relational database management system"
pascal@1149 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@15375 8 LICENSE="BSD"
al@19693 9 WEB_SITE="https://www.postgresql.org/"
pascal@2347 10 DATABASE_FILES="/var/lib/pgsql"
pascal@1149 11
al@19693 12 TARBALL="$PACKAGE-$VERSION.tar.bz2"
al@19693 13 WGET_URL="http://ftp.postgresql.org/pub/source/v$VERSION/$TARBALL"
al@19693 14
pascal@13320 15 DEPENDS="postgresql-client slitaz-base-files"
al@19693 16 BUILD_DEPENDS="readline-dev zlib-dev perl python-dev"
al@19693 17 SPLIT="libpostgresqlclient postgresql-client postgresql-doc"
pascal@13320 18
pascal@1149 19 # Rules to configure and make the package.
pascal@1149 20 compile_rules()
pascal@1149 21 {
al@19693 22 sed -i '/DEFAULT_PGSOCKET_DIR/s@/tmp@/run/postgresql@' src/include/pg_config_manual.h &&
al@19693 23
al@19693 24 ./configure \
al@19693 25 --enable-thread-safety \
al@19693 26 --docdir=/usr/share/doc/postgresql-$VERSION \
al@19693 27 --with-system-tzdata=/usr/share/zoneinfo \
al@19693 28 --with-perl --with-python \
al@19693 29 $CONFIGURE_ARGS &&
al@19693 30 make && make install && make install-docs
al@19693 31
slaxemulator@11412 32 make -C doc/src/sgml DESTDIR=$DESTDIR install-html
pascal@1149 33 }
pascal@1149 34
pascal@1149 35 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1149 36 genpkg_rules()
pascal@1149 37 {
al@19783 38 copy bin/ postgresql/ *.so*
al@19693 39
al@19693 40 mkdir -p $fs/var/lib/pgsql $fs/var/log/postgresql $fs/etc/pgsql.d
slaxemulator@9701 41 cp -a $stuff/etc $fs
pascal@1149 42 ln -s /var/lib/pgsql/postgresql.conf $fs/etc
pascal@1149 43 chmod 700 $fs/var/lib/pgsql
al@19693 44
al@19693 45 # split
al@19693 46 for i in clusterdb createdb createlang createuser dropdb droplang dropuser \
al@19693 47 pg_dump pg_dumpall pg_restore psql reindexdb vacuumdb libpq.so*; do
al@19693 48 find $fs -name $i -delete
pascal@1149 49 done
al@19693 50 rm -r $fs/usr/include $fs/usr/lib/postgresql/pgxs
pascal@1149 51 }
pascal@1149 52
pascal@1149 53 # Pre and post install commands for Tazpkg.
pascal@1149 54 post_install()
pascal@1149 55 {
al@19693 56 # adduser postgres if needed
pascal@18730 57 if ! grep -q postgres: "$1/etc/passwd"; then
al@19693 58 action 'Adding user postgres...'
pascal@18730 59 chroot "$1/" adduser postgres -D -H -u 88 -h /var/lib/pgsql
pascal@18730 60 #[ -d "$1/var/lib/pgsql" ] && rm -f "$1/var/lib/pgsql"/.* "$1/var/lib/pgsql"/*
pascal@1149 61 status
pascal@1149 62 fi
pascal@1149 63 # addgroup postgres if needed
pascal@18730 64 if ! grep -q postgres: "$1/etc/group"; then
al@19693 65 action 'Adding group postgres...'
pascal@18730 66 chroot "$1/" sh -c 'addgroup -g 88 postgres'
pascal@1149 67 status
pascal@1149 68 fi
pascal@18730 69 [ ! -d "$1/var/lib/pgsql" ] && mkdir -p "$1/var/lib/pgsql"
pascal@18730 70 chroot "$1/" chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
al@19693 71 [ -n "$quiet" ] || cat <<EOF
pascal@1149 72 ----
pascal@1152 73 postgres has superuser access.
pascal@1152 74 Configure /var/lib/pgsql/*.conf files.
al@19693 75 To start $PACKAGE server you can run:
pascal@1149 76
pascal@1149 77 /etc/init.d/$PACKAGE start
pascal@1149 78
pascal@1149 79 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
pascal@1149 80 ----
pascal@1149 81 EOF
pascal@1149 82 }
pascal@1149 83
pascal@1149 84 post_remove()
pascal@1149 85 {
slaxemulator@8646 86 # when both user and group have the same id# and name
slaxemulator@8646 87 # both group and user will get removed with either delusr/delgroup
pascal@18730 88 chroot "$1/" deluser postgres
pascal@1149 89 }