wok-4.x view postgresql/receipt @ rev 2353
cyrus-imapd: typo in init script
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Mar 05 08:35:57 2009 +0000 (2009-03-05) |
parents | 0b5369890274 |
children | 79e6c7e5b6d3 |
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 sed -i 's/^postgres:x:1000:1000:/postgres:x:1001:1001:/' $1/etc/passwd
62 sed -i 's/^postgres:x:1000:/postgres:x:1001:/' $1/etc/group
63 status
64 fi
65 # addgroup postgres if needed
66 if ! grep -q postgres $1/etc/group; then
67 echo -n "Adding group postgres..."
68 chroot $1/ addgroup postgres && addgroup postgres postgres
69 status
70 fi
71 chroot $1/ chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
72 cat <<EOF
73 ----
74 postgres has superuser access.
75 Configure /var/lib/pgsql/*.conf files.
76 To start $PACKAGE server you can run :
78 /etc/init.d/$PACKAGE start
80 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
81 ----
82 EOF
83 }
85 post_remove()
86 {
87 deluser postgres
88 delgroup postgres
89 }