postgresql.mk 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
  14. # PostgreSQL does not build against uClibc with locales
  15. # enabled, due to an uClibc bug, see
  16. # http://lists.uclibc.org/pipermail/uclibc/2014-April/048326.html
  17. # so overwrite automatic detection and disable locale support
  18. POSTGRESQL_CONF_ENV += pgac_cv_type_locale_t=no
  19. endif
  20. ifneq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
  21. POSTGRESQL_CONF_OPTS += --disable-thread-safety
  22. endif
  23. ifeq ($(BR2_microblazeel)$(BR2_microblazebe)$(BR2_nios2),y)
  24. POSTGRESQL_CONF_OPTS += --disable-spinlocks
  25. endif
  26. ifeq ($(BR2_PACKAGE_READLINE),y)
  27. POSTGRESQL_DEPENDENCIES += readline
  28. else
  29. POSTGRESQL_CONF_OPTS += --without-readline
  30. endif
  31. ifeq ($(BR2_PACKAGE_ZLIB),y)
  32. POSTGRESQL_DEPENDENCIES += zlib
  33. else
  34. POSTGRESQL_CONF_OPTS += --without-zlib
  35. endif
  36. ifeq ($(BR2_PACKAGE_TZDATA),y)
  37. POSTGRESQL_DEPENDENCIES += tzdata
  38. POSTGRESQL_CONF_OPTS += --with-system-tzdata=/usr/share/zoneinfo
  39. else
  40. POSTGRESQL_DEPENDENCIES += host-zic
  41. POSTGRESQL_CONF_ENV += ZIC=$$(ZIC)
  42. endif
  43. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  44. POSTGRESQL_DEPENDENCIES += openssl
  45. POSTGRESQL_CONF_OPTS += --with-openssl
  46. endif
  47. define POSTGRESQL_USERS
  48. postgres -1 postgres -1 * /var/lib/pgsql /bin/sh - PostgreSQL Server
  49. endef
  50. define POSTGRESQL_INSTALL_TARGET_FIXUP
  51. $(INSTALL) -dm 0700 $(TARGET_DIR)/var/lib/pgsql
  52. $(RM) -rf $(TARGET_DIR)/usr/lib/postgresql/pgxs
  53. endef
  54. POSTGRESQL_POST_INSTALL_TARGET_HOOKS += POSTGRESQL_INSTALL_TARGET_FIXUP
  55. define POSTGRESQL_INSTALL_CUSTOM_PG_CONFIG
  56. $(INSTALL) -m 0755 -D package/postgresql/pg_config \
  57. $(STAGING_DIR)/usr/bin/pg_config
  58. endef
  59. POSTGRESQL_POST_INSTALL_STAGING_HOOKS += POSTGRESQL_INSTALL_CUSTOM_PG_CONFIG
  60. define POSTGRESQL_INSTALL_INIT_SYSV
  61. $(INSTALL) -m 0755 -D package/postgresql/S50postgresql \
  62. $(TARGET_DIR)/etc/init.d/S50postgresql
  63. endef
  64. define POSTGRESQL_INSTALL_INIT_SYSTEMD
  65. $(INSTALL) -D -m 644 package/postgresql/postgresql.service \
  66. $(TARGET_DIR)/etc/systemd/system/postgresql.service
  67. mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
  68. ln -fs ../postgresql.service \
  69. $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/postgresql.service
  70. endef
  71. $(eval $(autotools-package))