wok-next view postgresql/receipt @ rev 20200
libgnomeprint: add bison 3 patch
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Nov 03 17:38:15 2017 +0100 (2017-11-03) |
parents | f971bef7006e |
children | 0e7893ac206d |
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 # 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 case $PACKAGE in
39 postgresql)
40 copy bin/ postgresql/ *.so*
42 mkdir -p $fs/var/lib/pgsql $fs/var/log/postgresql $fs/etc/pgsql.d
43 cp -a $stuff/etc $fs
44 ln -s /var/lib/pgsql/postgresql.conf $fs/etc
45 chmod 700 $fs/var/lib/pgsql
47 # split
48 for i in clusterdb createdb createlang createuser dropdb droplang dropuser \
49 pg_dump pg_dumpall pg_restore psql reindexdb vacuumdb libpq.so*; do
50 find $fs -name $i -delete
51 done
52 rm -r $fs/usr/include $fs/usr/lib/postgresql/pgxs
53 ;;
54 libpostgresqlclient)
55 CAT="misc|Advanced object-relational database management system (client libraries)"
56 copy libpq.so*
57 ;;
58 postgresql-client)
59 CAT="misc|Advanced object-relational database management system (client files)"
60 PROVIDE="mysql_or_postgresql"
61 DEPENDS="libpostgresqlclient zlib ncurses readline"
62 copy clusterdb createdb createlang createuser dropdb droplang \
63 dropuser pg_dump pg_dumpall pg_restore psql reindexdb vacuumdb
64 ;;
65 postgresql-dev)
66 CAT="development|Advanced object-relational database management system (development files)"
67 DEPENDS="postgresql"
68 copy *.h *.a *.pc pgxs/
69 ;;
70 postgresql-doc)
71 CAT="doc|Advanced object-relational database management system (documentation)"
72 copy doc/
73 ;;
74 esac
75 }
77 # Pre and post install commands for Tazpkg.
78 post_install_postgresql()
79 {
80 # adduser postgres if needed
81 if ! grep -q postgres: "$1/etc/passwd"; then
82 action 'Adding user postgres...'
83 chroot "$1/" adduser postgres -D -H -u 88 -h /var/lib/pgsql
84 #[ -d "$1/var/lib/pgsql" ] && rm -f "$1/var/lib/pgsql"/.* "$1/var/lib/pgsql"/*
85 status
86 fi
87 # addgroup postgres if needed
88 if ! grep -q postgres: "$1/etc/group"; then
89 action 'Adding group postgres...'
90 chroot "$1/" sh -c 'addgroup -g 88 postgres'
91 status
92 fi
93 [ ! -d "$1/var/lib/pgsql" ] && mkdir -p "$1/var/lib/pgsql"
94 chroot "$1/" chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
95 [ -n "$quiet" ] || cat <<EOF
96 ----
97 postgres has superuser access.
98 Configure /var/lib/pgsql/*.conf files.
99 To start $PACKAGE server you can run:
101 /etc/init.d/$PACKAGE start
103 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
104 ----
105 EOF
106 }
108 post_remove_postgresql()
109 {
110 # when both user and group have the same id# and name
111 # both group and user will get removed with either delusr/delgroup
112 chroot "$1/" deluser postgres
113 }