wok view postgresql/receipt @ rev 25694

dropbear: typo
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Apr 21 14:12:01 2024 +0000 (7 weeks ago)
parents df63c4ce07f8
children
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="https://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 # What is the latest version available today?
20 current_version()
21 {
22 wget -O - https://www.postgresql.org/community/ 2>/dev/null | \
23 sed '/released/!d;s|.*sql-||;s|-rel.*||;s|-||g;q'
24 }
26 # Rules to configure and make the package.
27 compile_rules()
28 {
29 [ -d ../postgrpsql-$VERSION ] && cp -a ../postgrpsql-$VERSION/* .
30 cp $stuff/*.files-list .
31 ./configure --prefix=/usr --infodir=/usr/share/info \
32 --sysconfdir=/etc --includedir=/usr/include/postgresql --with-gnu-ld \
33 --with-includes=/usr/include/readline --enable-integer-datetimes \
34 --with-perl --with-python \
35 --enable-thread-safety --with-system-tzdata=/usr/share/zoneinfo \
36 --libdir=/usr/lib/postgresql --mandir=/usr/share/man \
37 $CONFIGURE_ARGS &&
38 make world &&
39 make DESTDIR=$DESTDIR install
40 make -C doc/src/sgml DESTDIR=$DESTDIR install-html
41 }
43 # Rules to gen a SliTaz package suitable for Tazpkg.
44 genpkg_rules()
45 {
46 mkdir -p $fs/usr/share $fs/usr/lib $fs/var/lib/pgsql \
47 $fs/var/log/postgresql $fs/etc/pgsql.d
48 cp -a $install/usr/bin $fs/usr
49 cp -a $install/usr/lib/postgresql $fs/usr/lib
50 rm -f $fs/usr/lib/postgresql/*a
51 cp -a $install/usr/share/postgresql $fs/usr/share
52 cp -a $stuff/etc $fs
53 ln -s /var/lib/pgsql/postgresql.conf $fs/etc
54 chmod 700 $fs/var/lib/pgsql
55 cat $stuff/*.files-list | while read file; do
56 [ -f $fs$file ] && rm -f $fs$file
57 done
59 }
61 # Pre and post install commands for Tazpkg.
62 post_install()
63 {
64 # adduser postgres if needed
65 if ! grep -q postgres: "$1/etc/passwd"; then
66 echo
67 echo -n "Adding user postgres..."
68 chroot "$1/" adduser postgres -D -H -u 88 -h /var/lib/pgsql
69 #[ -d "$1/var/lib/pgsql" ] && rm -f "$1/var/lib/pgsql"/.* "$1/var/lib/pgsql"/*
70 status
71 fi
72 # addgroup postgres if needed
73 if ! grep -q postgres: "$1/etc/group"; then
74 echo
75 echo -n "Adding group postgres..."
76 chroot "$1/" sh -c 'addgroup -g 88 postgres'
77 status
78 fi
79 [ ! -d "$1/var/lib/pgsql" ] && mkdir -p "$1/var/lib/pgsql"
80 chroot "$1/" chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
81 cat <<EOF
82 ----
83 postgres has superuser access.
84 Configure /var/lib/pgsql/*.conf files.
85 To start $PACKAGE server you can run :
87 /etc/init.d/$PACKAGE start
89 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
90 ----
91 EOF
92 }
94 post_remove()
95 {
96 # when both user and group have the same id# and name
97 # both group and user will get removed with either delusr/delgroup
98 chroot "$1/" deluser postgres
99 }