summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support
diff options
context:
space:
mode:
authorLei Maohui <leimaohui@fujitsu.com>2023-03-20 11:02:35 +0800
committerKhem Raj <raj.khem@gmail.com>2023-03-22 09:10:39 -0700
commit25ef3eec88e731ffd00de0b0da25fc9a70a810ff (patch)
treec9650e63c1623ebf78d7290a58c74a8b9797844f /meta-networking/recipes-support
parenta4b6e3ee894047cd13c5d2b7bfc67f0093899537 (diff)
downloadmeta-openembedded-25ef3eec88e731ffd00de0b0da25fc9a70a810ff.tar.gz
pgpool2: Added a new recipe.
Pgpool-II is a middleware that works between PostgreSQL servers and a PostgreSQL database client. It is distributed under a license similar to BSD and MIT. It provides the following features. Signed-off-by: Lei Maohui <leimaohui@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-support')
-rw-r--r--meta-networking/recipes-support/pgpool2/pgpool2/0001-Fix-build-error-when-build-this-file.patch32
-rw-r--r--meta-networking/recipes-support/pgpool2/pgpool2/0001-pgpool2-Fix-unknown-type-name-fd_set-error-with-musl.patch33
-rw-r--r--meta-networking/recipes-support/pgpool2/pgpool2/pgpool.service17
-rw-r--r--meta-networking/recipes-support/pgpool2/pgpool2/pgpool.sysconfig7
-rw-r--r--meta-networking/recipes-support/pgpool2/pgpool2_4.4.1.bb53
5 files changed, 142 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/pgpool2/pgpool2/0001-Fix-build-error-when-build-this-file.patch b/meta-networking/recipes-support/pgpool2/pgpool2/0001-Fix-build-error-when-build-this-file.patch
new file mode 100644
index 000000000..52bcc3b7e
--- /dev/null
+++ b/meta-networking/recipes-support/pgpool2/pgpool2/0001-Fix-build-error-when-build-this-file.patch
@@ -0,0 +1,32 @@
1From f8ab74a76049f69adeebe92c62593547e05a075d Mon Sep 17 00:00:00 2001
2From: Lei Maohui <leimaohui@fujitsu.com>
3Date: Wed, 11 Jan 2023 17:22:41 +0900
4Subject: [PATCH] Fix build error when build this file.
5
6| snprintf.c:770:64: error: 'PG_STRERROR_R_BUFLEN' undeclared (first use in this function)
7| 770 | char errbuf[PG_STRERROR_R_BUFLEN];
8| | ^~~~~~~~~~~~~~~~~~~~
9
10PG_STRERROR_R_BUFLEN is defined in postgresql, but pgpool doesn't
11include the header of postgresql.
12
13Upstream-Status: Inappropriate [OE-Specific]
14Signed-off-by: Lei Maohui <leimaohui@fujitsu.com>
15---
16 src/parser/snprintf.c | 1 +
17 1 file changed, 1 insertion(+)
18
19diff --git a/src/parser/snprintf.c b/src/parser/snprintf.c
20index 84ebdb2..3387897 100644
21--- a/src/parser/snprintf.c
22+++ b/src/parser/snprintf.c
23@@ -46,6 +46,7 @@
24 #include "pool_parser.h"
25 #include "stringinfo.h"
26 #include "utils/palloc.h"
27+#include "postgresql/server/port.h"
28
29 /*
30 * We used to use the platform's NL_ARGMAX here, but that's a bad idea,
31--
322.25.1
diff --git a/meta-networking/recipes-support/pgpool2/pgpool2/0001-pgpool2-Fix-unknown-type-name-fd_set-error-with-musl.patch b/meta-networking/recipes-support/pgpool2/pgpool2/0001-pgpool2-Fix-unknown-type-name-fd_set-error-with-musl.patch
new file mode 100644
index 000000000..26f8afe4d
--- /dev/null
+++ b/meta-networking/recipes-support/pgpool2/pgpool2/0001-pgpool2-Fix-unknown-type-name-fd_set-error-with-musl.patch
@@ -0,0 +1,33 @@
1From 5d335b5ddd052f047759cae0e9b94ec49f9f3884 Mon Sep 17 00:00:00 2001
2From: Lei Maohui <leimaohui@fujitsu.com>
3Date: Mon, 20 Mar 2023 02:03:04 +0000
4Subject: [PATCH] pgpool2: Fix unknown type name 'fd_set' error with musl.
5
6| read.c: In function 'read_until_ready_for_query':
7| read.c:53:24: error: storage size of 'timeoutval' isn't known
8| 53 | struct timeval timeoutval;
9| | ^~~~~~~~~~
10| read.c:54:9: error: unknown type name 'fd_set'
11| 54 | fd_set readmask;
12| | ^~~~~~
13
14Upstream-Status: Inappropriate [embedded specific]
15Signed-off-by: Lei Maohui <leimaohui@fujitsu.com>
16---
17 src/tools/pgproto/read.c | 1 +
18 1 file changed, 1 insertion(+)
19
20diff --git a/src/tools/pgproto/read.c b/src/tools/pgproto/read.c
21index c7fb548..4efe641 100644
22--- a/src/tools/pgproto/read.c
23+++ b/src/tools/pgproto/read.c
24@@ -19,6 +19,7 @@
25 #include "../../include/config.h"
26 #include "pgproto/pgproto.h"
27 #include <unistd.h>
28+#include <sys/select.h>
29 #include <stdlib.h>
30 #include <stdio.h>
31 #include <string.h>
32--
332.34.1
diff --git a/meta-networking/recipes-support/pgpool2/pgpool2/pgpool.service b/meta-networking/recipes-support/pgpool2/pgpool2/pgpool.service
new file mode 100644
index 000000000..bf2d32363
--- /dev/null
+++ b/meta-networking/recipes-support/pgpool2/pgpool2/pgpool.service
@@ -0,0 +1,17 @@
1[Unit]
2Description=Pgpool-II
3After=syslog.target network.target
4
5[Service]
6
7User=postgres
8Group=postgres
9
10EnvironmentFile=-/etc/sysconfig/pgpool
11
12ExecStart=/usr/bin/pgpool -f /etc/pgpool-II/pgpool.conf $OPTS
13ExecStop=/usr/bin/pgpool -f /etc/pgpool-II/pgpool.conf $STOP_OPTS stop
14ExecReload=/usr/bin/pgpool -f /etc/pgpool-II/pgpool.conf reload
15
16[Install]
17WantedBy=multi-user.target
diff --git a/meta-networking/recipes-support/pgpool2/pgpool2/pgpool.sysconfig b/meta-networking/recipes-support/pgpool2/pgpool2/pgpool.sysconfig
new file mode 100644
index 000000000..ea13089b7
--- /dev/null
+++ b/meta-networking/recipes-support/pgpool2/pgpool2/pgpool.sysconfig
@@ -0,0 +1,7 @@
1# Options for pgpool
2
3# -n: don't run in daemon mode. does not detach control tty
4# -d: debug mode. lots of debug information will be printed
5
6#OPTS=" -d -n"
7OPTS=" -n"
diff --git a/meta-networking/recipes-support/pgpool2/pgpool2_4.4.1.bb b/meta-networking/recipes-support/pgpool2/pgpool2_4.4.1.bb
new file mode 100644
index 000000000..efb563b81
--- /dev/null
+++ b/meta-networking/recipes-support/pgpool2/pgpool2_4.4.1.bb
@@ -0,0 +1,53 @@
1SUMMARY = "a language independent connection pool server for PostgreSQL."
2
3DESCRIPTION = "Pgpool-II is a middleware that works between PostgreSQL \
4 servers and a PostgreSQL database client. It is distributed \
5 under a license similar to BSD and MIT. It provides the \
6 following features."
7
8HOMEPAGE = "http://pgpool.net"
9
10LICENSE = "BSD-2-Clause"
11LIC_FILES_CHKSUM = "file://COPYING;md5=e4b38de086d73e0521de0bbdbaa4a1a9"
12
13SRC_URI = "http://www.pgpool.net/mediawiki/images/pgpool-II-${PV}.tar.gz \
14 file://0001-Fix-build-error-when-build-this-file.patch \
15 file://0001-pgpool2-Fix-unknown-type-name-fd_set-error-with-musl.patch \
16 file://pgpool.sysconfig \
17 file://pgpool.service \
18 "
19SRC_URI[sha256sum] = "4b379bbba8e178128a1cee4a5bd1ae116dedb3da6121b728c18f0f54c881f328"
20
21S = "${WORKDIR}/pgpool-II-${PV}"
22
23inherit autotools systemd
24
25SYSTEMD_SERVICE:${PN} = "pgpool.service"
26
27PACKAGECONFIG ??= " openssl libmemcached postgresql \
28"
29PACKAGECONFIG[pam] = "--with-pam,,libpam"
30PACKAGECONFIG[openssl] = "--with-openssl,,openssl"
31PACKAGECONFIG[libmemcached] = "--with-memcached=${STAGING_INCDIR}/libmemcachedutil-1.0,,libmemcached"
32PACKAGECONFIG[postgresql] = "--with-pgsql-includedir=${STAGING_INCDIR}/postgresql,, postgresql"
33
34EXTRA_OECONF += "--disable-static \
35 --disable-rpath \
36 "
37B = "${S}"
38CFLAGS:append = " -fcommon "
39
40FILES:${PN} += "${datadir}/pgpool-II/ "
41
42do_configure:append() {
43 echo "#define HAVE_STRCHRNUL 1" >> ${S}/src/include/config.h
44 sed -i "s,#define USE_REPL_SNPRINTF 1,/* #undef USE_REPL_SNPRINTF*/,g" ${S}/src/include/config.h
45}
46
47do_install:append() {
48 install -d ${D}${sysconfdir}/pgpool-II
49 install -D -m 0644 ${WORKDIR}/pgpool.sysconfig ${D}${sysconfdir}/pgpool-II/pgpool.conf
50 install -D -m 0644 ${S}/src/sample/pcp.conf.sample ${D}${sysconfdir}/pgpool-II/pcp.conf
51 install -D -m 0644 ${S}/src/sample/pool_hba.conf.sample ${D}${sysconfdir}/pgpool-II/pool_hba.conf
52 install -Dm 0644 ${WORKDIR}/pgpool.service ${D}${systemd_system_unitdir}/pgpool.service
53}