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