wok view postgresql/receipt @ rev 13368
libxml2: re-add to ARM arch (please dont remove arch specif code)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Sep 14 10:30:21 2012 +0200 (2012-09-14) |
parents | 5b21efe08bd3 |
children | e1defd13e80a |
line source
1 # SliTaz package receipt.
3 PACKAGE="postgresql"
4 VERSION="9.1.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="ftp://ftp.postgresql.org/pub/source/v$VERSION/$TARBALL"
11 CONFIG_FILES="/var/lib/pgsql/*.conf"
12 DATABASE_FILES="/var/lib/pgsql"
14 DEPENDS="postgresql-client slitaz-base-files"
15 BUILD_DEPENDS="zlib-dev readline-dev ncurses-dev bison flex perl libxslt \
16 python-dev"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 cd $src
22 [ -d ../postgrpsql-$VERSION ] && cp -a ../postgrpsql-$VERSION/* .
23 cp $stuff/*.files-list .
24 ./configure --prefix=/usr --infodir=/usr/share/info \
25 --sysconfdir=/etc --includedir=/usr/include/postgresql --with-gnu-ld \
26 --with-includes=/usr/include/readline --enable-integer-datetimes \
27 --with-perl --with-python \
28 --enable-thread-safety --with-system-tzdata=/usr/share/zoneinfo \
29 --libdir=/usr/lib/postgresql --mandir=/usr/share/man \
30 $CONFIGURE_ARGS &&
31 make &&
32 make DESTDIR=$DESTDIR install
33 make -C doc/src/sgml DESTDIR=$DESTDIR install-html
34 }
36 # Rules to gen a SliTaz package suitable for Tazpkg.
37 genpkg_rules()
38 {
39 mkdir -p $fs/usr/share $fs/usr/lib $fs/var/lib/pgsql \
40 $fs/var/log/postgresql $fs/etc/pgsql.d
41 cp -a $install/usr/bin $fs/usr
42 cp -a $install/usr/lib/postgresql $fs/usr/lib
43 rm -f $fs/usr/lib/postgresql/*a
44 cp -a $install/usr/share/postgresql $fs/usr/share
45 cp -a $stuff/etc $fs
46 ln -s /var/lib/pgsql/postgresql.conf $fs/etc
47 chmod 700 $fs/var/lib/pgsql
48 cat $stuff/*.files-list | while read file; do
49 [ -f $fs$file ] && rm -f $fs$file
50 done
52 }
54 # Pre and post install commands for Tazpkg.
55 post_install()
56 {
57 # adduser postgres if needed
58 if ! grep -q postgres: $1/etc/passwd; then
59 echo -n "Adding user postgres..."
60 chroot $1/ adduser postgres -D -H -u 88 -h /var/lib/pgsql
61 #[ -d $1/var/lib/pgsql ] && rm -f $1/var/lib/pgsql/.* $1/var/lib/pgsql/*
62 status
63 fi
64 # addgroup postgres if needed
65 if ! grep -q postgres: $1/etc/group; then
66 echo -n "Adding group postgres..."
67 chroot $1/ sh -c 'addgroup -g 88 postgres'
68 status
69 fi
70 [ ! -d $1/var/lib/pgsql ] && mkdir -p $1/var/lib/pgsql
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 # when both user and group have the same id# and name
88 # both group and user will get removed with either delusr/delgroup
89 chroot $1/ deluser postgres
90 }