wok-next view postgresql/receipt @ rev 19819
gstreamer0: update for the new bison version
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Jul 29 12:09:11 2017 +0200 (2017-07-29) |
parents | 4048d48a47c1 |
children | f971bef7006e |
line source
1 # SliTaz package receipt.
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 python-dev"
17 SPLIT="libpostgresqlclient postgresql-client postgresql-doc"
19 # Rules to configure and make the package.
20 compile_rules()
21 {
22 sed -i '/DEFAULT_PGSOCKET_DIR/s@/tmp@/run/postgresql@' src/include/pg_config_manual.h &&
24 ./configure \
25 --enable-thread-safety \
26 --docdir=/usr/share/doc/postgresql-$VERSION \
27 --with-system-tzdata=/usr/share/zoneinfo \
28 --with-perl --with-python \
29 $CONFIGURE_ARGS &&
30 make && make install && make install-docs
32 make -C doc/src/sgml DESTDIR=$DESTDIR install-html
33 }
35 # Rules to gen a SliTaz package suitable for Tazpkg.
36 genpkg_rules()
37 {
38 copy bin/ postgresql/ *.so*
40 mkdir -p $fs/var/lib/pgsql $fs/var/log/postgresql $fs/etc/pgsql.d
41 cp -a $stuff/etc $fs
42 ln -s /var/lib/pgsql/postgresql.conf $fs/etc
43 chmod 700 $fs/var/lib/pgsql
45 # split
46 for i in clusterdb createdb createlang createuser dropdb droplang dropuser \
47 pg_dump pg_dumpall pg_restore psql reindexdb vacuumdb libpq.so*; do
48 find $fs -name $i -delete
49 done
50 rm -r $fs/usr/include $fs/usr/lib/postgresql/pgxs
51 }
53 # Pre and post install commands for Tazpkg.
54 post_install()
55 {
56 # adduser postgres if needed
57 if ! grep -q postgres: "$1/etc/passwd"; then
58 action 'Adding user postgres...'
59 chroot "$1/" adduser postgres -D -H -u 88 -h /var/lib/pgsql
60 #[ -d "$1/var/lib/pgsql" ] && rm -f "$1/var/lib/pgsql"/.* "$1/var/lib/pgsql"/*
61 status
62 fi
63 # addgroup postgres if needed
64 if ! grep -q postgres: "$1/etc/group"; then
65 action 'Adding group postgres...'
66 chroot "$1/" sh -c 'addgroup -g 88 postgres'
67 status
68 fi
69 [ ! -d "$1/var/lib/pgsql" ] && mkdir -p "$1/var/lib/pgsql"
70 chroot "$1/" chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
71 [ -n "$quiet" ] || cat <<EOF
72 ----
73 postgres has superuser access.
74 Configure /var/lib/pgsql/*.conf files.
75 To start $PACKAGE server you can run:
77 /etc/init.d/$PACKAGE start
79 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
80 ----
81 EOF
82 }
84 post_remove()
85 {
86 # when both user and group have the same id# and name
87 # both group and user will get removed with either delusr/delgroup
88 chroot "$1/" deluser postgres
89 }