wok-next view postgresql/receipt @ rev 21020

Cleaning is almost finished... I should proceed to upgrades.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Nov 02 14:15:08 2018 +0200 (2018-11-02)
parents 0e7893ac206d
children
line source
1 # SliTaz package receipt v2.
3 PACKAGE="postgresql"
4 VERSION="9.5.4"
5 CATEGORY="misc"
6 SHORT_DESC="Advanced object-relational database management system"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="BSD"
9 WEB_SITE="https://www.postgresql.org/"
11 TARBALL="$PACKAGE-$VERSION.tar.bz2"
12 WGET_URL="http://ftp.postgresql.org/pub/source/v$VERSION/$TARBALL"
14 BUILD_DEPENDS="readline-dev zlib-dev perl-dev python-dev"
15 SPLIT="libpostgresqlclient $PACKAGE-client $PACKAGE-dev $PACKAGE-doc"
17 compile_rules() {
18 sed -i '/DEFAULT_PGSOCKET_DIR/s@/tmp@/run/postgresql@' src/include/pg_config_manual.h &&
20 ./configure \
21 --enable-thread-safety \
22 --docdir=/usr/share/doc/postgresql-$VERSION \
23 --with-system-tzdata=/usr/share/zoneinfo \
24 --with-perl --with-python \
25 $CONFIGURE_ARGS &&
26 make &&
27 make install &&
28 make install-docs &&
29 make -C doc/src/sgml DESTDIR=$install install-html
30 }
32 genpkg_rules() {
33 case $PACKAGE in
34 postgresql)
35 copy bin/ postgresql/ *.so*
37 mkdir -p $fs/var/lib/pgsql $fs/var/log/postgresql $fs/etc/pgsql.d
38 cp -a $stuff/etc $fs
39 ln -s /var/lib/pgsql/postgresql.conf $fs/etc
40 chmod 700 $fs/var/lib/pgsql
42 # split
43 for i in clusterdb createdb createlang createuser dropdb droplang dropuser \
44 pg_dump pg_dumpall pg_restore psql reindexdb vacuumdb libpq.so*; do
45 find $fs -name $i -delete
46 done
47 rm -r $fs/usr/include $fs/usr/lib/postgresql/pgxs
48 DEPENDS="postgresql-client slitaz-base-files"
49 ;;
50 libpostgresqlclient)
51 CAT="misc|Advanced object-relational database management system (client libraries)"
52 copy libpq.so*
53 ;;
54 postgresql-client)
55 CAT="misc|Advanced object-relational database management system (client files)"
56 PROVIDE="mysql_or_postgresql"
57 DEPENDS="libpostgresqlclient zlib ncurses readline"
58 copy clusterdb createdb createlang createuser dropdb droplang \
59 dropuser pg_dump pg_dumpall pg_restore psql reindexdb vacuumdb
60 ;;
61 postgresql-dev)
62 CAT="development|Advanced object-relational database management system (development files)"
63 DEPENDS="postgresql"
64 copy *.h *.a *.pc pgxs/
65 ;;
66 postgresql-doc)
67 CAT="doc|Advanced object-relational database management system (documentation)"
68 copy doc/
69 ;;
70 esac
71 }
73 # Pre and post install commands for Tazpkg.
74 post_install_postgresql() {
75 # adduser postgres if needed
76 if ! grep -q postgres: "$1/etc/passwd"; then
77 action 'Adding user postgres...'
78 chroot "$1/" adduser postgres -D -H -u 88 -h /var/lib/pgsql
79 #[ -d "$1/var/lib/pgsql" ] && rm -f "$1/var/lib/pgsql"/.* "$1/var/lib/pgsql"/*
80 status
81 fi
82 # addgroup postgres if needed
83 if ! grep -q postgres: "$1/etc/group"; then
84 action 'Adding group postgres...'
85 chroot "$1/" sh -c 'addgroup -g 88 postgres'
86 status
87 fi
88 [ ! -d "$1/var/lib/pgsql" ] && mkdir -p "$1/var/lib/pgsql"
89 chroot "$1/" chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
90 [ -n "$quiet" ] || cat <<EOF
92 .---------------------------------------------------.
93 | postgres has superuser access. |
94 | Configure /var/lib/pgsql/*.conf files. |
95 |---------------------------------------------------|
96 | To start postgresql server you can run: |
97 | |
98 | /etc/init.d/postgresql start |
99 | |
100 | Or add postgresql to RUN_DAEMONS in /etc/rcS.conf |
101 '---------------------------------------------------'
102 EOF
103 }
105 post_remove_postgresql() {
106 # when both user and group have the same id# and name
107 # both group and user will get removed with either delusr/delgroup
108 chroot "$1/" deluser postgres
109 }