wok rev 1149

Add postgresql
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Jul 26 14:23:50 2008 +0000 (2008-07-26)
parents 14dc2f353733
children 0e7de63eb2cb
files libpostgresqlclient/receipt php-pgsql/receipt php/receipt phppgadmin/receipt postgresql-client/receipt postgresql-dev/receipt postgresql-doc/receipt postgresql/receipt postgresql/stuff/etc/init.d/postgresql postgresql/stuff/etc/logrotate.d/postgresql postgresql/stuff/libpostgresqlclient.files-list postgresql/stuff/postgresql-client.files-list
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libpostgresqlclient/receipt	Sat Jul 26 14:23:50 2008 +0000
     1.3 @@ -0,0 +1,20 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="libpostgresqlclient"
     1.7 +VERSION="8.3.3"
     1.8 +CATEGORY="system"
     1.9 +SHORT_DESC="SQL database system libraries."
    1.10 +MAINTAINER="pascal.bellard@slitaz.org"
    1.11 +WEB_SITE="http://www.pgsql.com/"
    1.12 +WANTED="postgresql"
    1.13 +
    1.14 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.15 +genpkg_rules()
    1.16 +{
    1.17 +	while read file; do
    1.18 +		dir=$(dirname $file)
    1.19 +		[ -d $fs$dir ] || mkdir -p $fs$dir
    1.20 +		cp -a $_pkg$file $fs$file
    1.21 +	done < $src/$PACKAGE.files-list
    1.22 +}
    1.23 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/php-pgsql/receipt	Sat Jul 26 14:23:50 2008 +0000
     2.3 @@ -0,0 +1,37 @@
     2.4 +# SliTaz package receipt.
     2.5 +
     2.6 +PACKAGE="php-pgsql"
     2.7 +VERSION="5.2.5"
     2.8 +CATEGORY="development"
     2.9 +SHORT_DESC="postgresql module for PHP web programming language."
    2.10 +MAINTAINER="pascal.bellard@slitaz.org"
    2.11 +DEPENDS="postgresql php"
    2.12 +WEB_SITE="http://www.php.net/"
    2.13 +WANTED="php"
    2.14 +
    2.15 +# Rules to gen a SliTaz package suitable for Tazpkg.
    2.16 +genpkg_rules()
    2.17 +{
    2.18 +	mkdir -p $fs/usr/share/php
    2.19 +	cp $(find $_pkg | grep pgsql.so) $fs/usr/share/php/
    2.20 +}
    2.21 +
    2.22 +# Post and pre install commans to stop
    2.23 +# and restart Web server if needed.
    2.24 +pre_install()
    2.25 +{
    2.26 +	if [ -z "$1" -a -f "/var/run/lighttpd.pid" ]; then
    2.27 +		/etc/init.d/lighttpd stop
    2.28 +	fi
    2.29 +}
    2.30 +
    2.31 +post_install()
    2.32 +{
    2.33 +	grep -q ^extension=msql.so $1/etc/php.ini || \
    2.34 +	    sed -e 's|;.*extension=msql.so|;   extension=msql.so\nextension=pgsql.so|' -i $1/etc/php.ini
    2.35 +	# Start Web server.
    2.36 +	if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
    2.37 +		/etc/init.d/lighttpd start
    2.38 +	fi
    2.39 +}
    2.40 +
     3.1 --- a/php/receipt	Sat Jul 26 13:42:32 2008 +0000
     3.2 +++ b/php/receipt	Sat Jul 26 14:23:50 2008 +0000
     3.3 @@ -6,7 +6,7 @@
     3.4  SHORT_DESC="PHP web programming language."
     3.5  MAINTAINER="pankso@slitaz.org"
     3.6  DEPENDS="lighttpd zlib libxml2 sqlite"
     3.7 -BUILD_DEPENDS="sqlite-dev libxml2-dev zlib-dev mysql-dev"
     3.8 +BUILD_DEPENDS="sqlite-dev libxml2-dev zlib-dev mysql-dev postgresql postgresql-dev"
     3.9  TARBALL="$PACKAGE-$VERSION.tar.bz2"
    3.10  WEB_SITE="http://www.php.net/"
    3.11  WGET_URL="http://us2.php.net/distributions/$TARBALL"
    3.12 @@ -27,6 +27,7 @@
    3.13  		--with-config-file-path=/etc \
    3.14  		--with-zlib \
    3.15  		--with-mysql=shared,usr \
    3.16 +		--with-pgsql=shared,usr \
    3.17  		--disable-cli \
    3.18  		$CONFIGURE_ARGS
    3.19  	make
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/phppgadmin/receipt	Sat Jul 26 14:23:50 2008 +0000
     4.3 @@ -0,0 +1,45 @@
     4.4 +# SliTaz package receipt.
     4.5 +
     4.6 +PACKAGE="phppgadmin"
     4.7 +VERSION="4.2"
     4.8 +CATEGORY="misc"
     4.9 +SHORT_DESC="Administration of postgresql over the Web."
    4.10 +MAINTAINER="pascal.bellard@slitaz.org"
    4.11 +SOURCE="phpPgAdmin"
    4.12 +TARBALL="$SOURCE-$VERSION.tar.bz2"
    4.13 +WEB_SITE="http://$PACKAGE.sourceforge.net/"
    4.14 +WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
    4.15 +DEPENDS="php-pgsql"
    4.16 +
    4.17 +# Rules to configure and make the package.
    4.18 +compile_rules()
    4.19 +{
    4.20 +	echo "$src compiled..."
    4.21 +}
    4.22 +
    4.23 +# Rules to gen a SliTaz package suitable for Tazpkg.
    4.24 +genpkg_rules()
    4.25 +{
    4.26 +	mkdir -p $fs/usr/share/phppgadmin $fs/etc
    4.27 +	cp -a $src/. $fs/usr/share/phppgadmin
    4.28 +	mv $fs/usr/share/phppgadmin/conf $fs/etc/phppgadmin
    4.29 +	ln -s /etc/phppgadmin $fs/usr/share/phppgadmin/conf
    4.30 +	chown -R www.www $fs/usr/share/phppgadmin $fs/etc/phppgadmin
    4.31 +	chmod 700 $fs/etc/phppgadmin
    4.32 +	chmod 600 $fs/etc/phppgadmin/*
    4.33 +}
    4.34 +
    4.35 +post_install()
    4.36 +{
    4.37 +	if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
    4.38 +		if ! grep -q /usr/share/phppgadmin/ $1/etc/lighttpd/lighttpd.conf; then
    4.39 +	    		sed -e 's|.*"/examples/" => "/usr/share/examples/",|    "/examples/" => "/usr/share/examples/",\n    "/phppgadmin/" => "/usr/share/phppgadmin/",|g' -i $1/etc/lighttpd/lighttpd.conf
    4.40 +			if [ -z "$1" ]; then
    4.41 +				# Start Web server.
    4.42 +				/etc/init.d/lighttpd stop
    4.43 +				/etc/init.d/lighttpd start
    4.44 +			fi
    4.45 +		fi
    4.46 +	fi
    4.47 +}
    4.48 +
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/postgresql-client/receipt	Sat Jul 26 14:23:50 2008 +0000
     5.3 @@ -0,0 +1,21 @@
     5.4 +# SliTaz package receipt.
     5.5 +
     5.6 +PACKAGE="postgresql-client"
     5.7 +VERSION="8.3.3"
     5.8 +CATEGORY="system"
     5.9 +SHORT_DESC="SQL database system client files."
    5.10 +MAINTAINER="pascal.bellard@slitaz.org"
    5.11 +WEB_SITE="http://www.pgsql.com/"
    5.12 +DEPENDS="libpostgresqlclient zlib ncurses readline"
    5.13 +WANTED="postgresql"
    5.14 +
    5.15 +# Rules to gen a SliTaz package suitable for Tazpkg.
    5.16 +genpkg_rules()
    5.17 +{
    5.18 +	while read file; do
    5.19 +		dir=$(dirname $file)
    5.20 +		[ -d $fs$dir ] || mkdir -p $fs$dir
    5.21 +		cp -a $_pkg$file $fs$file
    5.22 +	done < $src/$PACKAGE.files-list
    5.23 +}
    5.24 +
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/postgresql-dev/receipt	Sat Jul 26 14:23:50 2008 +0000
     6.3 @@ -0,0 +1,18 @@
     6.4 +# SliTaz package receipt.
     6.5 +
     6.6 +PACKAGE="postgresql-dev"
     6.7 +VERSION="8.3.3"
     6.8 +CATEGORY="system"
     6.9 +SHORT_DESC="SQL database system development files"
    6.10 +MAINTAINER="pascal.bellard@slitaz.org"
    6.11 +WEB_SITE="http://www.pgsql.com/"
    6.12 +WANTED="postgresql"
    6.13 +
    6.14 +# Rules to gen a SliTaz package suitable for Tazpkg.
    6.15 +genpkg_rules()
    6.16 +{
    6.17 +	mkdir -p $fs/usr/lib/postgresql
    6.18 +	cp -a $_pkg/usr/include $fs/usr
    6.19 +	cp -a $_pkg/usr/lib/postgresql/*a $fs/usr/lib/postgresql
    6.20 +}
    6.21 +
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/postgresql-doc/receipt	Sat Jul 26 14:23:50 2008 +0000
     7.3 @@ -0,0 +1,17 @@
     7.4 +# SliTaz package receipt.
     7.5 +
     7.6 +PACKAGE="postgresql-doc"
     7.7 +VERSION="8.3.3"
     7.8 +CATEGORY="system"
     7.9 +SHORT_DESC="SQL database system documentation"
    7.10 +MAINTAINER="pascal.bellard@slitaz.org"
    7.11 +WEB_SITE="http://www.pgsql.com/"
    7.12 +WANTED="postgresql"
    7.13 +
    7.14 +# Rules to gen a SliTaz package suitable for Tazpkg.
    7.15 +genpkg_rules()
    7.16 +{
    7.17 +	mkdir -p $fs/usr
    7.18 +	cp -a $_pkg/usr/doc $fs/
    7.19 +}
    7.20 +
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/postgresql/receipt	Sat Jul 26 14:23:50 2008 +0000
     8.3 @@ -0,0 +1,82 @@
     8.4 +# SliTaz package receipt.
     8.5 +
     8.6 +PACKAGE="postgresql"
     8.7 +VERSION="8.3.3"
     8.8 +CATEGORY="system"
     8.9 +SHORT_DESC="SQL database system."
    8.10 +MAINTAINER="pascal.bellard@slitaz.org"
    8.11 +TARBALL="$PACKAGE-$VERSION.tar.bz2"
    8.12 +WEB_SITE="http://www.pgsql.com/"
    8.13 +WGET_URL="ftp://ftp.fr.postgresql.org/v$VERSION/$TARBALL"
    8.14 +DEPENDS="postgresql-client zlib"
    8.15 +BUILD_DEPENDS="zlib-dev readline-dev ncurses-dev"
    8.16 +
    8.17 +# Rules to configure and make the package.
    8.18 +compile_rules()
    8.19 +{
    8.20 +	cd $src
    8.21 +	[ -d ../postgrpsql-$VERSION ] && cp -a ../postgrpsql-$VERSION/* .
    8.22 +	./configure --prefix=/usr --infodir=/usr/share/info \
    8.23 +	--sysconfdir=/etc --includedir=/usr/include/postgresql --with-gnu-ld \
    8.24 +	--with-includes=/usr/include/readline --enable-integer-datetimes \
    8.25 +	--enable-thread-safety --with-system-tzdata=/usr/share/zoneinfo \
    8.26 +	--libdir=/usr/lib/postgresql --mandir=/usr/share/man $CONFIGURE_ARGS
    8.27 +	make
    8.28 +	make DESTDIR=$PWD/_pkg install
    8.29 +	cp ../stuff/*.files-list .
    8.30 +}
    8.31 +
    8.32 +# Rules to gen a SliTaz package suitable for Tazpkg.
    8.33 +genpkg_rules()
    8.34 +{
    8.35 +	mkdir -p $fs/usr/share $fs/usr/lib $fs/var/lib/pgsql \
    8.36 +		 $fs/var/log/postgresql
    8.37 +	cp -a $_pkg/usr/bin $fs/usr
    8.38 +	cp -a $_pkg/usr/lib/postgresql $fs/usr/lib
    8.39 +	rm -f $fs/usr/lib/postgresql/*a
    8.40 +	cp -a $_pkg/usr/share/postgresql $fs/usr/share
    8.41 +	cp -a stuff/etc $fs
    8.42 +	ln -s /var/lib/pgsql/postgresql.conf $fs/etc
    8.43 +	chmod 700 $fs/var/lib/pgsql
    8.44 +	cat $src/*.files-list | while read file; do
    8.45 +		[ -f $fs$file ] && rm -f $fs$file
    8.46 +	done
    8.47 +	# Package all pgsql pkgs
    8.48 +	for i in $(cd $WOK; ls -d postgresql-* libpostgresql* )
    8.49 +	do
    8.50 +		tazwok genpkg $i
    8.51 +	done
    8.52 +}
    8.53 +
    8.54 +# Pre and post install commands for Tazpkg.
    8.55 +post_install()
    8.56 +{
    8.57 +        # adduser postgres if needed
    8.58 +	if ! grep -q postgres $1/etc/passwd; then
    8.59 +		echo -n "Adding user postgres..."
    8.60 +		chroot $1/ adduser postgres -D -H -h /var/lib/pgsql
    8.61 +		status
    8.62 +	fi
    8.63 +	# addgroup postgres if needed
    8.64 +	if ! grep -q postgres $1/etc/group; then
    8.65 +		echo -n "Adding group postgres..."
    8.66 +		chroot $1/ addgroup postgres && addgroup postgres postgres
    8.67 +		status
    8.68 +	fi
    8.69 +	chroot $1/ chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
    8.70 +	cat <<EOF
    8.71 +----
    8.72 +To start $PACKAGE server you can run :
    8.73 +
    8.74 +    /etc/init.d/$PACKAGE start
    8.75 +
    8.76 +Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
    8.77 +----
    8.78 +EOF
    8.79 +}
    8.80 +
    8.81 +post_remove()
    8.82 +{
    8.83 +	deluser postgres
    8.84 +	delgroup postgres
    8.85 +}
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/postgresql/stuff/etc/init.d/postgresql	Sat Jul 26 14:23:50 2008 +0000
     9.3 @@ -0,0 +1,53 @@
     9.4 +#!/bin/sh
     9.5 +# /etc/init.d/postgresql : Start, stop and restart PostgreSQL server on SliTaz,
     9.6 +# at boot time or with the command line.
     9.7 +#
     9.8 +# To start postgresql server at boot time, just put mysql in the $RUN_DAEMONS
     9.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf
    9.10 +#
    9.11 +. /etc/init.d/rc.functions
    9.12 +. /etc/daemons.conf
    9.13 +
    9.14 +NAME=Postgresql
    9.15 +DESC="PostgreSQL server"
    9.16 +su -c "postgres -D /var/lib/pgsql >logfile 2>&1" - postgres &
    9.17 +OPTIONS=$PGSQL_OPTIONS
    9.18 +[ -n "$OPTIONS" ] || OPTIONS="-D /var/lib/pgsql -s"
    9.19 +
    9.20 +case "$1" in
    9.21 +  start)
    9.22 +    if [ ! -f /var/lib/pgsql/PG_VERSION ]; then
    9.23 +        echo "Initializing $DESC database"
    9.24 +	rm -rf /var/lib/pgsql/* 2> /dev/null
    9.25 +        su -c "initdb -D /var/lib/pgsql" - postgres
    9.26 +    fi
    9.27 +    echo -n "Starting $DESC: $NAME... "
    9.28 +    su -c "pg_ctl start -w $OPTIONS -l /var/log/postgresql/postgresql.log" - postgres
    9.29 +    status
    9.30 +# su -c "createdb test" - postgres
    9.31 +# su -c "psql test" - postgres
    9.32 +    ;;
    9.33 +  stop)
    9.34 +    echo -n "Stopping $DESC: $NAME... "
    9.35 +    su -c "pg_ctl stop $OPTIONS -m smart" - postgres
    9.36 +    status
    9.37 +    ;;
    9.38 +  restart)
    9.39 +    echo -n "Restarting $DESC: $NAME... "
    9.40 +    su -c "pg_ctl restart $OPTIONS -m smart" - postgres
    9.41 +    status
    9.42 +    ;;
    9.43 +  reload)
    9.44 +    echo -n "Reloading $DESC: $NAME... "
    9.45 +    su -c "pg_ctl reload $OPTIONS" - postgres
    9.46 +    status
    9.47 +    ;;
    9.48 +  *)
    9.49 +    echo ""
    9.50 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart|reload]"
    9.51 +    echo ""
    9.52 +    exit 1
    9.53 +    ;;
    9.54 +esac
    9.55 +
    9.56 +exit 0
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/postgresql/stuff/etc/logrotate.d/postgresql	Sat Jul 26 14:23:50 2008 +0000
    10.3 @@ -0,0 +1,9 @@
    10.4 +/var/log/postgresql/postgres.log {
    10.5 +	daily
    10.6 +	rotate 10
    10.7 +	copytruncate
    10.8 +	delaycompress
    10.9 +	compress
   10.10 +	notifempty
   10.11 +	create 640 postgres postgres
   10.12 +}
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/postgresql/stuff/libpostgresqlclient.files-list	Sat Jul 26 14:23:50 2008 +0000
    11.3 @@ -0,0 +1,3 @@
    11.4 +/usr/lib/postgresql/libpq.so
    11.5 +/usr/lib/postgresql/libpq.so.5
    11.6 +/usr/lib/postgresql/libpq.so.5.1
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/postgresql/stuff/postgresql-client.files-list	Sat Jul 26 14:23:50 2008 +0000
    12.3 @@ -0,0 +1,13 @@
    12.4 +/usr/bin/pg_dump
    12.5 +/usr/bin/pg_restore
    12.6 +/usr/bin/pg_dumpall
    12.7 +/usr/bin/psql
    12.8 +/usr/bin/createdb
    12.9 +/usr/bin/dropdb
   12.10 +/usr/bin/createlang
   12.11 +/usr/bin/droplang
   12.12 +/usr/bin/createuser
   12.13 +/usr/bin/dropuser
   12.14 +/usr/bin/clusterdb
   12.15 +/usr/bin/vacuumdb
   12.16 +/usr/bin/reindexdb