wok-stable view postgresql/receipt @ rev 2335
Up syslinux (3.73)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Mar 01 10:56:19 2009 +0000 (2009-03-01) |
parents | 43431755fb4c |
children | ac38c3a33f71 |
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"
14 # Rules to configure and make the package.
15 compile_rules()
16 {
17 cd $src
18 [ -d ../postgrpsql-$VERSION ] && cp -a ../postgrpsql-$VERSION/* .
19 cp ../stuff/*.files-list .
20 ./configure --prefix=/usr --infodir=/usr/share/info \
21 --sysconfdir=/etc --includedir=/usr/include/postgresql --with-gnu-ld \
22 --with-includes=/usr/include/readline --enable-integer-datetimes \
23 --enable-thread-safety --with-system-tzdata=/usr/share/zoneinfo \
24 --libdir=/usr/lib/postgresql --mandir=/usr/share/man $CONFIGURE_ARGS &&
25 make &&
26 make DESTDIR=$PWD/_pkg install
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 $fs/etc/pgsql.d
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 # ensure not to overload tux user
59 sed -i 's/^postgres:x:1000:1000:/postgres:x:1001:1001:/' $1/etc/passwd
60 sed -i 's/^postgres:x:1000:/postgres:x:1001:/' $1/etc/group
61 status
62 fi
63 # addgroup postgres if needed
64 if ! grep -q postgres $1/etc/group; then
65 echo -n "Adding group postgres..."
66 chroot $1/ addgroup postgres && addgroup postgres postgres
67 status
68 fi
69 chroot $1/ chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
70 cat <<EOF
71 ----
72 postgres has superuser access.
73 Configure /var/lib/pgsql/*.conf files.
74 To start $PACKAGE server you can run :
76 /etc/init.d/$PACKAGE start
78 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
79 ----
80 EOF
81 }
83 post_remove()
84 {
85 deluser postgres
86 delgroup postgres
87 }