postgresql.mk 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. ################################################################################
  2. #
  3. # postgresql
  4. #
  5. ################################################################################
  6. POSTGRESQL_VERSION = 9.4.6
  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_format="%lld" \
  15. pgac_cv_snprintf_size_t_support=yes
  16. POSTGRESQL_AUTORECONF = 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_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. endif
  52. define POSTGRESQL_USERS
  53. postgres -1 postgres -1 * /var/lib/pgsql /bin/sh - PostgreSQL Server
  54. endef
  55. define POSTGRESQL_INSTALL_TARGET_FIXUP
  56. $(INSTALL) -dm 0700 $(TARGET_DIR)/var/lib/pgsql
  57. $(RM) -rf $(TARGET_DIR)/usr/lib/postgresql/pgxs
  58. endef
  59. POSTGRESQL_POST_INSTALL_TARGET_HOOKS += POSTGRESQL_INSTALL_TARGET_FIXUP
  60. define POSTGRESQL_INSTALL_CUSTOM_PG_CONFIG
  61. $(INSTALL) -m 0755 -D package/postgresql/pg_config \
  62. $(STAGING_DIR)/usr/bin/pg_config
  63. endef
  64. POSTGRESQL_POST_INSTALL_STAGING_HOOKS += POSTGRESQL_INSTALL_CUSTOM_PG_CONFIG
  65. define POSTGRESQL_INSTALL_INIT_SYSV
  66. $(INSTALL) -m 0755 -D package/postgresql/S50postgresql \
  67. $(TARGET_DIR)/etc/init.d/S50postgresql
  68. endef
  69. define POSTGRESQL_INSTALL_INIT_SYSTEMD
  70. $(INSTALL) -D -m 644 package/postgresql/postgresql.service \
  71. $(TARGET_DIR)/usr/lib/systemd/system/postgresql.service
  72. mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
  73. ln -fs ../../../../usr/lib/systemd/system/postgresql.service \
  74. $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/postgresql.service
  75. endef
  76. $(eval $(autotools-package))