ncftp: bump version to 3.2.6
[buildroot-gz.git] / package / postgresql / postgresql.mk
blobd46e8c0ec8ec77b7493e04a7a803e284cb7c9168
1 ################################################################################
3 # postgresql
5 ################################################################################
7 POSTGRESQL_VERSION = 9.6.1
8 POSTGRESQL_SOURCE = postgresql-$(POSTGRESQL_VERSION).tar.bz2
9 POSTGRESQL_SITE = http://ftp.postgresql.org/pub/source/v$(POSTGRESQL_VERSION)
10 POSTGRESQL_LICENSE = PostgreSQL
11 POSTGRESQL_LICENSE_FILES = COPYRIGHT
12 POSTGRESQL_INSTALL_STAGING = YES
13 POSTGRESQL_CONFIG_SCRIPTS = pg_config
14 POSTGRESQL_CONF_ENV = \
15 ac_cv_type_struct_sockaddr_in6=yes \
16 pgac_cv_snprintf_long_long_int_modifier="%lld" \
17 pgac_cv_snprintf_size_t_support=yes
18 POSTGRESQL_CONF_OPTS = --disable-rpath
20 ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
21 # PostgreSQL does not build against uClibc with locales
22 # enabled, due to an uClibc bug, see
23 # http://lists.uclibc.org/pipermail/uclibc/2014-April/048326.html
24 # so overwrite automatic detection and disable locale support
25 POSTGRESQL_CONF_ENV += pgac_cv_type_locale_t=no
26 endif
28 ifneq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
29 POSTGRESQL_CONF_OPTS += --disable-thread-safety
30 endif
32 ifeq ($(BR2_arcle)$(BR2_arceb)$(BR2_microblazeel)$(BR2_microblazebe)$(BR2_nios2)$(BR2_xtensa),y)
33 POSTGRESQL_CONF_OPTS += --disable-spinlocks
34 endif
36 ifeq ($(BR2_PACKAGE_READLINE),y)
37 POSTGRESQL_DEPENDENCIES += readline
38 else
39 POSTGRESQL_CONF_OPTS += --without-readline
40 endif
42 ifeq ($(BR2_PACKAGE_ZLIB),y)
43 POSTGRESQL_DEPENDENCIES += zlib
44 else
45 POSTGRESQL_CONF_OPTS += --without-zlib
46 endif
48 ifeq ($(BR2_PACKAGE_TZDATA),y)
49 POSTGRESQL_DEPENDENCIES += tzdata
50 POSTGRESQL_CONF_OPTS += --with-system-tzdata=/usr/share/zoneinfo
51 else
52 POSTGRESQL_DEPENDENCIES += host-zic
53 POSTGRESQL_CONF_ENV += ZIC="$(ZIC)"
54 endif
56 ifeq ($(BR2_PACKAGE_OPENSSL),y)
57 POSTGRESQL_DEPENDENCIES += openssl
58 POSTGRESQL_CONF_OPTS += --with-openssl
59 endif
61 ifeq ($(BR2_PACKAGE_OPENLDAP),y)
62 POSTGRESQL_DEPENDENCIES += openldap
63 POSTGRESQL_CONF_OPTS += --with-ldap
64 else
65 POSTGRESQL_CONF_OPTS += --without-ldap
66 endif
68 define POSTGRESQL_USERS
69 postgres -1 postgres -1 * /var/lib/pgsql /bin/sh - PostgreSQL Server
70 endef
72 define POSTGRESQL_INSTALL_TARGET_FIXUP
73 $(INSTALL) -dm 0700 $(TARGET_DIR)/var/lib/pgsql
74 $(RM) -rf $(TARGET_DIR)/usr/lib/postgresql/pgxs
75 endef
77 POSTGRESQL_POST_INSTALL_TARGET_HOOKS += POSTGRESQL_INSTALL_TARGET_FIXUP
79 define POSTGRESQL_INSTALL_CUSTOM_PG_CONFIG
80 $(INSTALL) -m 0755 -D package/postgresql/pg_config \
81 $(STAGING_DIR)/usr/bin/pg_config
82 endef
84 POSTGRESQL_POST_INSTALL_STAGING_HOOKS += POSTGRESQL_INSTALL_CUSTOM_PG_CONFIG
86 define POSTGRESQL_INSTALL_INIT_SYSV
87 $(INSTALL) -m 0755 -D package/postgresql/S50postgresql \
88 $(TARGET_DIR)/etc/init.d/S50postgresql
89 endef
91 define POSTGRESQL_INSTALL_INIT_SYSTEMD
92 $(INSTALL) -D -m 644 package/postgresql/postgresql.service \
93 $(TARGET_DIR)/usr/lib/systemd/system/postgresql.service
94 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
95 ln -fs ../../../../usr/lib/systemd/system/postgresql.service \
96 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/postgresql.service
97 endef
99 $(eval $(autotools-package))