wok-next view postgresql/receipt @ rev 20567

xfe: update receipt; qt5: undo `fix math`
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Apr 11 01:07:35 2018 +0300 (2018-04-11)
parents 5b64ca8fb7e1
children d5aab818505e
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/"
10 DATABASE_FILES="/var/lib/pgsql"
12 TARBALL="$PACKAGE-$VERSION.tar.bz2"
13 WGET_URL="http://ftp.postgresql.org/pub/source/v$VERSION/$TARBALL"
15 DEPENDS="postgresql-client slitaz-base-files"
16 BUILD_DEPENDS="readline-dev zlib-dev perl-dev python-dev"
17 SPLIT="libpostgresqlclient postgresql-client postgresql-dev postgresql-doc"
19 compile_rules() {
20 sed -i '/DEFAULT_PGSOCKET_DIR/s@/tmp@/run/postgresql@' src/include/pg_config_manual.h &&
22 ./configure \
23 --enable-thread-safety \
24 --docdir=/usr/share/doc/postgresql-$VERSION \
25 --with-system-tzdata=/usr/share/zoneinfo \
26 --with-perl --with-python \
27 $CONFIGURE_ARGS &&
28 make && make install && make install-docs
30 make -C doc/src/sgml DESTDIR=$DESTDIR install-html
31 }
33 genpkg_rules() {
34 case $PACKAGE in
35 postgresql)
36 copy bin/ postgresql/ *.so*
38 mkdir -p $fs/var/lib/pgsql $fs/var/log/postgresql $fs/etc/pgsql.d
39 cp -a $stuff/etc $fs
40 ln -s /var/lib/pgsql/postgresql.conf $fs/etc
41 chmod 700 $fs/var/lib/pgsql
43 # split
44 for i in clusterdb createdb createlang createuser dropdb droplang dropuser \
45 pg_dump pg_dumpall pg_restore psql reindexdb vacuumdb libpq.so*; do
46 find $fs -name $i -delete
47 done
48 rm -r $fs/usr/include $fs/usr/lib/postgresql/pgxs
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 {
76 # adduser postgres if needed
77 if ! grep -q postgres: "$1/etc/passwd"; then
78 action 'Adding user postgres...'
79 chroot "$1/" adduser postgres -D -H -u 88 -h /var/lib/pgsql
80 #[ -d "$1/var/lib/pgsql" ] && rm -f "$1/var/lib/pgsql"/.* "$1/var/lib/pgsql"/*
81 status
82 fi
83 # addgroup postgres if needed
84 if ! grep -q postgres: "$1/etc/group"; then
85 action 'Adding group postgres...'
86 chroot "$1/" sh -c 'addgroup -g 88 postgres'
87 status
88 fi
89 [ ! -d "$1/var/lib/pgsql" ] && mkdir -p "$1/var/lib/pgsql"
90 chroot "$1/" chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
91 [ -n "$quiet" ] || cat <<EOF
92 ----
93 postgres has superuser access.
94 Configure /var/lib/pgsql/*.conf files.
95 To start $PACKAGE server you can run:
97 /etc/init.d/$PACKAGE start
99 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
100 ----
101 EOF
102 }
104 post_remove_postgresql() {
105 # when both user and group have the same id# and name
106 # both group and user will get removed with either delusr/delgroup
107 chroot "$1/" deluser postgres
108 }