package/iputils: patch ping to link against libm
[buildroot-gz.git] / package / postgresql / postgresql.mk
blob444c1b132144e13f10112b10b2c3251b74a8fae0
1 ################################################################################
3 # postgresql
5 ################################################################################
7 POSTGRESQL_VERSION = 9.4.6
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 = ac_cv_type_struct_sockaddr_in6=yes \
15 pgac_cv_snprintf_long_long_int_format="%lld" \
16 pgac_cv_snprintf_size_t_support=yes
17 POSTGRESQL_AUTORECONF = 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 define POSTGRESQL_USERS
62 postgres -1 postgres -1 * /var/lib/pgsql /bin/sh - PostgreSQL Server
63 endef
65 define POSTGRESQL_INSTALL_TARGET_FIXUP
66 $(INSTALL) -dm 0700 $(TARGET_DIR)/var/lib/pgsql
67 $(RM) -rf $(TARGET_DIR)/usr/lib/postgresql/pgxs
68 endef
70 POSTGRESQL_POST_INSTALL_TARGET_HOOKS += POSTGRESQL_INSTALL_TARGET_FIXUP
72 define POSTGRESQL_INSTALL_CUSTOM_PG_CONFIG
73 $(INSTALL) -m 0755 -D package/postgresql/pg_config \
74 $(STAGING_DIR)/usr/bin/pg_config
75 endef
77 POSTGRESQL_POST_INSTALL_STAGING_HOOKS += POSTGRESQL_INSTALL_CUSTOM_PG_CONFIG
79 define POSTGRESQL_INSTALL_INIT_SYSV
80 $(INSTALL) -m 0755 -D package/postgresql/S50postgresql \
81 $(TARGET_DIR)/etc/init.d/S50postgresql
82 endef
84 define POSTGRESQL_INSTALL_INIT_SYSTEMD
85 $(INSTALL) -D -m 644 package/postgresql/postgresql.service \
86 $(TARGET_DIR)/usr/lib/systemd/system/postgresql.service
87 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
88 ln -fs ../../../../usr/lib/systemd/system/postgresql.service \
89 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/postgresql.service
90 endef
92 $(eval $(autotools-package))