c-icap.mk 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. ################################################################################
  2. #
  3. # c-icap
  4. #
  5. ################################################################################
  6. C_ICAP_VERSION = 0.5.6
  7. C_ICAP_SOURCE = c_icap-$(C_ICAP_VERSION).tar.gz
  8. C_ICAP_SITE = http://downloads.sourceforge.net/c-icap
  9. C_ICAP_LICENSE = LGPL-2.1+
  10. C_ICAP_LICENSE_FILES = COPYING
  11. C_ICAP_INSTALL_STAGING = YES
  12. C_ICAP_CONFIG_SCRIPTS = c-icap-config c-icap-libicapapi-config
  13. C_ICAP_CONF_OPTS = \
  14. --without-perl \
  15. --enable-large-files \
  16. --enable-ipv6
  17. # Pre-seed cache variables for tests done with AC_TRY_RUN that are not
  18. # cross-compile friendly
  19. C_ICAP_CONF_ENV = ac_cv_10031b_ipc_sem=yes ac_cv_fcntl=yes
  20. # c-icap adds '-Wl,-rpath -Wl,/usr/lib' to the link command line. This
  21. # causes the linker to search for libraries that are listed as NEEDED
  22. # in the libicapapi.so ELF header in host libraries, which breaks the
  23. # build. The affected library is libz. Forcing AUTORECONF adds -lz to
  24. # the link command line, and that makes the linker look first in
  25. # sysroot, thus avoiding the build breakage.
  26. C_ICAP_AUTORECONF = YES
  27. ifeq ($(BR2_PACKAGE_BERKELEYDB),y)
  28. C_ICAP_CONF_OPTS += --with-bdb
  29. C_ICAP_DEPENDENCIES += berkeleydb
  30. else
  31. C_ICAP_CONF_OPTS += --without-bdb
  32. endif
  33. ifeq ($(BR2_PACKAGE_BZIP2),y)
  34. C_ICAP_CONF_OPTS += --with-bzlib
  35. C_ICAP_DEPENDENCIES += bzip2
  36. else
  37. C_ICAP_CONF_OPTS += --without-bzlib
  38. endif
  39. ifeq ($(BR2_PACKAGE_LIBMEMCACHED),y)
  40. C_ICAP_CONF_OPTS += --with-memcached
  41. C_ICAP_DEPENDENCIES += libmemcached
  42. else
  43. C_ICAP_CONF_OPTS += --without-memcached
  44. endif
  45. ifeq ($(BR2_PACKAGE_OPENLDAP),y)
  46. C_ICAP_CONF_OPTS += --with-ldap
  47. C_ICAP_DEPENDENCIES += openldap
  48. else
  49. C_ICAP_CONF_OPTS += --without-ldap
  50. endif
  51. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  52. C_ICAP_CONF_OPTS += --with-openssl
  53. C_ICAP_DEPENDENCIES += openssl
  54. else
  55. C_ICAP_CONF_OPTS += --without-openssl
  56. endif
  57. ifeq ($(BR2_PACKAGE_PCRE),y)
  58. C_ICAP_CONF_OPTS += --with-pcre
  59. C_ICAP_DEPENDENCIES += pcre
  60. else
  61. C_ICAP_CONF_OPTS += --without-pcre
  62. endif
  63. ifeq ($(BR2_PACKAGE_ZLIB),y)
  64. C_ICAP_CONF_OPTS += --with-zlib
  65. C_ICAP_DEPENDENCIES += zlib
  66. else
  67. C_ICAP_CONF_OPTS += --without-zlib
  68. endif
  69. define C_ICAP_INSTALL_INIT_SYSV
  70. $(INSTALL) -m 0755 -D package/c-icap/S96cicap $(TARGET_DIR)/etc/init.d/S96cicap
  71. endef
  72. # Tweak the installation:
  73. # - Removed unneeded sample configuration files (c-icap.*.default),
  74. # since some real ones are also installed
  75. # - Tweak some paths in the c-icap.conf configuration file
  76. # - Tweak the -config scripts, because the generic
  77. # <pkg>_CONFIG_SCRIPTS logic doesn't tweak them enough
  78. define C_ICAP_TUNE_INSTALLATION
  79. $(RM) -f $(TARGET_DIR)/etc/c-icap.*.default
  80. $(SED) 's%/usr/etc/%/etc/%' $(TARGET_DIR)/etc/c-icap.conf
  81. $(SED) 's%/usr/var/%/var/%' $(TARGET_DIR)/etc/c-icap.conf
  82. $(SED) 's%INCDIR=.*%INCDIR=$(STAGING_DIR)/usr/include%' \
  83. $(STAGING_DIR)/usr/bin/{c-icap,c-icap-libicapapi}-config
  84. $(SED) 's%INCDIR2=.*%INCDIR2=$(STAGING_DIR)/usr/include/c_icap%' \
  85. $(STAGING_DIR)/usr/bin/{c-icap,c-icap-libicapapi}-config
  86. $(SED) 's%-L$$LIBDIR %%' $(STAGING_DIR)/usr/bin/c-icap-libicapapi-config
  87. endef
  88. C_ICAP_POST_INSTALL_TARGET_HOOKS += C_ICAP_TUNE_INSTALLATION
  89. $(eval $(autotools-package))