wok annotate postgresql/receipt @ rev 8979

Add unionfs-fuse.
author Christopher Rogers <slaxemulator@gmail.com>
date Wed Mar 02 13:08:32 2011 +0000 (2011-03-02)
parents 6d8cff5d29ea
children 02bbaa9d12ba
rev   line source
pascal@1149 1 # SliTaz package receipt.
pascal@1149 2
pascal@1149 3 PACKAGE="postgresql"
slaxemulator@8309 4 VERSION="9.0.3"
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"
slaxemulator@6570 9 WEB_SITE="http://www.postgresql.org/"
slaxemulator@6570 10 WGET_URL="http://wwwmaster.postgresql.org/redir/110/f/source/v$VERSION/$TARBALL"
slaxemulator@6969 11 DEPENDS="postgresql-client slitaz-base-files"
slaxemulator@6570 12 BUILD_DEPENDS="zlib-dev readline-dev ncurses-dev bison flex perl libxslt"
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 \
slaxemulator@6570 26 --libdir=/usr/lib/postgresql --mandir=/usr/share/man \
slaxemulator@6570 27 $CONFIGURE_ARGS &&
pascal@1497 28 make &&
pascal@1149 29 make DESTDIR=$PWD/_pkg install
slaxemulator@7118 30 make -C doc/src/sgml DESTDIR=$PWD/_pkg install-html
pascal@1149 31 }
pascal@1149 32
pascal@1149 33 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1149 34 genpkg_rules()
pascal@1149 35 {
pascal@1149 36 mkdir -p $fs/usr/share $fs/usr/lib $fs/var/lib/pgsql \
pascal@1967 37 $fs/var/log/postgresql $fs/etc/pgsql.d
pascal@1149 38 cp -a $_pkg/usr/bin $fs/usr
pascal@1149 39 cp -a $_pkg/usr/lib/postgresql $fs/usr/lib
pascal@2775 40 strip -s $fs/usr/lib/postgresql/*.so*
pascal@1149 41 rm -f $fs/usr/lib/postgresql/*a
pascal@1149 42 cp -a $_pkg/usr/share/postgresql $fs/usr/share
pascal@1149 43 cp -a stuff/etc $fs
pascal@1149 44 ln -s /var/lib/pgsql/postgresql.conf $fs/etc
pascal@1149 45 chmod 700 $fs/var/lib/pgsql
slaxemulator@8646 46 cat $WOK/$PACKAGE/stuff/*.files-list | while read file; do
pascal@1149 47 [ -f $fs$file ] && rm -f $fs$file
pascal@1149 48 done
slaxemulator@8646 49
pascal@1149 50 }
pascal@1149 51
pascal@1149 52 # Pre and post install commands for Tazpkg.
pascal@1149 53 post_install()
pascal@1149 54 {
pascal@1149 55 # adduser postgres if needed
slaxemulator@8646 56 if ! grep -q postgres: $1/etc/passwd; then
pascal@1149 57 echo -n "Adding user postgres..."
slaxemulator@7962 58 chroot $1/ adduser postgres -D -H -u 88 -h /var/lib/pgsql
slaxemulator@8646 59 #[ -d $1/var/lib/pgsql ] && rm -f $1/var/lib/pgsql/.* $1/var/lib/pgsql/*
pascal@1149 60 status
pascal@1149 61 fi
pascal@1149 62 # addgroup postgres if needed
slaxemulator@8646 63 if ! grep -q postgres: $1/etc/group; then
pascal@1149 64 echo -n "Adding group postgres..."
slaxemulator@8646 65 chroot $1/ sh -c 'addgroup -g 88 postgres'
pascal@1149 66 status
pascal@1149 67 fi
slaxemulator@8646 68 [ ! -d $1/var/lib/pgsql ] && mkdir -p $1/var/lib/pgsql
pascal@1149 69 chroot $1/ chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
pascal@1149 70 cat <<EOF
pascal@1149 71 ----
pascal@1152 72 postgres has superuser access.
pascal@1152 73 Configure /var/lib/pgsql/*.conf files.
pascal@1149 74 To start $PACKAGE server you can run :
pascal@1149 75
pascal@1149 76 /etc/init.d/$PACKAGE start
pascal@1149 77
pascal@1149 78 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
pascal@1149 79 ----
pascal@1149 80 EOF
pascal@1149 81 }
pascal@1149 82
pascal@1149 83 post_remove()
pascal@1149 84 {
slaxemulator@8646 85 # when both user and group have the same id# and name
slaxemulator@8646 86 # both group and user will get removed with either delusr/delgroup
slaxemulator@8645 87 chroot $1/ deluser postgres
pascal@1149 88 }