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