wok-next annotate postgresql/receipt @ rev 19737
Up bind, brotli, cairo, check, compface, cookutils, cpio, curl, db, openssl.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Tue May 30 05:37:57 2017 +0300 (2017-05-30) |
parents | 9e01bc6321ea |
children | f463de72afe3 |
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@19693 | 38 cook_copy_folders bin postgresql |
al@19693 | 39 cook_copy_files *.so* |
al@19693 | 40 |
al@19693 | 41 mkdir -p $fs/var/lib/pgsql $fs/var/log/postgresql $fs/etc/pgsql.d |
slaxemulator@9701 | 42 cp -a $stuff/etc $fs |
pascal@1149 | 43 ln -s /var/lib/pgsql/postgresql.conf $fs/etc |
pascal@1149 | 44 chmod 700 $fs/var/lib/pgsql |
al@19693 | 45 |
al@19693 | 46 # split |
al@19693 | 47 for i in clusterdb createdb createlang createuser dropdb droplang dropuser \ |
al@19693 | 48 pg_dump pg_dumpall pg_restore psql reindexdb vacuumdb libpq.so*; do |
al@19693 | 49 find $fs -name $i -delete |
pascal@1149 | 50 done |
al@19693 | 51 rm -r $fs/usr/include $fs/usr/lib/postgresql/pgxs |
pascal@1149 | 52 } |
pascal@1149 | 53 |
pascal@1149 | 54 # Pre and post install commands for Tazpkg. |
pascal@1149 | 55 post_install() |
pascal@1149 | 56 { |
al@19693 | 57 # adduser postgres if needed |
pascal@18730 | 58 if ! grep -q postgres: "$1/etc/passwd"; then |
al@19693 | 59 action 'Adding user postgres...' |
pascal@18730 | 60 chroot "$1/" adduser postgres -D -H -u 88 -h /var/lib/pgsql |
pascal@18730 | 61 #[ -d "$1/var/lib/pgsql" ] && rm -f "$1/var/lib/pgsql"/.* "$1/var/lib/pgsql"/* |
pascal@1149 | 62 status |
pascal@1149 | 63 fi |
pascal@1149 | 64 # addgroup postgres if needed |
pascal@18730 | 65 if ! grep -q postgres: "$1/etc/group"; then |
al@19693 | 66 action 'Adding group postgres...' |
pascal@18730 | 67 chroot "$1/" sh -c 'addgroup -g 88 postgres' |
pascal@1149 | 68 status |
pascal@1149 | 69 fi |
pascal@18730 | 70 [ ! -d "$1/var/lib/pgsql" ] && mkdir -p "$1/var/lib/pgsql" |
pascal@18730 | 71 chroot "$1/" chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql |
al@19693 | 72 [ -n "$quiet" ] || cat <<EOF |
pascal@1149 | 73 ---- |
pascal@1152 | 74 postgres has superuser access. |
pascal@1152 | 75 Configure /var/lib/pgsql/*.conf files. |
al@19693 | 76 To start $PACKAGE server you can run: |
pascal@1149 | 77 |
pascal@1149 | 78 /etc/init.d/$PACKAGE start |
pascal@1149 | 79 |
pascal@1149 | 80 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf |
pascal@1149 | 81 ---- |
pascal@1149 | 82 EOF |
pascal@1149 | 83 } |
pascal@1149 | 84 |
pascal@1149 | 85 post_remove() |
pascal@1149 | 86 { |
slaxemulator@8646 | 87 # when both user and group have the same id# and name |
slaxemulator@8646 | 88 # both group and user will get removed with either delusr/delgroup |
pascal@18730 | 89 chroot "$1/" deluser postgres |
pascal@1149 | 90 } |