postgresql.mk 2.8 KB

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