wok-next view postgresql/receipt @ rev 7923

Forgot to add GConf patches.
author Christopher Rogers <slaxemulator@gmail.com>
date Sun Jan 09 22:22:13 2011 +0000 (2011-01-09)
parents 53e1828da719
children 613cf74b3878
line source
1 # SliTaz package receipt.
3 PACKAGE="postgresql"
4 VERSION="9.0.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="http://wwwmaster.postgresql.org/redir/110/f/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=$PWD/_pkg install
30 make -C doc/src/sgml DESTDIR=$PWD/_pkg 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 strip -s $fs/usr/lib/postgresql/*.so*
41 rm -f $fs/usr/lib/postgresql/*a
42 cp -a $_pkg/usr/share/postgresql $fs/usr/share
43 cp -a stuff/etc $fs
44 ln -s /var/lib/pgsql/postgresql.conf $fs/etc
45 chmod 700 $fs/var/lib/pgsql
46 cat $src/*.files-list | while read file; do
47 [ -f $fs$file ] && rm -f $fs$file
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 rm -f /var/lib/pgsql/.* /var/lib/pgsql/*
59 # ensure not to overload tux user
60 i=1100
61 while grep -q ":$i:" $1/etc/passwd ; do i=$(( $i + 1 )); done
62 sed -i "s/^postgres:x:1000:1000:/postgres:x:$i:$i:/" $1/etc/passwd
63 sed -i "s/^postgres:x:1000:/postgres:x:$i:/" $1/etc/group
64 status
65 fi
66 # addgroup postgres if needed
67 if ! grep -q postgres $1/etc/group; then
68 echo -n "Adding group postgres..."
69 chroot $1/ sh -c 'addgroup postgres && addgroup postgres postgres'
70 status
71 fi
72 chroot $1/ chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
73 cat <<EOF
74 ----
75 postgres has superuser access.
76 Configure /var/lib/pgsql/*.conf files.
77 To start $PACKAGE server you can run :
79 /etc/init.d/$PACKAGE start
81 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
82 ----
83 EOF
84 }
86 post_remove()
87 {
88 deluser postgres
89 delgroup postgres
90 }