summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--package/Config.in1
-rw-r--r--package/c-icap/Config.in16
-rw-r--r--package/c-icap/S96cicap27
-rw-r--r--package/c-icap/c-icap.hash2
-rw-r--r--package/c-icap/c-icap.mk70
5 files changed, 116 insertions, 0 deletions
diff --git a/package/Config.in b/package/Config.in
index d9b0794279..4df5cdbb4c 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1159,6 +1159,7 @@ menu "Networking applications"
source "package/boa/Config.in"
source "package/bridge-utils/Config.in"
source "package/bwm-ng/Config.in"
+ source "package/c-icap/Config.in"
source "package/can-utils/Config.in"
source "package/chrony/Config.in"
source "package/civetweb/Config.in"
diff --git a/package/c-icap/Config.in b/package/c-icap/Config.in
new file mode 100644
index 0000000000..f949c16fa1
--- /dev/null
+++ b/package/c-icap/Config.in
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_C_ICAP
+ bool "c-icap"
+ depends on !BR2_PREFER_STATIC_LIB
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ help
+ c-icap is an implementation of an ICAP server. It can be
+ used with HTTP proxies that support the ICAP protocol to
+ implement content adaptation and filtering services. Most
+ of the commercial HTTP proxies must support the ICAP
+ protocol. The open source Squid 3.x proxy server supports
+ it.
+
+ http://c-icap.sourceforge.net/
+
+comment "c-icap needs a toolchain w/ threads and dynamic library"
+ depends on BR2_PREFER_STATIC_LIB || !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/c-icap/S96cicap b/package/c-icap/S96cicap
new file mode 100644
index 0000000000..baef334f46
--- /dev/null
+++ b/package/c-icap/S96cicap
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# (Re)create directories
+mkdir -p /var/run/c-icap
+mkdir -p /var/log/c-icap
+
+case "$1" in
+ start)
+ echo -n "Starting c-icap server: "
+ start-stop-daemon -S -q -b -m -p /var/run/c-icap.pid \
+ -x /usr/bin/c-icap -- -N
+ [ $? == 0 ] && echo "OK" || echo "FAIL"
+ ;;
+ stop)
+ echo -n "Stopping c-icap server: "
+ start-stop-daemon -K -q -p /var/run/c-icap.pid
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
+ ;;
+ restart|reload)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "Usage: /etc/init.d/S96cicap {start|stop|restart|reload}"
+ exit 1
+esac
diff --git a/package/c-icap/c-icap.hash b/package/c-icap/c-icap.hash
new file mode 100644
index 0000000000..89c70f423e
--- /dev/null
+++ b/package/c-icap/c-icap.hash
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 46b97fab73dbb9e8def8e34c3f94048c92f50a5341bb85bec4f6f6349aec529a c_icap-0.3.5.tar.gz
diff --git a/package/c-icap/c-icap.mk b/package/c-icap/c-icap.mk
new file mode 100644
index 0000000000..51c0f5fc29
--- /dev/null
+++ b/package/c-icap/c-icap.mk
@@ -0,0 +1,70 @@
+################################################################################
+#
+# c-icap
+#
+################################################################################
+
+C_ICAP_VERSION = 0.3.5
+C_ICAP_SOURCE = c_icap-$(C_ICAP_VERSION).tar.gz
+C_ICAP_SITE = http://downloads.sourceforge.net/c-icap/
+C_ICAP_LICENSE = LGPLv2.1+
+C_ICAP_LICENSE_FILES = COPYING
+C_ICAP_INSTALL_STAGING = YES
+C_ICAP_CONFIG_SCRIPTS = c-icap-config c-icap-libicapapi-config
+C_ICAP_CONF_OPTS = \
+ --with-process-mutexes=posix \
+ --without-ldap \
+ --enable-large-files \
+ --enable-ipv6
+
+ifeq ($(BR2_PACKAGE_BERKELEYDB),y)
+C_ICAP_CONF_OPTS += --with-berkeleydb
+C_ICAP_DEPENDENCIES += berkeleydb
+else
+C_ICAP_CONF_OPTS += --without-berkeleydb
+endif
+
+ifeq ($(BR2_PACKAGE_BZIP2),y)
+C_ICAP_CONF_OPTS += --with-bzip2
+C_ICAP_DEPENDENCIES += bzip2
+else
+C_ICAP_CONF_OPTS += --without-bzip2
+endif
+
+ifeq ($(BR2_PACKAGE_PERL),y)
+C_ICAP_CONF_OPTS += --with-perl
+C_ICAP_DEPENDENCIES += perl
+else
+C_ICAP_CONF_OPTS += --without-perl
+endif
+
+ifeq ($(BR2_PACKAGE_ZLIB),y)
+C_ICAP_CONF_OPTS += --with-zlib
+C_ICAP_DEPENDENCIES += zlib
+else
+C_ICAP_CONF_OPTS += --without-zlib
+endif
+
+define C_ICAP_INSTALL_INIT_SYSV
+ $(INSTALL) -m 0755 -D package/c-icap/S96cicap $(TARGET_DIR)/etc/init.d/S96cicap
+endef
+
+# Tweak the installation:
+# - Removed unneeded sample configuration files (c-icap.*.default),
+# since some real ones are also installed
+# - Tweak some paths in the c-icap.conf configuration file
+# - Tweak the -config scripts, because the generic
+# <pkg>_CONFIG_SCRIPTS logic doesn't tweak them enough
+define C_ICAP_TUNE_INSTALLATION
+ $(RM) -f $(TARGET_DIR)/etc/c-icap.*.default
+ $(SED) 's%/usr/etc/%/etc/%' $(TARGET_DIR)/etc/c-icap.conf
+ $(SED) 's%/usr/var/%/var/%' $(TARGET_DIR)/etc/c-icap.conf
+ $(SED) 's%INCDIR=.*%INCDIR=$(STAGING_DIR)/usr/include%' \
+ $(STAGING_DIR)/usr/bin/{c-icap,c-icap-libicapapi}-config
+ $(SED) 's%INCDIR2=.*%INCDIR2=$(STAGING_DIR)/usr/include/c_icap%' \
+ $(STAGING_DIR)/usr/bin/{c-icap,c-icap-libicapapi}-config
+endef
+
+C_ICAP_POST_INSTALL_TARGET_HOOKS += C_ICAP_TUNE_INSTALLATION
+
+$(eval $(autotools-package))
OpenPOWER on IntegriCloud