diff options
author | Lei Maohui <leimaohui@fujitsu.com> | 2023-03-20 11:02:35 +0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-03-22 09:10:39 -0700 |
commit | 25ef3eec88e731ffd00de0b0da25fc9a70a810ff (patch) | |
tree | c9650e63c1623ebf78d7290a58c74a8b9797844f /meta-networking/recipes-support | |
parent | a4b6e3ee894047cd13c5d2b7bfc67f0093899537 (diff) | |
download | meta-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')
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 @@ | |||
1 | From f8ab74a76049f69adeebe92c62593547e05a075d Mon Sep 17 00:00:00 2001 | ||
2 | From: Lei Maohui <leimaohui@fujitsu.com> | ||
3 | Date: Wed, 11 Jan 2023 17:22:41 +0900 | ||
4 | Subject: [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 | |||
10 | PG_STRERROR_R_BUFLEN is defined in postgresql, but pgpool doesn't | ||
11 | include the header of postgresql. | ||
12 | |||
13 | Upstream-Status: Inappropriate [OE-Specific] | ||
14 | Signed-off-by: Lei Maohui <leimaohui@fujitsu.com> | ||
15 | --- | ||
16 | src/parser/snprintf.c | 1 + | ||
17 | 1 file changed, 1 insertion(+) | ||
18 | |||
19 | diff --git a/src/parser/snprintf.c b/src/parser/snprintf.c | ||
20 | index 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 | -- | ||
32 | 2.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 @@ | |||
1 | From 5d335b5ddd052f047759cae0e9b94ec49f9f3884 Mon Sep 17 00:00:00 2001 | ||
2 | From: Lei Maohui <leimaohui@fujitsu.com> | ||
3 | Date: Mon, 20 Mar 2023 02:03:04 +0000 | ||
4 | Subject: [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 | |||
14 | Upstream-Status: Inappropriate [embedded specific] | ||
15 | Signed-off-by: Lei Maohui <leimaohui@fujitsu.com> | ||
16 | --- | ||
17 | src/tools/pgproto/read.c | 1 + | ||
18 | 1 file changed, 1 insertion(+) | ||
19 | |||
20 | diff --git a/src/tools/pgproto/read.c b/src/tools/pgproto/read.c | ||
21 | index 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 | -- | ||
33 | 2.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] | ||
2 | Description=Pgpool-II | ||
3 | After=syslog.target network.target | ||
4 | |||
5 | [Service] | ||
6 | |||
7 | User=postgres | ||
8 | Group=postgres | ||
9 | |||
10 | EnvironmentFile=-/etc/sysconfig/pgpool | ||
11 | |||
12 | ExecStart=/usr/bin/pgpool -f /etc/pgpool-II/pgpool.conf $OPTS | ||
13 | ExecStop=/usr/bin/pgpool -f /etc/pgpool-II/pgpool.conf $STOP_OPTS stop | ||
14 | ExecReload=/usr/bin/pgpool -f /etc/pgpool-II/pgpool.conf reload | ||
15 | |||
16 | [Install] | ||
17 | WantedBy=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" | ||
7 | OPTS=" -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 @@ | |||
1 | SUMMARY = "a language independent connection pool server for PostgreSQL." | ||
2 | |||
3 | DESCRIPTION = "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 | |||
8 | HOMEPAGE = "http://pgpool.net" | ||
9 | |||
10 | LICENSE = "BSD-2-Clause" | ||
11 | LIC_FILES_CHKSUM = "file://COPYING;md5=e4b38de086d73e0521de0bbdbaa4a1a9" | ||
12 | |||
13 | SRC_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 | " | ||
19 | SRC_URI[sha256sum] = "4b379bbba8e178128a1cee4a5bd1ae116dedb3da6121b728c18f0f54c881f328" | ||
20 | |||
21 | S = "${WORKDIR}/pgpool-II-${PV}" | ||
22 | |||
23 | inherit autotools systemd | ||
24 | |||
25 | SYSTEMD_SERVICE:${PN} = "pgpool.service" | ||
26 | |||
27 | PACKAGECONFIG ??= " openssl libmemcached postgresql \ | ||
28 | " | ||
29 | PACKAGECONFIG[pam] = "--with-pam,,libpam" | ||
30 | PACKAGECONFIG[openssl] = "--with-openssl,,openssl" | ||
31 | PACKAGECONFIG[libmemcached] = "--with-memcached=${STAGING_INCDIR}/libmemcachedutil-1.0,,libmemcached" | ||
32 | PACKAGECONFIG[postgresql] = "--with-pgsql-includedir=${STAGING_INCDIR}/postgresql,, postgresql" | ||
33 | |||
34 | EXTRA_OECONF += "--disable-static \ | ||
35 | --disable-rpath \ | ||
36 | " | ||
37 | B = "${S}" | ||
38 | CFLAGS:append = " -fcommon " | ||
39 | |||
40 | FILES:${PN} += "${datadir}/pgpool-II/ " | ||
41 | |||
42 | do_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 | |||
47 | do_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 | } | ||