wok-current view postgresql/receipt @ rev 2432

wormux, wv, wxWidgets-dev, wxWidgets: update depends
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Mar 12 15:32:16 2009 +0000 (2009-03-12)
parents 79e6c7e5b6d3
children 807ed3221739
line source
1 # SliTaz package receipt.
3 PACKAGE="postgresql"
4 VERSION="8.3.4"
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.pgsql.com/"
10 WGET_URL="ftp://ftp.fr.postgresql.org/source/v$VERSION/$TARBALL"
11 DEPENDS="postgresql-client zlib slitaz-base-files"
12 BUILD_DEPENDS="zlib-dev readline-dev ncurses-dev"
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 $CONFIGURE_ARGS &&
27 make &&
28 make DESTDIR=$PWD/_pkg install
29 }
31 # Rules to gen a SliTaz package suitable for Tazpkg.
32 genpkg_rules()
33 {
34 mkdir -p $fs/usr/share $fs/usr/lib $fs/var/lib/pgsql \
35 $fs/var/log/postgresql $fs/etc/pgsql.d
36 cp -a $_pkg/usr/bin $fs/usr
37 cp -a $_pkg/usr/lib/postgresql $fs/usr/lib
38 rm -f $fs/usr/lib/postgresql/*a
39 cp -a $_pkg/usr/share/postgresql $fs/usr/share
40 cp -a stuff/etc $fs
41 ln -s /var/lib/pgsql/postgresql.conf $fs/etc
42 chmod 700 $fs/var/lib/pgsql
43 cat $src/*.files-list | while read file; do
44 [ -f $fs$file ] && rm -f $fs$file
45 done
46 # Package all pgsql pkgs
47 for i in $(cd $WOK; ls -d postgresql-* libpostgresql* )
48 do
49 tazwok genpkg $i
50 done
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 echo -n "Adding user postgres..."
59 chroot $1/ adduser postgres -D -H -h /var/lib/pgsql
60 # ensure not to overload tux user
61 i=1100
62 while grep -q ":$i:" $1/etc/passwd ; do i=$(( $i + 1 )); done
63 sed -i "s/^postgres:x:1000:1000:/postgres:x:$i:$i:/" $1/etc/passwd
64 sed -i "s/^postgres:x:1000:/postgres:x:$i:/" $1/etc/group
65 status
66 fi
67 # addgroup postgres if needed
68 if ! grep -q postgres $1/etc/group; then
69 echo -n "Adding group postgres..."
70 chroot $1/ sh -c 'addgroup postgres && addgroup postgres postgres'
71 status
72 fi
73 chroot $1/ chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
74 cat <<EOF
75 ----
76 postgres has superuser access.
77 Configure /var/lib/pgsql/*.conf files.
78 To start $PACKAGE server you can run :
80 /etc/init.d/$PACKAGE start
82 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
83 ----
84 EOF
85 }
87 post_remove()
88 {
89 deluser postgres
90 delgroup postgres
91 }