From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] postgresql: add an option to build the server
Date: Sun, 18 Oct 2015 18:19:43 +0200 [thread overview]
Message-ID: <20151018181943.4faaefe2@free-electrons.com> (raw)
In-Reply-To: <1445179920-2413-2-git-send-email-mathstuf@gmail.com>
Ben,
On Sun, 18 Oct 2015 10:52:00 -0400, Ben Boeckel wrote:
> Unfortunately, postgresql upstream doesn't have a configure option for
> this. Instead, to get bits of the build, compiling and installing
> different subdirectories is the preferred way.
>
> The directories come from those used in the FreeBSD port.
>
> Signed-off-by: Ben Boeckel <mathstuf@gmail.com>
Just to clarify: in our current packaging, we build and install both
server and client?
> diff --git a/package/postgresql/Config.in b/package/postgresql/Config.in
> index e9b8f48..2560a49 100644
> --- a/package/postgresql/Config.in
> +++ b/package/postgresql/Config.in
> @@ -18,5 +18,21 @@ config BR2_PACKAGE_POSTGRESQL
>
> http://www.postgresql.org
As I suggested, doing:
select BR2_PACKAGE_POSTGRESQL_CLIENT if !BR2_PACKAGE_POSTGRESQL_SERVER
woudl be good.
> diff --git a/package/postgresql/postgresql.mk b/package/postgresql/postgresql.mk
> index a42fe73..76a6377 100644
> --- a/package/postgresql/postgresql.mk
> +++ b/package/postgresql/postgresql.mk
> @@ -58,6 +58,21 @@ POSTGRESQL_DEPENDENCIES += openssl
> POSTGRESQL_CONF_OPTS += --with-openssl
> endif
>
> +POSTGRESQL_BUILD_DIRECTORIES =
> +POSTGRESQL_INSTALL_DIRECTORIES =
Not needed, variables are empty by default.
> +
> +ifeq ($(BR2_PACKAGE_POSTGRESQL_CLIENT),y)
> +
> +POSTGRESQL_CLIENT_DIRECTORIES += config src/include src/interfaces src/port \
> + src/bin/pg_dump src/bin/psql src/bin/scripts src/bin/pg_config \
> + src/backend
Lines are a bit too long. What about instead:
POSTGRESQL_CLIENT_DIRECTORIES = \
config src/include src/interfaces src/port src/backend \
src/bin/pg_dump src/bin/psql src/bin/scripts src/bin/pg_config \
> +POSTGRESQL_BUILD_DIRECTORIES += $(POSTGRESQL_CLIENT_DIRECTORIES)
> +POSTGRESQL_INSTALL_DIRECTORIES += $(POSTGRESQL_CLIENT_DIRECTORIES)
> +
> +endif
> +
> +ifeq ($(BR2_PACKAGE_POSTGRESQL_SERVER),y)
> +
> define POSTGRESQL_USERS
> postgres -1 postgres -1 * /var/lib/pgsql /bin/sh - PostgreSQL Server
> endef
> @@ -89,4 +104,37 @@ define POSTGRESQL_INSTALL_INIT_SYSTEMD
> $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/postgresql.service
> endef
>
> +POSTGRESQL_SERVER_DIRECTORIES = src/common src/timezone src/backend \
> + src/backend/utils/mb/conversion_procs \
> + src/backend/snowball src/backend/replication/libpqwalreceiver \
> + src/bin/initdb src/bin/pg_ctl \
> + src/bin/pg_controldata src/bin/pg_resetxlog src/pl \
> + src/bin/pg_basebackup
Ditto.
> +
> +POSTGRESQL_INSTALL_DIRECTORIES += $(POSTGRESQL_SERVER_DIRECTORIES)
> +POSTGRESQL_BUILD_DIRECTORIES += src/port $(POSTGRESQL_SERVER_DIRECTORIES)
Is it problematic if src/port gets installed in the server case? If
not, then you don't need to have this difference between
POSTGRESQL_INSTALL_DIRECTORIES and POSTGRESQL_BUILD_DIRECTORIES.
> +
> +endif
> +
> +define POSTGRESQL_BUILD_CMDS
> + for dir in $(POSTGRESQL_BUILD_DIRECTORIES); do \
> + echo $${dir}; \
Left-over debugging?
> + $(MAKE) -C $(@D)/$${dir} || exit 1; \
> + done
Could you use a foreach loop instead ?
$(foreach d,$(POSTGRESQL_BUILD_DIRECTORIES),\
$(MAKE) -C $(@D)/$(d)$(sep))
> +endef
> +
> +define POSTGRESQL_INSTALL_TARGET_CMDS
> + for dir in $(POSTGRESQL_INSTALL_DIRECTORIES); do \
> + echo $${dir}; \
> + $(MAKE) -C $(@D)/$${dir} DESTDIR=$(TARGET_DIR) install || exit 1; \
> + done
Ditto.
> +endef
> +
> +define POSTGRESQL_INSTALL_STAGING_CMDS
> + for dir in $(POSTGRESQL_INSTALL_DIRECTORIES); do \
> + echo $${dir}; \
> + $(MAKE) -C $(@D)/$${dir} DESTDIR=$(STAGING_DIR) install || exit 1; \
> + done
Ditto.
Also, above the definition of POSTGRESQL_CLIENT_DIRECTORIES or
POSTGRESQL_SERVER_DIRECTORIES, can you add a comment with a reference
to the postgresql documentation that says which directories should be
built/installed for the client and server cases? This way if we need to
update the postgresql package in the future, we can do it by looking at
the documentation.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2015-10-18 16:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-18 14:51 [Buildroot] [PATCH 0/1] Add postgres server/client options Ben Boeckel
2015-10-18 14:52 ` [Buildroot] [PATCH 1/1] postgresql: add an option to build the server Ben Boeckel
2015-10-18 16:19 ` Thomas Petazzoni [this message]
2015-10-18 21:46 ` Ben Boeckel
2015-10-18 16:04 ` [Buildroot] [PATCH 0/1] Add postgres server/client options Thomas Petazzoni
2015-10-23 4:43 ` [Buildroot] [PATCH v2 1/1] postgresql: add an option to build the server Ben Boeckel
2015-10-31 17:58 ` Ben Boeckel
2015-11-19 1:52 ` Ben Boeckel
2015-12-13 22:37 ` Thomas Petazzoni
2015-12-14 0:08 ` Arnout Vandecappelle
2015-12-14 21:55 ` Yann E. MORIN
2016-04-19 21:22 ` Yann E. MORIN
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151018181943.4faaefe2@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox