wok-next annotate postgresql/receipt @ rev 20443

The rest of my "home work" for update many packages (up to Xorg, GTK and Openbox) for Next and mainly for Next64. Since this point this repository is open for commits. Many errors are expected due to harfbuzz-freetype dependency loop...
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Feb 24 16:17:33 2018 +0200 (2018-02-24)
parents 5b64ca8fb7e1
children d5aab818505e
rev   line source
pascal@20143 1 # SliTaz package receipt v2.
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"
pascal@20146 16 BUILD_DEPENDS="readline-dev zlib-dev perl-dev python-dev"
pascal@20143 17 SPLIT="libpostgresqlclient postgresql-client postgresql-dev postgresql-doc"
pascal@13320 18
al@20443 19 compile_rules() {
al@19693 20 sed -i '/DEFAULT_PGSOCKET_DIR/s@/tmp@/run/postgresql@' src/include/pg_config_manual.h &&
al@19693 21
al@19693 22 ./configure \
al@19693 23 --enable-thread-safety \
al@19693 24 --docdir=/usr/share/doc/postgresql-$VERSION \
al@19693 25 --with-system-tzdata=/usr/share/zoneinfo \
al@19693 26 --with-perl --with-python \
al@19693 27 $CONFIGURE_ARGS &&
al@19693 28 make && make install && make install-docs
al@19693 29
slaxemulator@11412 30 make -C doc/src/sgml DESTDIR=$DESTDIR install-html
pascal@1149 31 }
pascal@1149 32
al@20443 33 genpkg_rules() {
pascal@20143 34 case $PACKAGE in
pascal@20143 35 postgresql)
pascal@20143 36 copy bin/ postgresql/ *.so*
al@19693 37
pascal@20143 38 mkdir -p $fs/var/lib/pgsql $fs/var/log/postgresql $fs/etc/pgsql.d
pascal@20143 39 cp -a $stuff/etc $fs
pascal@20143 40 ln -s /var/lib/pgsql/postgresql.conf $fs/etc
pascal@20143 41 chmod 700 $fs/var/lib/pgsql
al@19693 42
pascal@20143 43 # split
pascal@20143 44 for i in clusterdb createdb createlang createuser dropdb droplang dropuser \
pascal@20143 45 pg_dump pg_dumpall pg_restore psql reindexdb vacuumdb libpq.so*; do
pascal@20143 46 find $fs -name $i -delete
pascal@20143 47 done
pascal@20143 48 rm -r $fs/usr/include $fs/usr/lib/postgresql/pgxs
pascal@20143 49 ;;
pascal@20143 50 libpostgresqlclient)
pascal@20143 51 CAT="misc|Advanced object-relational database management system (client libraries)"
pascal@20143 52 copy libpq.so*
pascal@20143 53 ;;
pascal@20143 54 postgresql-client)
pascal@20143 55 CAT="misc|Advanced object-relational database management system (client files)"
pascal@20143 56 PROVIDE="mysql_or_postgresql"
pascal@20143 57 DEPENDS="libpostgresqlclient zlib ncurses readline"
pascal@20143 58 copy clusterdb createdb createlang createuser dropdb droplang \
pascal@20143 59 dropuser pg_dump pg_dumpall pg_restore psql reindexdb vacuumdb
pascal@20143 60 ;;
pascal@20143 61 postgresql-dev)
pascal@20143 62 CAT="development|Advanced object-relational database management system (development files)"
pascal@20143 63 DEPENDS="postgresql"
pascal@20143 64 copy *.h *.a *.pc pgxs/
pascal@20143 65 ;;
pascal@20143 66 postgresql-doc)
pascal@20143 67 CAT="doc|Advanced object-relational database management system (documentation)"
pascal@20143 68 copy doc/
pascal@20143 69 ;;
pascal@20143 70 esac
pascal@1149 71 }
pascal@1149 72
pascal@1149 73 # Pre and post install commands for Tazpkg.
pascal@20143 74 post_install_postgresql()
pascal@1149 75 {
al@19693 76 # adduser postgres if needed
pascal@18730 77 if ! grep -q postgres: "$1/etc/passwd"; then
al@19693 78 action 'Adding user postgres...'
pascal@18730 79 chroot "$1/" adduser postgres -D -H -u 88 -h /var/lib/pgsql
pascal@18730 80 #[ -d "$1/var/lib/pgsql" ] && rm -f "$1/var/lib/pgsql"/.* "$1/var/lib/pgsql"/*
pascal@1149 81 status
pascal@1149 82 fi
pascal@1149 83 # addgroup postgres if needed
pascal@18730 84 if ! grep -q postgres: "$1/etc/group"; then
al@19693 85 action 'Adding group postgres...'
pascal@18730 86 chroot "$1/" sh -c 'addgroup -g 88 postgres'
pascal@1149 87 status
pascal@1149 88 fi
pascal@18730 89 [ ! -d "$1/var/lib/pgsql" ] && mkdir -p "$1/var/lib/pgsql"
pascal@18730 90 chroot "$1/" chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
al@19693 91 [ -n "$quiet" ] || cat <<EOF
pascal@1149 92 ----
pascal@1152 93 postgres has superuser access.
pascal@1152 94 Configure /var/lib/pgsql/*.conf files.
al@19693 95 To start $PACKAGE server you can run:
pascal@1149 96
pascal@1149 97 /etc/init.d/$PACKAGE start
pascal@1149 98
pascal@1149 99 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
pascal@1149 100 ----
pascal@1149 101 EOF
pascal@1149 102 }
pascal@1149 103
al@20443 104 post_remove_postgresql() {
slaxemulator@8646 105 # when both user and group have the same id# and name
slaxemulator@8646 106 # both group and user will get removed with either delusr/delgroup
pascal@18730 107 chroot "$1/" deluser postgres
pascal@1149 108 }