wok-current view postgresql/receipt @ rev 25728

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