wok-6.x view postgresql/receipt @ rev 22288
linld: 8086 may load zImage (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Nov 13 15:08:02 2019 +0100 (2019-11-13) |
parents | 970c5ec9a60a |
children | 2f230197370e |
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="https://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 [ -d ../postgrpsql-$VERSION ] && cp -a ../postgrpsql-$VERSION/* .
23 cp $stuff/*.files-list .
24 ./configure --prefix=/usr --infodir=/usr/share/info \
25 --sysconfdir=/etc --includedir=/usr/include/postgresql --with-gnu-ld \
26 --with-includes=/usr/include/readline --enable-integer-datetimes \
27 --with-perl --with-python \
28 --enable-thread-safety --with-system-tzdata=/usr/share/zoneinfo \
29 --libdir=/usr/lib/postgresql --mandir=/usr/share/man \
30 $CONFIGURE_ARGS &&
31 make world &&
32 make DESTDIR=$DESTDIR install
33 make -C doc/src/sgml DESTDIR=$DESTDIR install-html
34 }
36 # Rules to gen a SliTaz package suitable for Tazpkg.
37 genpkg_rules()
38 {
39 mkdir -p $fs/usr/share $fs/usr/lib $fs/var/lib/pgsql \
40 $fs/var/log/postgresql $fs/etc/pgsql.d
41 cp -a $install/usr/bin $fs/usr
42 cp -a $install/usr/lib/postgresql $fs/usr/lib
43 rm -f $fs/usr/lib/postgresql/*a
44 cp -a $install/usr/share/postgresql $fs/usr/share
45 cp -a $stuff/etc $fs
46 ln -s /var/lib/pgsql/postgresql.conf $fs/etc
47 chmod 700 $fs/var/lib/pgsql
48 cat $stuff/*.files-list | while read file; do
49 [ -f $fs$file ] && rm -f $fs$file
50 done
52 }
54 # Pre and post install commands for Tazpkg.
55 post_install()
56 {
57 # adduser postgres if needed
58 if ! grep -q postgres: "$1/etc/passwd"; then
59 echo
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
68 echo -n "Adding group postgres..."
69 chroot "$1/" sh -c 'addgroup -g 88 postgres'
70 status
71 fi
72 [ ! -d "$1/var/lib/pgsql" ] && mkdir -p "$1/var/lib/pgsql"
73 chroot "$1/" chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
74 cat <<EOF
75 ----
76 postgres has superuser access.
77 Configure /var/lib/pgsql/*.conf files.
78 To start $PACKAGE server you can run :
80 /etc/init.d/$PACKAGE start
82 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
83 ----
84 EOF
85 }
87 post_remove()
88 {
89 # when both user and group have the same id# and name
90 # both group and user will get removed with either delusr/delgroup
91 chroot "$1/" deluser postgres
92 }