wok-current annotate postgresql/receipt @ rev 14168

opencore-amr: fix MAINTAINER
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Mar 08 11:32:57 2013 +0100 (2013-03-08)
parents 88d4d9467097
children 51a1ebbda768
rev   line source
pascal@1149 1 # SliTaz package receipt.
pascal@1149 2
pascal@1149 3 PACKAGE="postgresql"
pascal@14029 4 VERSION="9.2.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@11412 10 WGET_URL="ftp://ftp.postgresql.org/pub/source/v$VERSION/$TARBALL"
pascal@2347 11 CONFIG_FILES="/var/lib/pgsql/*.conf"
pascal@2347 12 DATABASE_FILES="/var/lib/pgsql"
pascal@1149 13
pascal@13320 14 DEPENDS="postgresql-client slitaz-base-files"
pascal@13320 15 BUILD_DEPENDS="zlib-dev readline-dev ncurses-dev bison flex perl libxslt \
pascal@13320 16 python-dev"
pascal@13320 17
pascal@1149 18 # Rules to configure and make the package.
pascal@1149 19 compile_rules()
pascal@1149 20 {
pascal@1149 21 cd $src
pascal@1149 22 [ -d ../postgrpsql-$VERSION ] && cp -a ../postgrpsql-$VERSION/* .
slaxemulator@9700 23 cp $stuff/*.files-list .
pascal@1149 24 ./configure --prefix=/usr --infodir=/usr/share/info \
pascal@1149 25 --sysconfdir=/etc --includedir=/usr/include/postgresql --with-gnu-ld \
pascal@1149 26 --with-includes=/usr/include/readline --enable-integer-datetimes \
pascal@13320 27 --with-perl --with-python \
pascal@1149 28 --enable-thread-safety --with-system-tzdata=/usr/share/zoneinfo \
slaxemulator@6570 29 --libdir=/usr/lib/postgresql --mandir=/usr/share/man \
slaxemulator@6570 30 $CONFIGURE_ARGS &&
pascal@1497 31 make &&
slaxemulator@11412 32 make DESTDIR=$DESTDIR install
slaxemulator@11412 33 make -C doc/src/sgml DESTDIR=$DESTDIR install-html
pascal@1149 34 }
pascal@1149 35
pascal@1149 36 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1149 37 genpkg_rules()
pascal@1149 38 {
pascal@1149 39 mkdir -p $fs/usr/share $fs/usr/lib $fs/var/lib/pgsql \
pascal@1967 40 $fs/var/log/postgresql $fs/etc/pgsql.d
pascal@13320 41 cp -a $install/usr/bin $fs/usr
pascal@13320 42 cp -a $install/usr/lib/postgresql $fs/usr/lib
pascal@1149 43 rm -f $fs/usr/lib/postgresql/*a
pascal@13320 44 cp -a $install/usr/share/postgresql $fs/usr/share
slaxemulator@9701 45 cp -a $stuff/etc $fs
pascal@1149 46 ln -s /var/lib/pgsql/postgresql.conf $fs/etc
pascal@1149 47 chmod 700 $fs/var/lib/pgsql
slaxemulator@9701 48 cat $stuff/*.files-list | while read file; do
pascal@1149 49 [ -f $fs$file ] && rm -f $fs$file
pascal@1149 50 done
slaxemulator@8646 51
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
slaxemulator@8646 58 if ! grep -q postgres: $1/etc/passwd; then
pascal@1149 59 echo -n "Adding user postgres..."
slaxemulator@7962 60 chroot $1/ adduser postgres -D -H -u 88 -h /var/lib/pgsql
slaxemulator@8646 61 #[ -d $1/var/lib/pgsql ] && rm -f $1/var/lib/pgsql/.* $1/var/lib/pgsql/*
pascal@1149 62 status
pascal@1149 63 fi
pascal@1149 64 # addgroup postgres if needed
slaxemulator@8646 65 if ! grep -q postgres: $1/etc/group; then
pascal@1149 66 echo -n "Adding group postgres..."
slaxemulator@8646 67 chroot $1/ sh -c 'addgroup -g 88 postgres'
pascal@1149 68 status
pascal@1149 69 fi
slaxemulator@8646 70 [ ! -d $1/var/lib/pgsql ] && mkdir -p $1/var/lib/pgsql
pascal@1149 71 chroot $1/ chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
pascal@1149 72 cat <<EOF
pascal@1149 73 ----
pascal@1152 74 postgres has superuser access.
pascal@1152 75 Configure /var/lib/pgsql/*.conf files.
pascal@1149 76 To start $PACKAGE server you can run :
pascal@1149 77
pascal@1149 78 /etc/init.d/$PACKAGE start
pascal@1149 79
pascal@1149 80 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
pascal@1149 81 ----
pascal@1149 82 EOF
pascal@1149 83 }
pascal@1149 84
pascal@1149 85 post_remove()
pascal@1149 86 {
slaxemulator@8646 87 # when both user and group have the same id# and name
slaxemulator@8646 88 # both group and user will get removed with either delusr/delgroup
slaxemulator@8645 89 chroot $1/ deluser postgres
pascal@1149 90 }