wok-next annotate postgresql/receipt @ rev 21500

updated asunder (2.9.3 -> 2.9.6)
author Hans-G?nter Theisgen
date Fri Jun 19 06:47:46 2020 +0100 (2020-06-19)
parents 0e7893ac206d
children
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@1149 10
al@19693 11 TARBALL="$PACKAGE-$VERSION.tar.bz2"
al@19693 12 WGET_URL="http://ftp.postgresql.org/pub/source/v$VERSION/$TARBALL"
al@19693 13
pascal@20146 14 BUILD_DEPENDS="readline-dev zlib-dev perl-dev python-dev"
al@21020 15 SPLIT="libpostgresqlclient $PACKAGE-client $PACKAGE-dev $PACKAGE-doc"
pascal@13320 16
al@20443 17 compile_rules() {
al@19693 18 sed -i '/DEFAULT_PGSOCKET_DIR/s@/tmp@/run/postgresql@' src/include/pg_config_manual.h &&
al@19693 19
al@19693 20 ./configure \
al@19693 21 --enable-thread-safety \
al@19693 22 --docdir=/usr/share/doc/postgresql-$VERSION \
al@19693 23 --with-system-tzdata=/usr/share/zoneinfo \
al@19693 24 --with-perl --with-python \
al@19693 25 $CONFIGURE_ARGS &&
al@21020 26 make &&
al@21020 27 make install &&
al@21020 28 make install-docs &&
al@21020 29 make -C doc/src/sgml DESTDIR=$install install-html
pascal@1149 30 }
pascal@1149 31
al@20443 32 genpkg_rules() {
pascal@20143 33 case $PACKAGE in
pascal@20143 34 postgresql)
pascal@20143 35 copy bin/ postgresql/ *.so*
al@19693 36
pascal@20143 37 mkdir -p $fs/var/lib/pgsql $fs/var/log/postgresql $fs/etc/pgsql.d
pascal@20143 38 cp -a $stuff/etc $fs
pascal@20143 39 ln -s /var/lib/pgsql/postgresql.conf $fs/etc
pascal@20143 40 chmod 700 $fs/var/lib/pgsql
al@19693 41
pascal@20143 42 # split
pascal@20143 43 for i in clusterdb createdb createlang createuser dropdb droplang dropuser \
pascal@20143 44 pg_dump pg_dumpall pg_restore psql reindexdb vacuumdb libpq.so*; do
pascal@20143 45 find $fs -name $i -delete
pascal@20143 46 done
pascal@20143 47 rm -r $fs/usr/include $fs/usr/lib/postgresql/pgxs
al@21020 48 DEPENDS="postgresql-client slitaz-base-files"
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.
al@21020 74 post_install_postgresql() {
al@19693 75 # adduser postgres if needed
pascal@18730 76 if ! grep -q postgres: "$1/etc/passwd"; then
al@19693 77 action 'Adding user postgres...'
pascal@18730 78 chroot "$1/" adduser postgres -D -H -u 88 -h /var/lib/pgsql
pascal@18730 79 #[ -d "$1/var/lib/pgsql" ] && rm -f "$1/var/lib/pgsql"/.* "$1/var/lib/pgsql"/*
pascal@1149 80 status
pascal@1149 81 fi
pascal@1149 82 # addgroup postgres if needed
pascal@18730 83 if ! grep -q postgres: "$1/etc/group"; then
al@19693 84 action 'Adding group postgres...'
pascal@18730 85 chroot "$1/" sh -c 'addgroup -g 88 postgres'
pascal@1149 86 status
pascal@1149 87 fi
pascal@18730 88 [ ! -d "$1/var/lib/pgsql" ] && mkdir -p "$1/var/lib/pgsql"
pascal@18730 89 chroot "$1/" chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
al@19693 90 [ -n "$quiet" ] || cat <<EOF
pascal@1149 91
al@21020 92 .---------------------------------------------------.
al@21020 93 | postgres has superuser access. |
al@21020 94 | Configure /var/lib/pgsql/*.conf files. |
al@21020 95 |---------------------------------------------------|
al@21020 96 | To start postgresql server you can run: |
al@21020 97 | |
al@21020 98 | /etc/init.d/postgresql start |
al@21020 99 | |
al@21020 100 | Or add postgresql to RUN_DAEMONS in /etc/rcS.conf |
al@21020 101 '---------------------------------------------------'
pascal@1149 102 EOF
pascal@1149 103 }
pascal@1149 104
al@20443 105 post_remove_postgresql() {
slaxemulator@8646 106 # when both user and group have the same id# and name
slaxemulator@8646 107 # both group and user will get removed with either delusr/delgroup
pascal@18730 108 chroot "$1/" deluser postgres
pascal@1149 109 }