wok diff postgresql/receipt @ rev 1149

Add postgresql
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Jul 26 14:23:50 2008 +0000 (2008-07-26)
parents
children dd2aa8326cbc
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/postgresql/receipt	Sat Jul 26 14:23:50 2008 +0000
     1.3 @@ -0,0 +1,82 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="postgresql"
     1.7 +VERSION="8.3.3"
     1.8 +CATEGORY="system"
     1.9 +SHORT_DESC="SQL database system."
    1.10 +MAINTAINER="pascal.bellard@slitaz.org"
    1.11 +TARBALL="$PACKAGE-$VERSION.tar.bz2"
    1.12 +WEB_SITE="http://www.pgsql.com/"
    1.13 +WGET_URL="ftp://ftp.fr.postgresql.org/v$VERSION/$TARBALL"
    1.14 +DEPENDS="postgresql-client zlib"
    1.15 +BUILD_DEPENDS="zlib-dev readline-dev ncurses-dev"
    1.16 +
    1.17 +# Rules to configure and make the package.
    1.18 +compile_rules()
    1.19 +{
    1.20 +	cd $src
    1.21 +	[ -d ../postgrpsql-$VERSION ] && cp -a ../postgrpsql-$VERSION/* .
    1.22 +	./configure --prefix=/usr --infodir=/usr/share/info \
    1.23 +	--sysconfdir=/etc --includedir=/usr/include/postgresql --with-gnu-ld \
    1.24 +	--with-includes=/usr/include/readline --enable-integer-datetimes \
    1.25 +	--enable-thread-safety --with-system-tzdata=/usr/share/zoneinfo \
    1.26 +	--libdir=/usr/lib/postgresql --mandir=/usr/share/man $CONFIGURE_ARGS
    1.27 +	make
    1.28 +	make DESTDIR=$PWD/_pkg install
    1.29 +	cp ../stuff/*.files-list .
    1.30 +}
    1.31 +
    1.32 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.33 +genpkg_rules()
    1.34 +{
    1.35 +	mkdir -p $fs/usr/share $fs/usr/lib $fs/var/lib/pgsql \
    1.36 +		 $fs/var/log/postgresql
    1.37 +	cp -a $_pkg/usr/bin $fs/usr
    1.38 +	cp -a $_pkg/usr/lib/postgresql $fs/usr/lib
    1.39 +	rm -f $fs/usr/lib/postgresql/*a
    1.40 +	cp -a $_pkg/usr/share/postgresql $fs/usr/share
    1.41 +	cp -a stuff/etc $fs
    1.42 +	ln -s /var/lib/pgsql/postgresql.conf $fs/etc
    1.43 +	chmod 700 $fs/var/lib/pgsql
    1.44 +	cat $src/*.files-list | while read file; do
    1.45 +		[ -f $fs$file ] && rm -f $fs$file
    1.46 +	done
    1.47 +	# Package all pgsql pkgs
    1.48 +	for i in $(cd $WOK; ls -d postgresql-* libpostgresql* )
    1.49 +	do
    1.50 +		tazwok genpkg $i
    1.51 +	done
    1.52 +}
    1.53 +
    1.54 +# Pre and post install commands for Tazpkg.
    1.55 +post_install()
    1.56 +{
    1.57 +        # adduser postgres if needed
    1.58 +	if ! grep -q postgres $1/etc/passwd; then
    1.59 +		echo -n "Adding user postgres..."
    1.60 +		chroot $1/ adduser postgres -D -H -h /var/lib/pgsql
    1.61 +		status
    1.62 +	fi
    1.63 +	# addgroup postgres if needed
    1.64 +	if ! grep -q postgres $1/etc/group; then
    1.65 +		echo -n "Adding group postgres..."
    1.66 +		chroot $1/ addgroup postgres && addgroup postgres postgres
    1.67 +		status
    1.68 +	fi
    1.69 +	chroot $1/ chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
    1.70 +	cat <<EOF
    1.71 +----
    1.72 +To start $PACKAGE server you can run :
    1.73 +
    1.74 +    /etc/init.d/$PACKAGE start
    1.75 +
    1.76 +Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
    1.77 +----
    1.78 +EOF
    1.79 +}
    1.80 +
    1.81 +post_remove()
    1.82 +{
    1.83 +	deluser postgres
    1.84 +	delgroup postgres
    1.85 +}