wok-6.x annotate postgresql/receipt @ rev 5801

Speedup some builds
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Jul 11 15:49:06 2010 +0200 (2010-07-11)
parents d6700680fb11
children d82443087752
rev   line source
pascal@1149 1 # SliTaz package receipt.
pascal@1149 2
pascal@1149 3 PACKAGE="postgresql"
erjo@4640 4 VERSION="8.3.9"
pascal@1506 5 CATEGORY="misc"
pascal@1149 6 SHORT_DESC="SQL database system."
pascal@1149 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@1149 8 TARBALL="$PACKAGE-$VERSION.tar.bz2"
pascal@1149 9 WEB_SITE="http://www.pgsql.com/"
pascal@2210 10 WGET_URL="ftp://ftp.fr.postgresql.org/source/v$VERSION/$TARBALL"
pascal@1977 11 DEPENDS="postgresql-client zlib slitaz-base-files"
pascal@1149 12 BUILD_DEPENDS="zlib-dev readline-dev ncurses-dev"
pascal@2347 13 CONFIG_FILES="/var/lib/pgsql/*.conf"
pascal@2347 14 DATABASE_FILES="/var/lib/pgsql"
pascal@1149 15
pascal@1149 16 # Rules to configure and make the package.
pascal@1149 17 compile_rules()
pascal@1149 18 {
pascal@1149 19 cd $src
pascal@1149 20 [ -d ../postgrpsql-$VERSION ] && cp -a ../postgrpsql-$VERSION/* .
pascal@1497 21 cp ../stuff/*.files-list .
pascal@1149 22 ./configure --prefix=/usr --infodir=/usr/share/info \
pascal@1149 23 --sysconfdir=/etc --includedir=/usr/include/postgresql --with-gnu-ld \
pascal@1149 24 --with-includes=/usr/include/readline --enable-integer-datetimes \
pascal@1149 25 --enable-thread-safety --with-system-tzdata=/usr/share/zoneinfo \
pascal@1497 26 --libdir=/usr/lib/postgresql --mandir=/usr/share/man $CONFIGURE_ARGS &&
pascal@1497 27 make &&
pascal@1149 28 make DESTDIR=$PWD/_pkg install
pascal@1149 29 }
pascal@1149 30
pascal@1149 31 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1149 32 genpkg_rules()
pascal@1149 33 {
pascal@1149 34 mkdir -p $fs/usr/share $fs/usr/lib $fs/var/lib/pgsql \
pascal@1967 35 $fs/var/log/postgresql $fs/etc/pgsql.d
pascal@1149 36 cp -a $_pkg/usr/bin $fs/usr
pascal@1149 37 cp -a $_pkg/usr/lib/postgresql $fs/usr/lib
pascal@2775 38 strip -s $fs/usr/lib/postgresql/*.so*
pascal@1149 39 rm -f $fs/usr/lib/postgresql/*a
pascal@1149 40 cp -a $_pkg/usr/share/postgresql $fs/usr/share
pascal@1149 41 cp -a stuff/etc $fs
pascal@1149 42 ln -s /var/lib/pgsql/postgresql.conf $fs/etc
pascal@1149 43 chmod 700 $fs/var/lib/pgsql
pascal@1149 44 cat $src/*.files-list | while read file; do
pascal@1149 45 [ -f $fs$file ] && rm -f $fs$file
pascal@1149 46 done
pascal@1149 47 # Package all pgsql pkgs
pascal@1149 48 for i in $(cd $WOK; ls -d postgresql-* libpostgresql* )
pascal@1149 49 do
pascal@1149 50 tazwok genpkg $i
pascal@1149 51 done
pascal@1149 52 }
pascal@1149 53
pascal@1149 54 # Pre and post install commands for Tazpkg.
pascal@1149 55 post_install()
pascal@1149 56 {
pascal@1149 57 # adduser postgres if needed
pascal@1149 58 if ! grep -q postgres $1/etc/passwd; then
pascal@1149 59 echo -n "Adding user postgres..."
pascal@1149 60 chroot $1/ adduser postgres -D -H -h /var/lib/pgsql
pascal@5748 61 rm -f /var/lib/pgsql/.* /var/lib/pgsql/*
pascal@1425 62 # ensure not to overload tux user
pascal@2392 63 i=1100
pascal@2392 64 while grep -q ":$i:" $1/etc/passwd ; do i=$(( $i + 1 )); done
pascal@2392 65 sed -i "s/^postgres:x:1000:1000:/postgres:x:$i:$i:/" $1/etc/passwd
pascal@2392 66 sed -i "s/^postgres:x:1000:/postgres:x:$i:/" $1/etc/group
pascal@1149 67 status
pascal@1149 68 fi
pascal@1149 69 # addgroup postgres if needed
pascal@1149 70 if ! grep -q postgres $1/etc/group; then
pascal@1149 71 echo -n "Adding group postgres..."
pascal@2369 72 chroot $1/ sh -c 'addgroup postgres && addgroup postgres postgres'
pascal@1149 73 status
pascal@1149 74 fi
pascal@1149 75 chroot $1/ chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
pascal@1149 76 cat <<EOF
pascal@1149 77 ----
pascal@1152 78 postgres has superuser access.
pascal@1152 79 Configure /var/lib/pgsql/*.conf files.
pascal@1149 80 To start $PACKAGE server you can run :
pascal@1149 81
pascal@1149 82 /etc/init.d/$PACKAGE start
pascal@1149 83
pascal@1149 84 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
pascal@1149 85 ----
pascal@1149 86 EOF
pascal@1149 87 }
pascal@1149 88
pascal@1149 89 post_remove()
pascal@1149 90 {
pascal@1149 91 deluser postgres
pascal@1149 92 delgroup postgres
pascal@1149 93 }