2
1

postgresql.mk 2.7 KB

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