wok-current view postgresql/receipt @ rev 6664
Revert last patch on gdk-pixbuf.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Mon Oct 11 22:51:08 2010 +0000 (2010-10-11) |
parents | 609498d2778d |
children | 1d3e6ad05525 |
line source
1 # SliTaz package receipt.
3 PACKAGE="postgresql"
4 VERSION="9.0.1"
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 zlib 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 }
32 # Rules to gen a SliTaz package suitable for Tazpkg.
33 genpkg_rules()
34 {
35 mkdir -p $fs/usr/share $fs/usr/lib $fs/var/lib/pgsql \
36 $fs/var/log/postgresql $fs/etc/pgsql.d
37 cp -a $_pkg/usr/bin $fs/usr
38 cp -a $_pkg/usr/lib/postgresql $fs/usr/lib
39 strip -s $fs/usr/lib/postgresql/*.so*
40 rm -f $fs/usr/lib/postgresql/*a
41 cp -a $_pkg/usr/share/postgresql $fs/usr/share
42 cp -a stuff/etc $fs
43 ln -s /var/lib/pgsql/postgresql.conf $fs/etc
44 chmod 700 $fs/var/lib/pgsql
45 cat $src/*.files-list | while read file; do
46 [ -f $fs$file ] && rm -f $fs$file
47 done
48 # Package all pgsql pkgs
49 for i in $(cd $WOK; ls -d postgresql-* libpostgresql* )
50 do
51 tazwok genpkg $i
52 done
53 }
55 # Pre and post install commands for Tazpkg.
56 post_install()
57 {
58 # adduser postgres if needed
59 if ! grep -q postgres $1/etc/passwd; then
60 echo -n "Adding user postgres..."
61 chroot $1/ adduser postgres -D -H -h /var/lib/pgsql
62 rm -f /var/lib/pgsql/.* /var/lib/pgsql/*
63 # ensure not to overload tux user
64 i=1100
65 while grep -q ":$i:" $1/etc/passwd ; do i=$(( $i + 1 )); done
66 sed -i "s/^postgres:x:1000:1000:/postgres:x:$i:$i:/" $1/etc/passwd
67 sed -i "s/^postgres:x:1000:/postgres:x:$i:/" $1/etc/group
68 status
69 fi
70 # addgroup postgres if needed
71 if ! grep -q postgres $1/etc/group; then
72 echo -n "Adding group postgres..."
73 chroot $1/ sh -c 'addgroup postgres && addgroup postgres postgres'
74 status
75 fi
76 chroot $1/ chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
77 cat <<EOF
78 ----
79 postgres has superuser access.
80 Configure /var/lib/pgsql/*.conf files.
81 To start $PACKAGE server you can run :
83 /etc/init.d/$PACKAGE start
85 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
86 ----
87 EOF
88 }
90 post_remove()
91 {
92 deluser postgres
93 delgroup postgres
94 }