wok view postgresql/receipt @ rev 1319
Linux: CONFIG_HZ=1000
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Aug 28 10:01:41 2008 +0000 (2008-08-28) |
parents | 443dbfefc6bf |
children | 03a799424aaa |
line source
1 # SliTaz package receipt.
3 PACKAGE="postgresql"
4 VERSION="8.3.3"
5 CATEGORY="system"
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/v$VERSION/$TARBALL"
11 DEPENDS="postgresql-client zlib"
12 BUILD_DEPENDS="zlib-dev readline-dev ncurses-dev"
14 # Rules to configure and make the package.
15 compile_rules()
16 {
17 cd $src
18 [ -d ../postgrpsql-$VERSION ] && cp -a ../postgrpsql-$VERSION/* .
19 ./configure --prefix=/usr --infodir=/usr/share/info \
20 --sysconfdir=/etc --includedir=/usr/include/postgresql --with-gnu-ld \
21 --with-includes=/usr/include/readline --enable-integer-datetimes \
22 --enable-thread-safety --with-system-tzdata=/usr/share/zoneinfo \
23 --libdir=/usr/lib/postgresql --mandir=/usr/share/man $CONFIGURE_ARGS
24 make
25 make DESTDIR=$PWD/_pkg install
26 cp ../stuff/*.files-list .
27 }
29 # Rules to gen a SliTaz package suitable for Tazpkg.
30 genpkg_rules()
31 {
32 mkdir -p $fs/usr/share $fs/usr/lib $fs/var/lib/pgsql \
33 $fs/var/log/postgresql
34 cp -a $_pkg/usr/bin $fs/usr
35 cp -a $_pkg/usr/lib/postgresql $fs/usr/lib
36 rm -f $fs/usr/lib/postgresql/*a
37 cp -a $_pkg/usr/share/postgresql $fs/usr/share
38 cp -a stuff/etc $fs
39 ln -s /var/lib/pgsql/postgresql.conf $fs/etc
40 chmod 700 $fs/var/lib/pgsql
41 cat $src/*.files-list | while read file; do
42 [ -f $fs$file ] && rm -f $fs$file
43 done
44 # Package all pgsql pkgs
45 for i in $(cd $WOK; ls -d postgresql-* libpostgresql* )
46 do
47 tazwok genpkg $i
48 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 -h /var/lib/pgsql
58 status
59 fi
60 # addgroup postgres if needed
61 if ! grep -q postgres $1/etc/group; then
62 echo -n "Adding group postgres..."
63 chroot $1/ addgroup postgres && addgroup postgres postgres
64 status
65 fi
66 chroot $1/ chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
67 cat <<EOF
68 ----
69 postgres has superuser access.
70 Configure /var/lib/pgsql/*.conf files.
71 To start $PACKAGE server you can run :
73 /etc/init.d/$PACKAGE start
75 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
76 ----
77 EOF
78 }
80 post_remove()
81 {
82 deluser postgres
83 delgroup postgres
84 }