wok-6.x view postgresql/receipt @ rev 18084
Add wmctrl
author | Yuri Pourre <yuripourre@gmail.com> |
---|---|
date | Fri May 22 19:32:45 2015 -0300 (2015-05-22) |
parents | e1defd13e80a |
children | 9e01bc6321ea |
line source
1 # SliTaz package receipt.
3 PACKAGE="postgresql"
4 VERSION="9.2.3"
5 CATEGORY="misc"
6 SHORT_DESC="SQL database system."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="BSD"
9 TARBALL="$PACKAGE-$VERSION.tar.bz2"
10 WEB_SITE="http://www.postgresql.org/"
11 WGET_URL="ftp://ftp.postgresql.org/pub/source/v$VERSION/$TARBALL"
12 CONFIG_FILES="/var/lib/pgsql/*.conf"
13 DATABASE_FILES="/var/lib/pgsql"
15 DEPENDS="postgresql-client slitaz-base-files"
16 BUILD_DEPENDS="zlib-dev readline-dev ncurses-dev bison flex perl libxslt \
17 python-dev"
19 # Rules to configure and make the package.
20 compile_rules()
21 {
22 cd $src
23 [ -d ../postgrpsql-$VERSION ] && cp -a ../postgrpsql-$VERSION/* .
24 cp $stuff/*.files-list .
25 ./configure --prefix=/usr --infodir=/usr/share/info \
26 --sysconfdir=/etc --includedir=/usr/include/postgresql --with-gnu-ld \
27 --with-includes=/usr/include/readline --enable-integer-datetimes \
28 --with-perl --with-python \
29 --enable-thread-safety --with-system-tzdata=/usr/share/zoneinfo \
30 --libdir=/usr/lib/postgresql --mandir=/usr/share/man \
31 $CONFIGURE_ARGS &&
32 make &&
33 make DESTDIR=$DESTDIR install
34 make -C doc/src/sgml DESTDIR=$DESTDIR install-html
35 }
37 # Rules to gen a SliTaz package suitable for Tazpkg.
38 genpkg_rules()
39 {
40 mkdir -p $fs/usr/share $fs/usr/lib $fs/var/lib/pgsql \
41 $fs/var/log/postgresql $fs/etc/pgsql.d
42 cp -a $install/usr/bin $fs/usr
43 cp -a $install/usr/lib/postgresql $fs/usr/lib
44 rm -f $fs/usr/lib/postgresql/*a
45 cp -a $install/usr/share/postgresql $fs/usr/share
46 cp -a $stuff/etc $fs
47 ln -s /var/lib/pgsql/postgresql.conf $fs/etc
48 chmod 700 $fs/var/lib/pgsql
49 cat $stuff/*.files-list | while read file; do
50 [ -f $fs$file ] && rm -f $fs$file
51 done
53 }
55 # Pre and post install commands for Tazpkg.
56 post_install()
57 {
58 # adduser postgres if needed
59 if ! grep -q postgres: $1/etc/passwd; then
60 echo -n "Adding user postgres..."
61 chroot $1/ adduser postgres -D -H -u 88 -h /var/lib/pgsql
62 #[ -d $1/var/lib/pgsql ] && rm -f $1/var/lib/pgsql/.* $1/var/lib/pgsql/*
63 status
64 fi
65 # addgroup postgres if needed
66 if ! grep -q postgres: $1/etc/group; then
67 echo -n "Adding group postgres..."
68 chroot $1/ sh -c 'addgroup -g 88 postgres'
69 status
70 fi
71 [ ! -d $1/var/lib/pgsql ] && mkdir -p $1/var/lib/pgsql
72 chroot $1/ chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
73 cat <<EOF
74 ----
75 postgres has superuser access.
76 Configure /var/lib/pgsql/*.conf files.
77 To start $PACKAGE server you can run :
79 /etc/init.d/$PACKAGE start
81 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
82 ----
83 EOF
84 }
86 post_remove()
87 {
88 # when both user and group have the same id# and name
89 # both group and user will get removed with either delusr/delgroup
90 chroot $1/ deluser postgres
91 }