postgresql.mk 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. ################################################################################
  2. #
  3. # postgresql
  4. #
  5. ################################################################################
  6. POSTGRESQL_VERSION = 10.7
  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 = \
  14. ac_cv_type_struct_sockaddr_in6=yes \
  15. pgac_cv_snprintf_long_long_int_modifier="ll" \
  16. pgac_cv_snprintf_size_t_support=yes
  17. POSTGRESQL_CONF_OPTS = --disable-rpath
  18. ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
  19. # PostgreSQL does not build against uClibc with locales
  20. # enabled, due to an uClibc bug, see
  21. # http://lists.uclibc.org/pipermail/uclibc/2014-April/048326.html
  22. # so overwrite automatic detection and disable locale support
  23. POSTGRESQL_CONF_ENV += pgac_cv_type_locale_t=no
  24. endif
  25. ifneq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
  26. POSTGRESQL_CONF_OPTS += --disable-thread-safety
  27. endif
  28. ifeq ($(BR2_arcle)$(BR2_arceb)$(BR2_microblazeel)$(BR2_microblazebe)$(BR2_or1k)$(BR2_nios2)$(BR2_xtensa),y)
  29. POSTGRESQL_CONF_OPTS += --disable-spinlocks
  30. endif
  31. ifeq ($(BR2_PACKAGE_READLINE),y)
  32. POSTGRESQL_DEPENDENCIES += readline
  33. else
  34. POSTGRESQL_CONF_OPTS += --without-readline
  35. endif
  36. ifeq ($(BR2_PACKAGE_ZLIB),y)
  37. POSTGRESQL_DEPENDENCIES += zlib
  38. else
  39. POSTGRESQL_CONF_OPTS += --without-zlib
  40. endif
  41. ifeq ($(BR2_PACKAGE_TZDATA),y)
  42. POSTGRESQL_DEPENDENCIES += tzdata
  43. POSTGRESQL_CONF_OPTS += --with-system-tzdata=/usr/share/zoneinfo
  44. else
  45. POSTGRESQL_DEPENDENCIES += host-zic
  46. POSTGRESQL_CONF_ENV += ZIC="$(ZIC)"
  47. endif
  48. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  49. POSTGRESQL_DEPENDENCIES += openssl
  50. POSTGRESQL_CONF_OPTS += --with-openssl
  51. else
  52. # PostgreSQL checks for /dev/urandom and fails if it's being cross-compiled and
  53. # an SSL library isn't found. Since /dev/urandom is guaranteed to be provided
  54. # on Linux systems, explicitly tell the configure script it's available.
  55. POSTGRESQL_CONF_ENV += ac_cv_file__dev_urandom=yes
  56. endif
  57. ifeq ($(BR2_PACKAGE_OPENLDAP),y)
  58. POSTGRESQL_DEPENDENCIES += openldap
  59. POSTGRESQL_CONF_OPTS += --with-ldap
  60. else
  61. POSTGRESQL_CONF_OPTS += --without-ldap
  62. endif
  63. define POSTGRESQL_USERS
  64. postgres -1 postgres -1 * /var/lib/pgsql /bin/sh - PostgreSQL Server
  65. endef
  66. define POSTGRESQL_INSTALL_TARGET_FIXUP
  67. $(INSTALL) -dm 0700 $(TARGET_DIR)/var/lib/pgsql
  68. $(RM) -rf $(TARGET_DIR)/usr/lib/postgresql/pgxs
  69. endef
  70. POSTGRESQL_POST_INSTALL_TARGET_HOOKS += POSTGRESQL_INSTALL_TARGET_FIXUP
  71. define POSTGRESQL_INSTALL_CUSTOM_PG_CONFIG
  72. $(INSTALL) -m 0755 -D package/postgresql/pg_config \
  73. $(STAGING_DIR)/usr/bin/pg_config
  74. endef
  75. POSTGRESQL_POST_INSTALL_STAGING_HOOKS += POSTGRESQL_INSTALL_CUSTOM_PG_CONFIG
  76. define POSTGRESQL_INSTALL_INIT_SYSV
  77. $(INSTALL) -m 0755 -D package/postgresql/S50postgresql \
  78. $(TARGET_DIR)/etc/init.d/S50postgresql
  79. endef
  80. define POSTGRESQL_INSTALL_INIT_SYSTEMD
  81. $(INSTALL) -D -m 644 package/postgresql/postgresql.service \
  82. $(TARGET_DIR)/usr/lib/systemd/system/postgresql.service
  83. mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
  84. ln -fs ../../../../usr/lib/systemd/system/postgresql.service \
  85. $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/postgresql.service
  86. endef
  87. $(eval $(autotools-package))