2
1

postgresql.mk 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. ################################################################################
  2. #
  3. # postgresql
  4. #
  5. ################################################################################
  6. POSTGRESQL_VERSION = 9.4.1
  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. # In most cases, postgresql configure script is able to guess the
  14. # platform, except for noMMU platforms that use the 'uclinux' host
  15. # qualifier, as is the case on Blackfin
  16. POSTGRESQL_CONF_OPTS = --with-template=linux
  17. ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
  18. # overwrite IPV6 detection
  19. ifeq ($(BR2_INET_IPV6),y)
  20. POSTGRESQL_CONF_ENV += ac_cv_type_struct_sockaddr_in6=yes
  21. else
  22. POSTGRESQL_CONF_ENV += ac_cv_type_struct_sockaddr_in6=no
  23. endif
  24. # PostgreSQL does not build against uClibc with locales
  25. # enabled, due to an uClibc bug, see
  26. # http://lists.uclibc.org/pipermail/uclibc/2014-April/048326.html
  27. # so overwrite automatic detection and disable locale support
  28. POSTGRESQL_CONF_ENV += pgac_cv_type_locale_t=no
  29. endif
  30. ifneq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
  31. POSTGRESQL_CONF_OPTS += --disable-thread-safety
  32. endif
  33. ifeq ($(BR2_bfin)$(BR2_microblazeel)$(BR2_microblazebe)$(BR2_nios2)$(BR2_xtensa),y)
  34. POSTGRESQL_CONF_OPTS += --disable-spinlocks
  35. endif
  36. ifeq ($(BR2_PACKAGE_READLINE),y)
  37. POSTGRESQL_DEPENDENCIES += readline
  38. else
  39. POSTGRESQL_CONF_OPTS += --without-readline
  40. endif
  41. ifeq ($(BR2_PACKAGE_ZLIB),y)
  42. POSTGRESQL_DEPENDENCIES += zlib
  43. else
  44. POSTGRESQL_CONF_OPTS += --without-zlib
  45. endif
  46. ifeq ($(BR2_PACKAGE_TZDATA),y)
  47. POSTGRESQL_DEPENDENCIES += tzdata
  48. POSTGRESQL_CONF_OPTS += --with-system-tzdata=/usr/share/zoneinfo
  49. else
  50. POSTGRESQL_DEPENDENCIES += host-zic
  51. POSTGRESQL_CONF_ENV += ZIC=$$(ZIC)
  52. endif
  53. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  54. POSTGRESQL_DEPENDENCIES += openssl
  55. POSTGRESQL_CONF_OPTS += --with-openssl
  56. endif
  57. define POSTGRESQL_USERS
  58. postgres -1 postgres -1 * /var/lib/pgsql /bin/sh - PostgreSQL Server
  59. endef
  60. define POSTGRESQL_INSTALL_TARGET_FIXUP
  61. $(INSTALL) -dm 0700 $(TARGET_DIR)/var/lib/pgsql
  62. $(RM) -rf $(TARGET_DIR)/usr/lib/postgresql/pgxs
  63. endef
  64. POSTGRESQL_POST_INSTALL_TARGET_HOOKS += POSTGRESQL_INSTALL_TARGET_FIXUP
  65. define POSTGRESQL_INSTALL_CUSTOM_PG_CONFIG
  66. $(INSTALL) -m 0755 -D package/postgresql/pg_config \
  67. $(STAGING_DIR)/usr/bin/pg_config
  68. endef
  69. POSTGRESQL_POST_INSTALL_STAGING_HOOKS += POSTGRESQL_INSTALL_CUSTOM_PG_CONFIG
  70. define POSTGRESQL_INSTALL_INIT_SYSV
  71. $(INSTALL) -m 0755 -D package/postgresql/S50postgresql \
  72. $(TARGET_DIR)/etc/init.d/S50postgresql
  73. endef
  74. define POSTGRESQL_INSTALL_INIT_SYSTEMD
  75. $(INSTALL) -D -m 644 package/postgresql/postgresql.service \
  76. $(TARGET_DIR)/etc/systemd/system/postgresql.service
  77. mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
  78. ln -fs ../postgresql.service \
  79. $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/postgresql.service
  80. endef
  81. $(eval $(autotools-package))