wok-6.x view postgresql/receipt @ rev 12262
Up: gmp (5.0.4) First new pkg used by new toolchain
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Wed Apr 11 17:36:00 2012 +0200 (2012-04-11) |
parents | 7c5937702175 |
children | 88d4d9467097 |
line source
1 # SliTaz package receipt.
3 PACKAGE="postgresql"
4 VERSION="9.1.2"
5 CATEGORY="misc"
6 SHORT_DESC="SQL database system."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.bz2"
9 WEB_SITE="http://www.postgresql.org/"
10 WGET_URL="ftp://ftp.postgresql.org/pub/source/v$VERSION/$TARBALL"
11 DEPENDS="postgresql-client slitaz-base-files"
12 BUILD_DEPENDS="zlib-dev readline-dev ncurses-dev bison flex perl libxslt"
13 CONFIG_FILES="/var/lib/pgsql/*.conf"
14 DATABASE_FILES="/var/lib/pgsql"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
19 cd $src
20 [ -d ../postgrpsql-$VERSION ] && cp -a ../postgrpsql-$VERSION/* .
21 cp $stuff/*.files-list .
22 ./configure --prefix=/usr --infodir=/usr/share/info \
23 --sysconfdir=/etc --includedir=/usr/include/postgresql --with-gnu-ld \
24 --with-includes=/usr/include/readline --enable-integer-datetimes \
25 --enable-thread-safety --with-system-tzdata=/usr/share/zoneinfo \
26 --libdir=/usr/lib/postgresql --mandir=/usr/share/man \
27 $CONFIGURE_ARGS &&
28 make &&
29 make DESTDIR=$DESTDIR install
30 make -C doc/src/sgml DESTDIR=$DESTDIR install-html
31 }
33 # Rules to gen a SliTaz package suitable for Tazpkg.
34 genpkg_rules()
35 {
36 mkdir -p $fs/usr/share $fs/usr/lib $fs/var/lib/pgsql \
37 $fs/var/log/postgresql $fs/etc/pgsql.d
38 cp -a $_pkg/usr/bin $fs/usr
39 cp -a $_pkg/usr/lib/postgresql $fs/usr/lib
40 rm -f $fs/usr/lib/postgresql/*a
41 cp -a $_pkg/usr/share/postgresql $fs/usr/share
42 cp -a $stuff/etc $fs
43 ln -s /var/lib/pgsql/postgresql.conf $fs/etc
44 chmod 700 $fs/var/lib/pgsql
45 cat $stuff/*.files-list | while read file; do
46 [ -f $fs$file ] && rm -f $fs$file
47 done
49 }
51 # Pre and post install commands for Tazpkg.
52 post_install()
53 {
54 # adduser postgres if needed
55 if ! grep -q postgres: $1/etc/passwd; then
56 echo -n "Adding user postgres..."
57 chroot $1/ adduser postgres -D -H -u 88 -h /var/lib/pgsql
58 #[ -d $1/var/lib/pgsql ] && rm -f $1/var/lib/pgsql/.* $1/var/lib/pgsql/*
59 status
60 fi
61 # addgroup postgres if needed
62 if ! grep -q postgres: $1/etc/group; then
63 echo -n "Adding group postgres..."
64 chroot $1/ sh -c 'addgroup -g 88 postgres'
65 status
66 fi
67 [ ! -d $1/var/lib/pgsql ] && mkdir -p $1/var/lib/pgsql
68 chroot $1/ chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
69 cat <<EOF
70 ----
71 postgres has superuser access.
72 Configure /var/lib/pgsql/*.conf files.
73 To start $PACKAGE server you can run :
75 /etc/init.d/$PACKAGE start
77 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
78 ----
79 EOF
80 }
82 post_remove()
83 {
84 # when both user and group have the same id# and name
85 # both group and user will get removed with either delusr/delgroup
86 chroot $1/ deluser postgres
87 }