Add ICAP server support
cover Add ICAP server support
Hi,
This patch series enable ICAP support in squid and add c-icap and c-icap-modules packages.
Regards,
Guillaume
----------------------------------------------------------------
Guillaume GARDET (3):
Enable c-icap server support in squid and define logdir, pidfile and
swapdir
New package: c-icap c-icap is an implementation of an ICAP server.
Squid 3.x proxy server supports it.
New package: c-icap-modules Additionals modules for c-icap server.
package/Config.in | 2 ++ package/c-icap-modules/Config.in | 7 +++++++ package/c-icap-modules/c-icap-modules.mk | 27 +++++++++++++++++++++++++++ package/c-icap/Config.in | 10 ++++++++++ package/c-icap/c-icap.mk | 24 ++++++++++++++++++++++++ package/squid/squid.mk | 12 ++++++++++-- 6 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 package/c-icap-modules/Config.in create mode 100644 package/c-icap-modules/c-icap-modules.mk create mode 100644 package/c-icap/Config.in create mode 100644 package/c-icap/c-icap.mk
Signature · 1 line
1.8.4.5
PATCH 1/3 package/squid: enable ICAP server support in squid and define logdir, pidfile and swapdir
This patch adds ICAP server support to squid and also defines logdir, pidfile and swapdir.
--- package/squid/squid.mk | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
package/squid/squid.mk +10 -2
@@ -26,7 +26,11 @@ SQUID_CONF_OPT = --enable-async-io=8 --enable-linux-netfilter \ --enable-auth-negotiate="wrapper" \ --enable-auth-ntlm="fake" \ --disable-strict-error-checking \ - --enable-external-acl-helpers="file_userip" + --enable-external-acl-helpers="file_userip" \ + --with-logdir=/var/log/squid/ \ + --with-pidfile=/var/run/squid.pid \ + --with-swapdir=/var/cache/squid/ \ + --enable-icap-client # On uClibc librt needs libpthread ifeq ($(BR2_TOOLCHAIN_HAS_THREADS)$(BR2_TOOLCHAIN_USES_UCLIBC),yy)
@@ -45,6 +49,10 @@ define SQUID_CLEANUP_TARGET cachemgr.conf mime.conf.default squid.conf.default) endef -SQUID_POST_INSTALL_TARGET_HOOKS += SQUID_CLEANUP_TARGET +define SQUID_CREATE_MISSING_FOLDER + mkdir -p $(TARGET_DIR)/var/log/squid/ +endef + +SQUID_POST_INSTALL_TARGET_HOOKS += SQUID_CLEANUP_TARGET SQUID_CREATE_MISSING_FOLDER $(eval $(autotools-package))
Signature · 1 line
1.8.4.5
PATCH 1/3 package/squid: enable ICAP server support in squid and define logdir, pidfile and swapdir
Dear Guillaume GARDET,
Quoted 4 lines · Guillaume GARDET
This patch adds ICAP server support to squid and also defines logdir, pidfile and swapdir.
Signed-off-by Guillaume GARDET <[email protected]>
Thanks for this contribution. A few comments below.
Quoted 20 lines
package/squid/squid.mk +5
-1@@ -26,7 +26,11 @@ SQUID_CONF_OPT = --enable-async-io=8 --enable-linux-netfilter \ --enable-auth-negotiate="wrapper" \ --enable-auth-ntlm="fake" \ --disable-strict-error-checking \ - --enable-external-acl-helpers="file_userip" + --enable-external-acl-helpers="file_userip" \ + --with-logdir=/var/log/squid/ \ + --with-pidfile=/var/run/squid.pid \ + --with-swapdir=/var/cache/squid/ \ + --enable-icap-client # On uClibc librt needs libpthread ifeq ($(BR2_TOOLCHAIN_HAS_THREADS)$(BR2_TOOLCHAIN_USES_UCLIBC),yy)@@ -45,6 +49,10 @@ define SQUID_CLEANUP_TARGET cachemgr.conf mime.conf.default squid.conf.default)
package/squid/squid.mk define SQUID_CLEANUP_TARGET · line 58
Quoted 10 lines
package/squid/squid.mk +5
-1endef -SQUID_POST_INSTALL_TARGET_HOOKS += SQUID_CLEANUP_TARGET +define SQUID_CREATE_MISSING_FOLDER + mkdir -p $(TARGET_DIR)/var/log/squid/ +endef + +SQUID_POST_INSTALL_TARGET_HOOKS += SQUID_CLEANUP_TARGET SQUID_CREATE_MISSING_FOLDER $(eval $(autotools-package))
I believe the changes of adding the log directory, pidfile and swapdir on one side, and adding the ICAP client option on the other side should be two separate patches.
Also, how much does the ICAP client support adds to Squid size? I'm trying to see if this should be optional instead of always enabled like you're proposing.
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/3 package/squid: enable ICAP server support in squid and define logdir, pidfile and swapdir
Hi Thomas,
Le 05/10/2014 23:52, Thomas Petazzoni a ?crit :
Quoted 37 lines
Dear Guillaume GARDET,
Quoted 4 lines · Guillaume GARDET
This patch adds ICAP server support to squid and also defines logdir, pidfile and swapdir.
Signed-off-by Guillaume GARDET <[email protected]>Thanks for this contribution. A few comments below.
Quoted 28 lines
package/squid/squid.mk +10
-2@@ -26,7 +26,11 @@ SQUID_CONF_OPT = --enable-async-io=8 --enable-linux-netfilter \ --enable-auth-negotiate="wrapper" \ --enable-auth-ntlm="fake" \ --disable-strict-error-checking \ - --enable-external-acl-helpers="file_userip" + --enable-external-acl-helpers="file_userip" \ + --with-logdir=/var/log/squid/ \ + --with-pidfile=/var/run/squid.pid \ + --with-swapdir=/var/cache/squid/ \ + --enable-icap-client # On uClibc librt needs libpthread ifeq ($(BR2_TOOLCHAIN_HAS_THREADS)$(BR2_TOOLCHAIN_USES_UCLIBC),yy)@@ -45,6 +49,10 @@ define SQUID_CLEANUP_TARGET cachemgr.conf mime.conf.default squid.conf.default) endef -SQUID_POST_INSTALL_TARGET_HOOKS += SQUID_CLEANUP_TARGET +define SQUID_CREATE_MISSING_FOLDER + mkdir -p $(TARGET_DIR)/var/log/squid/ +endef + +SQUID_POST_INSTALL_TARGET_HOOKS += SQUID_CLEANUP_TARGET SQUID_CREATE_MISSING_FOLDER
Quoted 4 lines
package/squid/squid.mk define SQUID_CLEANUP_TARGET · line 58
Quoted 1 line
package/squid/squid.mk +0
-0$(eval $(autotools-package))I believe the changes of adding the log directory, pidfile and swapdir on one side, and adding the ICAP client option on the other side should be two separate patches.
Ok, will submit two patches then.
Quoted 4 lines
Also, how much does the ICAP client support adds to Squid size? I'm trying to see if this should be optional instead of always enabled like you're proposing.
Without: 2.7 MB,and with c-icap: 3.0 MB
Should I make it optionnal?
Guillaume
PATCH 1/3 package/squid: enable ICAP server support in squid and define logdir, pidfile and swapdir
Hello,
Quoted 5 lines · Guillaume GARDET - Olis?o
Quoted 3 lines
I believe the changes of adding the log directory, pidfile and swapdir on one side, and adding the ICAP client option on the other side should be two separate patches.
Ok, will submit two patches then.
Great thanks.
Quoted 7 lines
Quoted 3 lines
Also, how much does the ICAP client support adds to Squid size? I'm trying to see if this should be optional instead of always enabled like you're proposing.
Without: 2.7 MB,and with c-icap: 3.0 MB
Should I make it optionnal?
I would tend to say yes. Making it optional not only saves space, but it also makes it explicit that our Squid build can support the ICAP client functionality.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/3 package/squid: enable ICAP server support in squid and define logdir, pidfile and swapdir
Quoted 7 lines · Thomas Petazzoni
Quoted 3 lines
Without: 2.7 MB,and with c-icap: 3.0 MB
Should I make it optionnal?
I would tend to say yes. Making it optional not only saves space, but it also makes it explicit that our Squid build can support the ICAP client functionality.
I wouldn't mind keeping it as is, squid is a big RAM and storage sinkhole so it's a no-go for memory-constrained targets in general, after all it's a caching (in disk) proxy with the RAM usage for keeping indexes at hand.
Regards.
PATCH 1/3 package/squid: enable ICAP server support in squid and define logdir, pidfile and swapdir
Le 08/10/2014 22:24, Gustavo Zacarias a ?crit :
Quoted 5 lines · Thomas Petazzoni
Quoted 4 lines
Quoted 4 lines
Without: 2.7 MB,and with c-icap: 3.0 MB
Should I make it optionnal?
Quoted 10 lines
Quoted 3 lines
I would tend to say yes. Making it optional not only saves space, but it also makes it explicit that our Squid build can support the ICAP client functionality.
I wouldn't mind keeping it as is, squid is a big RAM and storage sinkhole so it's a no-go for memory-constrained targets in general, after all it's a caching (in disk) proxy with the RAM usage for keeping indexes at hand.
Regards.
Then, should I make it optionnal or not? I think it should be ok to keep it included as it will never be used on underpowered SoC.
Thomas, would you be ok with that?
Guillaume
PATCH 1/3 package/squid: enable ICAP server support in squid and define logdir, pidfile and swapdir
Dear Guillaume GARDET - Olis?o,
Quoted 4 lines · Guillaume GARDET - Olis?o
Then, should I make it optionnal or not? I think it should be ok to keep it included as it will never be used on underpowered SoC.
Thomas, would you be ok with that?
Yes, fair enough, keeping it always enabled is fine with me.
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 2/3 New package: c-icap c-icap is an implementation of an ICAP server. Squid 3.x proxy server supports it.
In reply to Guillaume GARDETThis patch adds c-icap server, a free ICAP server. It can be used with squid server.
--- package/Config.in | 1 + package/c-icap/Config.in | 10 ++++++++++ package/c-icap/c-icap.mk | 24 ++++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 package/c-icap/Config.in create mode 100644 package/c-icap/c-icap.mk
package/Config.in +1 -0
@@ -950,6 +950,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"
package/c-icap/Config.in new file +10 -0
@@ -0,0 +1,10 @@ +config BR2_PACKAGE_C_ICAP + bool "c-icap" + 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/
package/c-icap/c-icap.mk new file +24 -0
@@ -0,0 +1,24 @@ +################################################################################ +# +# c-icap +# +################################################################################ + +C_ICAP_VERSION = 0.3.4 +C_ICAP_SOURCE = c_icap-$(C_ICAP_VERSION).tar.gz +C_ICAP_SITE = http://downloads.sourceforge.net/c-icap/ +C_ICAP_INSTALL_STAGING = YES +C_ICAP_INSTALL_TARGET = YES +C_ICAP_CONF_OPT = --sysconfdir=/etc --with-process-mutexes=posix --enable-large-files +C_ICAP_DEPENDENCIES = + +define C_ICAP_INSTALL_TARGET_CONFIGS + mkdir -p $(TARGET_DIR)/var/run/c-icap/ + mkdir -p $(TARGET_DIR)/tmp/c-icap/ + mkdir -p $(STAGING_DIR)/var/run/c-icap/ + mkdir -p $(STAGING_DIR)/tmp/c-icap/ +endef + +C_ICAP_POST_INSTALL_TARGET_HOOKS = C_ICAP_INSTALL_TARGET_CONFIGS + +$(eval $(autotools-package))
Signature · 1 line
1.8.4.5
PATCH 2/3 New package: c-icap c-icap is an implementation of an ICAP server. Squid 3.x proxy server supports it.
Dear Guillaume GARDET,
The title of the commit should just be:
c-icap: new package
Quoted 7 lines · Guillaume GARDET
package/c-icap/Config.in new file +1
-0@@ -0,0 +1,10 @@ +config BR2_PACKAGE_C_ICAP
package/c-icap/Config.in line 10
Quoted 10 lines
package/c-icap/Config.in new file +9
-0+ bool "c-icap" + 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/
Missing new line at the end of the file.
Also, did you check that this package indeed builds with a minimal toolchain such as
http://autobuild.buildroot.org/toolchains/configs/br-arm-basic.config ? It's also good to check if it builds with
http://autobuild.buildroot.org/toolchains/configs/bfin-linux-uclibc.config
and then
http://autobuild.buildroot.org/toolchains/configs/bfin-uclinux.config.
Quoted 6 lines
package/c-icap/c-icap.mk new file +0
-0
package/c-icap/c-icap.mk line 10
Quoted 10 lines
package/c-icap/c-icap.mk new file +10
-0@@ -0,0 +1,24 @@ +################################################################################ +# +# c-icap +# +################################################################################ + +C_ICAP_VERSION = 0.3.4 +C_ICAP_SOURCE = c_icap-$(C_ICAP_VERSION).tar.gz +C_ICAP_SITE = http://downloads.sourceforge.net/c-icap/ +C_ICAP_INSTALL_STAGING = YES
Is this package really installing some libraries used by other packages?
package/c-icap/c-icap.mk line 11
Quoted 1 line
package/c-icap/c-icap.mk new file +1
-0+C_ICAP_INSTALL_TARGET = YES
Not needed, this is the default.
The C_ICAP_LICENSE and C_ICAP_LICENSE_FILES variables are missing.
package/c-icap/c-icap.mk line 12
Quoted 1 line
package/c-icap/c-icap.mk new file +1
-0+C_ICAP_CONF_OPT = --sysconfdir=/etc --with-process-mutexes=posix --enable-large-files
--enable-large-files seems to indicate you at least need largefile support. Or you should make it optional with something like
ifeq ($(BR2_LARGEFILE),y)ICAP_CONF_OPTS += --enable-large-files
elseICAP_CONF_OPTS += --disable-large-files
endif
package/c-icap/c-icap.mk line 13
Quoted 1 line
package/c-icap/c-icap.mk new file +1
-0+C_ICAP_DEPENDENCIES =
Not needed, it defaults to empty.
package/c-icap/c-icap.mk line 19
Quoted 5 lines
package/c-icap/c-icap.mk new file +5
-0+define C_ICAP_INSTALL_TARGET_CONFIGS + mkdir -p $(TARGET_DIR)/var/run/c-icap/ + mkdir -p $(TARGET_DIR)/tmp/c-icap/ + mkdir -p $(STAGING_DIR)/var/run/c-icap/ + mkdir -p $(STAGING_DIR)/tmp/c-icap/
Creating these directories in $(STAGING_DIR) is not needed. Just curious, why is /tmp/c-icap/ necessary?
package/c-icap/c-icap.mk line 24
Quoted 6 lines
package/c-icap/c-icap.mk new file +5
-0+endef + +C_ICAP_POST_INSTALL_TARGET_HOOKS = C_ICAP_INSTALL_TARGET_CONFIGS + +$(eval $(autotools-package))
Missing newline at end of file.
Could you take those comments into account and send an updated version?
Thanks a lot!
Thomas Petazzoni
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 3/3 New package: c-icap-modules Additionals modules for c-icap server.
In reply to Guillaume GARDETThis patch adds c-icap-modules, additionnal modules for c-icap.
--- package/Config.in | 1 + package/c-icap-modules/Config.in | 7 +++++++ package/c-icap-modules/c-icap-modules.mk | 27 +++++++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 package/c-icap-modules/Config.in create mode 100644 package/c-icap-modules/c-icap-modules.mk
package/Config.in +1 -0
@@ -951,6 +951,7 @@ menu "Networking applications" source "package/bridge-utils/Config.in" source "package/bwm-ng/Config.in" source "package/c-icap/Config.in" + source "package/c-icap-modules/Config.in" source "package/can-utils/Config.in" source "package/chrony/Config.in" source "package/civetweb/Config.in"
package/c-icap-modules/Config.in new file +7 -0
@@ -0,0 +1,7 @@ +config BR2_PACKAGE_C_ICAP_MODULES + bool "c-icap-modules" + depends on BR2_PACKAGE_C_ICAP + help + Additionals modules for c-icap server. + + http://c-icap.sourceforge.net/
package/c-icap-modules/c-icap-modules.mk new file +27 -0
@@ -0,0 +1,27 @@ +################################################################################ +# +# c-icap-modules +# +################################################################################ + +C_ICAP_MODULES_VERSION = 0.3.2 +C_ICAP_MODULES_SOURCE = c_icap_modules-$(C_ICAP_MODULES_VERSION).tar.gz +C_ICAP_MODULES_SITE = http://downloads.sourceforge.net/c-icap/ +C_ICAP_MODULES_INSTALL_STAGING = NO +C_ICAP_MODULES_INSTALL_TARGET = YES +C_ICAP_MODULES_CONF_OPT = --with-c-icap=$(STAGING_DIR)/usr/ --includedir=$(STAGING_DIR)/usr/include/ \ + CPPFLAGS="-I $(STAGING_DIR)/usr/include/ -I $(STAGING_DIR)/usr/include/c_icap/" \ + CFLAGS="$(CFLAGS) -I $(STAGING_DIR)/usr/include/ -I $(STAGING_DIR)/usr/include/c_icap/" +C_ICAP_MODULES_DEPENDENCIES = c-icap + +define C_ICAP_MODULES_REMOVE_BROKEN_INCLUDE_PATH + $(SED) "s#-I/usr/include -I/usr/include/c_icap###" $(C_ICAP_MODULES_DIR)/Makefile + $(SED) "s#-I/usr/include -I/usr/include/c_icap###" $(C_ICAP_MODULES_DIR)/services/Makefile + $(SED) "s#-I/usr/include -I/usr/include/c_icap###" $(C_ICAP_MODULES_DIR)/services/url_check/Makefile + $(SED) "s#-I/usr/include -I/usr/include/c_icap###" $(C_ICAP_MODULES_DIR)/services/virus_scan/Makefile +endef + + +C_ICAP_MODULES_POST_CONFIGURE_HOOKS = C_ICAP_MODULES_REMOVE_BROKEN_INCLUDE_PATH + +$(eval $(autotools-package))
Signature · 1 line
1.8.4.5
PATCH 3/3 New package: c-icap-modules Additionals modules for c-icap server.
Dear Guillaume GARDET,
Title should be:
c-icap-modules: new package
Quoted 18 lines · Guillaume GARDET
package/Config.in +1
-0@@ -951,6 +951,7 @@ menu "Networking applications" source "package/bridge-utils/Config.in" source "package/bwm-ng/Config.in" source "package/c-icap/Config.in" + source "package/c-icap-modules/Config.in" source "package/can-utils/Config.in" source "package/chrony/Config.in" source "package/civetweb/Config.in"package/c-icap-modules/Config.in new file +0
-0
package/c-icap-modules/Config.in line 2
Quoted 2 lines
package/c-icap-modules/Config.in new file +2
-0@@ -0,0 +1,7 @@ +config BR2_PACKAGE_C_ICAP_MODULES + bool "c-icap-modules"
Indentation should be one tab.
package/c-icap-modules/Config.in line 7
Quoted 6 lines
package/c-icap-modules/Config.in new file +5
-0+ depends on BR2_PACKAGE_C_ICAP + help + Additionals modules for c-icap server. + + http://c-icap.sourceforge.net/
Missing newline at end of file.
Quoted 7 lines
package/c-icap-modules/c-icap-modules.mk new file +1
-0@@ -0,0 +1,27 @@ +################################################################################
package/c-icap-modules/c-icap-modules.mk line 11
Quoted 10 lines
package/c-icap-modules/c-icap-modules.mk new file +10
-0+# +# c-icap-modules +# +################################################################################ + +C_ICAP_MODULES_VERSION = 0.3.2 +C_ICAP_MODULES_SOURCE = c_icap_modules-$(C_ICAP_MODULES_VERSION).tar.gz +C_ICAP_MODULES_SITE = http://downloads.sourceforge.net/c-icap/ +C_ICAP_MODULES_INSTALL_STAGING = NO +C_ICAP_MODULES_INSTALL_TARGET = YES
Those two lines are not needed, since it's the default.
package/c-icap-modules/c-icap-modules.mk line 14
Quoted 3 lines
package/c-icap-modules/c-icap-modules.mk new file +3
-0+C_ICAP_MODULES_CONF_OPT = --with-c-icap=$(STAGING_DIR)/usr/ --includedir=$(STAGING_DIR)/usr/include/ \ + CPPFLAGS="-I $(STAGING_DIR)/usr/include/ -I $(STAGING_DIR)/usr/include/c_icap/" \ + CFLAGS="$(CFLAGS) -I $(STAGING_DIR)/usr/include/ -I $(STAGING_DIR)/usr/include/c_icap/"
--with-c-icap and --includedir can indeed go in C_ICAP_MODULES_CONF_OPTS. However, the other two should go in C_ICAP_MODULES_CONF_ENV.
Are you sure --includedir=$(STAGING_DIR)/usr/include is needed? It seems wrong, because --includedir indicates the include directory on the target... which clearly isn't $(STAGING_DIR)/usr/include.
Also, the two -I$(STAGING_DIR)/usr/include are not needed, the compiler already looks there by default for header files. The -I$(STAGING_DIR)/usr/include/c_icap/ might be needed, though.
package/c-icap-modules/c-icap-modules.mk line 25
Quoted 11 lines
package/c-icap-modules/c-icap-modules.mk new file +11
-0+C_ICAP_MODULES_DEPENDENCIES = c-icap + +define C_ICAP_MODULES_REMOVE_BROKEN_INCLUDE_PATH + $(SED) "s#-I/usr/include -I/usr/include/c_icap###" $(C_ICAP_MODULES_DIR)/Makefile + $(SED) "s#-I/usr/include -I/usr/include/c_icap###" $(C_ICAP_MODULES_DIR)/services/Makefile + $(SED) "s#-I/usr/include -I/usr/include/c_icap###" $(C_ICAP_MODULES_DIR)/services/url_check/Makefile + $(SED) "s#-I/usr/include -I/usr/include/c_icap###" $(C_ICAP_MODULES_DIR)/services/virus_scan/Makefile +endef + + +C_ICAP_MODULES_POST_CONFIGURE_HOOKS = C_ICAP_MODULES_REMOVE_BROKEN_INCLUDE_PATH
I'm tempted to say that those fixes should be done by using a patch rather than using some SED expression. And of course, the patch should be submitted to the upstream c-icap-modules project, so that one day, a new upstream version can be used in Buildroot and we can remove the fixup patch.
package/c-icap-modules/c-icap-modules.mk line 27
Quoted 3 lines
package/c-icap-modules/c-icap-modules.mk new file +2
-0+ +$(eval $(autotools-package))
Missing newline at end of file.
Same as the other patches: could you take into account the comments, and submit an updated version?
Thanks a lot!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
cover Add ICAP server support
In reply to Guillaume GARDETPing.
Guillaume
Le 18/09/2014 11:27, Guillaume GARDET a ?crit :
Quoted 28 lines
Hi,
This patch series enable ICAP support in squid and add c-icap and c-icap-modules packages.
Regards,
Guillaume
----------------------------------------------------------------
Guillaume GARDET (3):
Enable c-icap server support in squid and define logdir, pidfile and
swapdir
New package: c-icap c-icap is an implementation of an ICAP server.
Squid 3.x proxy server supports it.
New package: c-icap-modules Additionals modules for c-icap server.package/Config.in | 2 ++ package/c-icap-modules/Config.in | 7 +++++++ package/c-icap-modules/c-icap-modules.mk | 27 +++++++++++++++++++++++++++ package/c-icap/Config.in | 10 ++++++++++ package/c-icap/c-icap.mk | 24 ++++++++++++++++++++++++ package/squid/squid.mk | 12 ++++++++++-- 6 files changed, 80 insertions(+), 2 deletions(-)create mode 100644 package/c-icap-modules/Config.in create mode 100644
package/c-icap-modules/c-icap-modules.mkcreate mode 100644 package/c-icap/Config.in create mode 100644package/c-icap/c-icap.mk
v2 cover Add ICAP server support
In reply to Guillaume GARDETHi,
This patch series enable ICAP support in squid and add c-icap and c-icap-modules packages.
Comments done on V1 have been integrated.
Regards,
Guillaume
---
Guillaume GARDET (4):
package/squid: define the log directory, pidfile and swapdir package/squid: enable ICAP server support in squid
c-icap: new package
c-icap-modules: new package
package/Config.in | 2 ++ package/c-icap-modules/Config.in | 7 +++++++ package/c-icap-modules/c-icap-modules.mk | 27 +++++++++++++++++++++++++++ package/c-icap/Config.in | 10 ++++++++++ package/c-icap/c-icap.mk | 27 +++++++++++++++++++++++++++ package/squid/squid.mk | 12 ++++++++++-- 6 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 package/c-icap-modules/Config.in create mode 100644 package/c-icap-modules/c-icap-modules.mk create mode 100644 package/c-icap/Config.in create mode 100644 package/c-icap/c-icap.mk
Signature · 1 line
1.8.4.5
PATCH v2 1/4 package/squid: define the log directory, pidfile and swapdir
--- package/squid/squid.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
package/squid/squid.mk +4 -1
@@ -26,7 +26,10 @@ SQUID_CONF_OPTS = --enable-async-io=8 --enable-linux-netfilter \ --enable-auth-negotiate="wrapper" \ --enable-auth-ntlm="fake" \ --disable-strict-error-checking \ - --enable-external-acl-helpers="file_userip" + --enable-external-acl-helpers="file_userip" \ + --with-logdir=/var/log/squid/ \ + --with-pidfile=/var/run/squid.pid \ + --with-swapdir=/var/cache/squid/ # On uClibc librt needs libpthread ifeq ($(BR2_TOOLCHAIN_HAS_THREADS)$(BR2_TOOLCHAIN_USES_UCLIBC),yy)
Signature · 1 line
1.8.4.5
PATCH v2 2/4 package/squid: enable ICAP server support in squid
In reply to Guillaume GARDET--- package/squid/squid.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
package/squid/squid.mk +7 -2
@@ -29,7 +29,8 @@ SQUID_CONF_OPTS = --enable-async-io=8 --enable-linux-netfilter \ --enable-external-acl-helpers="file_userip" \ --with-logdir=/var/log/squid/ \ --with-pidfile=/var/run/squid.pid \ - --with-swapdir=/var/cache/squid/ + --with-swapdir=/var/cache/squid/ \ + --enable-icap-client # On uClibc librt needs libpthread ifeq ($(BR2_TOOLCHAIN_HAS_THREADS)$(BR2_TOOLCHAIN_USES_UCLIBC),yy)
@@ -48,6 +49,10 @@ define SQUID_CLEANUP_TARGET cachemgr.conf mime.conf.default squid.conf.default) endef -SQUID_POST_INSTALL_TARGET_HOOKS += SQUID_CLEANUP_TARGET +define SQUID_CREATE_MISSING_FOLDER + mkdir -p $(TARGET_DIR)/var/log/squid/ +endef + +SQUID_POST_INSTALL_TARGET_HOOKS += SQUID_CLEANUP_TARGET SQUID_CREATE_MISSING_FOLDER $(eval $(autotools-package))
Signature · 1 line
1.8.4.5
PATCH v2 2/4 package/squid: enable ICAP server support in squid
Dear Guillaume GARDET,
Quoted 11 lines · Guillaume GARDET
Signed-off-by Guillaume GARDET <[email protected]>--- package/squid/squid.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)package/squid/squid.mk +0
-0
package/squid/squid.mk SQUID_CONF_OPTS = --enable-async-io=8 --enable-linux-netfilter \ · line 33
Quoted 6 lines
package/squid/squid.mk +2
-1@@ -29,7 +29,8 @@ SQUID_CONF_OPTS = --enable-async-io=8 --enable-linux-netfilter \ --enable-external-acl-helpers="file_userip" \ --with-logdir=/var/log/squid/ \ --with-pidfile=/var/run/squid.pid \ - --with-swapdir=/var/cache/squid/ + --with-swapdir=/var/cache/squid/ \ + --enable-icap-client
The commit title says you enable the "ICAP server", but in fact you are enabling the ICAP client.
package/squid/squid.mk define SQUID_CLEANUP_TARGET · line 54
Quoted 11 lines
package/squid/squid.mk +3
-1# On uClibc librt needs libpthread ifeq ($(BR2_TOOLCHAIN_HAS_THREADS)$(BR2_TOOLCHAIN_USES_UCLIBC),yy)@@ -48,6 +49,10 @@ define SQUID_CLEANUP_TARGET cachemgr.conf mime.conf.default squid.conf.default) endef -SQUID_POST_INSTALL_TARGET_HOOKS += SQUID_CLEANUP_TARGET +define SQUID_CREATE_MISSING_FOLDER + mkdir -p $(TARGET_DIR)/var/log/squid/ +endef
This is wrong, for two reasons:
1/ It's related to your PATCH 1/4, which adds
--with-logdir=/var/log/squid, so it should go with it.
2/ Creating a directory in /var/log at build time doesn't make sense,
because /var/log in Buildroot is a symbolic link to /tmp, and /tmp is mounted as a tmpfs so that the root filesystem can remain read-only. Therefore, the proper solution is to create this directory at boot time. We normally do this in the startup script provided by the package, but squid doesn't provide one.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 2/4 package/squid: enable ICAP server support in squid
Le 16/11/2014 22:38, Thomas Petazzoni a ?crit :
Quoted 9 lines
Dear Guillaume GARDET,
Quoted 6 lines · Guillaume GARDET
Signed-off-by Guillaume GARDET <[email protected]>--- package/squid/squid.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
Quoted 13 lines
package/squid/squid.mk SQUID_CONF_OPTS = --enable-async-io=8 --enable-linux-netfilter \ · line 33
Quoted 11 lines
package/squid/squid.mk +2
-1@@ -29,7 +29,8 @@ SQUID_CONF_OPTS = --enable-async-io=8 --enable-linux-netfilter \ --enable-external-acl-helpers="file_userip" \ --with-logdir=/var/log/squid/ \ --with-pidfile=/var/run/squid.pid \ - --with-swapdir=/var/cache/squid/ + --with-swapdir=/var/cache/squid/ \ + --enable-icap-clientThe commit title says you enable the "ICAP server", but in fact you are enabling the ICAP client.
ok.
Quoted 8 lines
Quoted 8 lines
package/squid/squid.mk +0
-0# On uClibc librt needs libpthread ifeq ($(BR2_TOOLCHAIN_HAS_THREADS)$(BR2_TOOLCHAIN_USES_UCLIBC),yy)@@ -48,6 +49,10 @@ define SQUID_CLEANUP_TARGET cachemgr.conf mime.conf.default squid.conf.default) endef
Quoted 8 lines
package/squid/squid.mk define SQUID_CLEANUP_TARGET · line 54
Quoted 4 lines
package/squid/squid.mk +3
-1-SQUID_POST_INSTALL_TARGET_HOOKS += SQUID_CLEANUP_TARGET +define SQUID_CREATE_MISSING_FOLDER + mkdir -p $(TARGET_DIR)/var/log/squid/ +endefThis is wrong, for two reasons:
1/ It's related to your PATCH 1/4, which adds
--with-logdir=/var/log/squid, so it should go with it.
Right.
Quoted 7 lines
2/ Creating a directory in
/var/logat build time doesn't make sense,
because/var/login Buildroot is a symbolic link to /tmp, and /tmp is mounted as a tmpfs so that the root filesystem can remain read-only. Therefore, the proper solution is to create this directory at boot time. We normally do this in the startup script provided by the package, but squid doesn't provide one.
What would be the solution then?
Guillaume
PATCH v2 2/4 package/squid: enable ICAP server support in squid
Hello,
Quoted 8 lines · Guillaume GARDET - Olis?o
Quoted 6 lines
2/ Creating a directory in
/var/logat build time doesn't make sense,
because/var/login Buildroot is a symbolic link to /tmp, and /tmp is mounted as a tmpfs so that the root filesystem can remain read-only. Therefore, the proper solution is to create this directory at boot time. We normally do this in the startup script provided by the package, but squid doesn't provide one.What would be the solution then?
I guess the best solution is probably to add an init script to start Squid at boot time.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 3/4 c-icap: new package
In reply to Guillaume GARDET--- package/Config.in | 1 + package/c-icap/Config.in | 10 ++++++++++ package/c-icap/c-icap.mk | 27 +++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 package/c-icap/Config.in create mode 100644 package/c-icap/c-icap.mk
package/Config.in +1 -0
@@ -983,6 +983,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"
package/c-icap/Config.in new file +10 -0
@@ -0,0 +1,10 @@ +config BR2_PACKAGE_C_ICAP + bool "c-icap" + 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/
package/c-icap/c-icap.mk new file +27 -0
@@ -0,0 +1,27 @@ +################################################################################ +# +# 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_CONF_OPTS = --sysconfdir=/etc --with-process-mutexes=posix +ifeq ($(BR2_LARGEFILE),y) +C_ICAP_CONF_OPTS += --enable-large-files +else +C_ICAP_CONF_OPTS += --disable-large-files +endif + +define C_ICAP_INSTALL_TARGET_CONFIGS + mkdir -p $(TARGET_DIR)/var/run/c-icap/ + mkdir -p $(TARGET_DIR)/tmp/c-icap/ +endef + +C_ICAP_POST_INSTALL_TARGET_HOOKS = C_ICAP_INSTALL_TARGET_CONFIGS + +$(eval $(autotools-package))
Signature · 1 line
1.8.4.5
PATCH v2 3/4 c-icap: new package
Dear Guillaume GARDET,
Quoted 28 lines · Guillaume GARDET
Signed-off-by Guillaume GARDET <[email protected]>--- package/Config.in | 1 + package/c-icap/Config.in | 10 ++++++++++ package/c-icap/c-icap.mk | 27 +++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 package/c-icap/Config.in create mode 100644 package/c-icap/c-icap.mkpackage/Config.in +1
-0@@ -983,6 +983,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"package/c-icap/Config.in new file +0
-0
package/c-icap/Config.in line 2
Quoted 2 lines
package/c-icap/Config.in new file +2
-0@@ -0,0 +1,10 @@ +config BR2_PACKAGE_C_ICAP + bool "c-icap"
A quick look at the source seems to indicate that this package uses thread support, so you should depend on BR2_TOOLCHAIN_HAS_THREADS, and add the corresponding comment (see other packages for examples).
Quoted 17 lines
package/c-icap/Config.in new file +8
-0+ 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/package/c-icap/c-icap.mk new file +3
-0@@ -0,0 +1,27 @@ +################################################################################ +# +# c-icap
package/c-icap/c-icap.mk line 13
Quoted 10 lines
package/c-icap/c-icap.mk new file +10
-0+# +################################################################################ + +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_CONF_OPTS = --sysconfdir=/etc --with-process-mutexes=posix
--sysconfdir=/etc is not needed, it is already passed by the autotools-package infrastructure to all target packages.
package/c-icap/c-icap.mk line 23
Quoted 10 lines
package/c-icap/c-icap.mk new file +10
-0+ifeq ($(BR2_LARGEFILE),y) +C_ICAP_CONF_OPTS += --enable-large-files +else +C_ICAP_CONF_OPTS += --disable-large-files +endif + +define C_ICAP_INSTALL_TARGET_CONFIGS + mkdir -p $(TARGET_DIR)/var/run/c-icap/ + mkdir -p $(TARGET_DIR)/tmp/c-icap/ +endef
Like your change for squid, I don't think this makes sense because /tmp is mounted as a tmpfs, and /var/run is a symlink to /tmp.
You also probably want:
ifeq ($(BR2_INET_IPV6),y)C_ICAP_CONF_OPTS += --enable-ipv6
elseC_ICAP_CONF_OPTS += --disable-ipv6
endif
Probably also --without-perl, unless perl is a mandatory dependency.
Also, looking at configure.in, it needs the libdl library, so you'll need to depend on !BR2_PREFER_STATIC_LIB in Config.in.
It also has some optional dependencies on zlib, bzip2, berkeleydb and ldap.
For the first three, you can to handle the optional dependencies, by doing something like:
ifeq ($(BR2_PACKAGE_ZLIB),y)C_ICAP_CONF_OPTS += --with-zlibC_ICAP_DEPENDENCIES += zlib
elseC_ICAP_CONF_OPTS += --without-zlib
endif
For the last one, since we don't have a LDAP package in Buildroot, simply pass --without-ldap in C_ICAP_CONF_OPTS.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 4/4 c-icap-modules: new package
In reply to Guillaume GARDET--- package/Config.in | 1 + package/c-icap-modules/Config.in | 7 +++++++ package/c-icap-modules/c-icap-modules.mk | 27 +++++++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 package/c-icap-modules/Config.in create mode 100644 package/c-icap-modules/c-icap-modules.mk
package/Config.in +1 -0
@@ -984,6 +984,7 @@ menu "Networking applications" source "package/bridge-utils/Config.in" source "package/bwm-ng/Config.in" source "package/c-icap/Config.in" + source "package/c-icap-modules/Config.in" source "package/can-utils/Config.in" source "package/chrony/Config.in" source "package/civetweb/Config.in"
package/c-icap-modules/Config.in new file +7 -0
@@ -0,0 +1,7 @@ +config BR2_PACKAGE_C_ICAP_MODULES + bool "c-icap-modules" + depends on BR2_PACKAGE_C_ICAP + help + Additionals modules for c-icap server. + + http://c-icap.sourceforge.net/
package/c-icap-modules/c-icap-modules.mk new file +27 -0
@@ -0,0 +1,27 @@ +################################################################################ +# +# c-icap-modules +# +################################################################################ + +C_ICAP_MODULES_VERSION = 0.3.2 +C_ICAP_MODULES_SOURCE = c_icap_modules-$(C_ICAP_MODULES_VERSION).tar.gz +C_ICAP_MODULES_SITE = http://downloads.sourceforge.net/c-icap/ +C_ICAP_MODULES_LICENCE = GPLv2+ +C_ICAP_MODULES_LICENCE_FILE = COPYING +C_ICAP_MODULES_CONF_OPTS = --with-c-icap=$(STAGING_DIR)/usr/ +C_ICAP_MODULES_CONF_ENV = CFLAGS="$(CFLAGS) -I$(STAGING_DIR)/usr/include/c_icap/" +C_ICAP_MODULES_DEPENDENCIES = c-icap + +# This sed hack is needed since values are obtained using c-icap-config script +define C_ICAP_MODULES_REMOVE_BROKEN_INCLUDE_PATH + $(SED) "s#-I/usr/include -I/usr/include/c_icap###" $(C_ICAP_MODULES_DIR)/Makefile + $(SED) "s#-I/usr/include -I/usr/include/c_icap###" $(C_ICAP_MODULES_DIR)/services/Makefile + $(SED) "s#-I/usr/include -I/usr/include/c_icap###" $(C_ICAP_MODULES_DIR)/services/url_check/Makefile + $(SED) "s#-I/usr/include -I/usr/include/c_icap###" $(C_ICAP_MODULES_DIR)/services/virus_scan/Makefile +endef + + +C_ICAP_MODULES_POST_CONFIGURE_HOOKS = C_ICAP_MODULES_REMOVE_BROKEN_INCLUDE_PATH + +$(eval $(autotools-package))
Signature · 1 line
1.8.4.5
v2 cover Add ICAP server support
In reply to Guillaume GARDETDear Guillaume GARDET,
Quoted 3 lines · Guillaume GARDET
This patch series enable ICAP support in squid and add c-icap and c-icap-modules packages.
Comments done on V1 have been integrated.
Please mention which comment have been taken into account when you write a changelog.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
v3 cover Add ICAP server support
In reply to Guillaume GARDET* Changes in V3:
- squid: fix patch split, fix patch title (ICAP server => ICAP client), add init script, remove dir creation in *.mk files.
- c-icap: depends on BR2_TOOLCHAIN_HAS_THREADS and !BR2_PREFER_STATIC_LIB. Use zlib, bzip2 and berkeleydb, if available. Enable IPv6, if available. Disable explicitly LDAP. Add init script. Remove dir creation in *.mk files.
- c-icap-modules: no changes
* Changes in V2:
- squid: split patch
- c-icap: Fix commit message, fix new lines at end of file, remove unneeded lines/options, enable large files support if available.
- c-icap-modules: Fix commit message, fix indentation, new lines at end of file, remove unneeded lines/options
---
Guillaume GARDET (5):
package/squid: define the log directory, pidfile and swapdir package/squid: add init script
package/squid: enable ICAP client support in squid
c-icap: new package
c-icap-modules: new package
package/Config.in | 2 + package/c-icap-modules/Config.in | 7 ++++ package/c-icap-modules/c-icap-modules.mk | 27 ++++++++++++++ package/c-icap/Config.in | 15 ++++++++ package/c-icap/S96cicap | 35 +++++++++++++++++ package/c-icap/c-icap.mk | 64 ++++++++++++++++++++++++++++++++ package/squid/S97squid | 36 ++++++++++++++++++ package/squid/squid.mk | 13 ++++++- 8 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 package/c-icap-modules/Config.in create mode 100644 package/c-icap-modules/c-icap-modules.mk create mode 100644 package/c-icap/Config.in create mode 100644 package/c-icap/S96cicap create mode 100644 package/c-icap/c-icap.mk create mode 100644 package/squid/S97squid
Signature · 1 line
1.8.4.5
PATCH v3 1/5 package/squid: define the log directory, pidfile and swapdir
--- package/squid/squid.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
package/squid/squid.mk +4 -1
@@ -26,7 +26,10 @@ SQUID_CONF_OPTS = --enable-async-io=8 --enable-linux-netfilter \ --enable-auth-negotiate="wrapper" \ --enable-auth-ntlm="fake" \ --disable-strict-error-checking \ - --enable-external-acl-helpers="file_userip" + --enable-external-acl-helpers="file_userip" \ + --with-logdir=/var/log/squid/ \ + --with-pidfile=/var/run/squid.pid \ + --with-swapdir=/var/cache/squid/ # On uClibc librt needs libpthread ifeq ($(BR2_TOOLCHAIN_HAS_THREADS)$(BR2_TOOLCHAIN_USES_UCLIBC),yy)
Signature · 1 line
1.8.4.5
PATCH v3 1/5 package/squid: define the log directory, pidfile and swapdir
Dear Guillaume GARDET,
Quoted 1 line · Guillaume GARDET
Signed-off-by Guillaume GARDET <[email protected]>
Patch applied to next, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v3 2/5 package/squid: add init script
In reply to Guillaume GARDET--- package/squid/S97squid | 36 ++++++++++++++++++++++++++++++++++++ package/squid/squid.mk | 7 +++++++ 2 files changed, 43 insertions(+) create mode 100644 package/squid/S97squid
package/squid/S97squid new file +36 -0
@@ -0,0 +1,36 @@ +#!/bin/sh + +SQUID_BIN="/usr/sbin/squid" +SQUID_LOG_DIR="/var/log/squid" +SQUID_PID=/var/run/squid.pid +SQUID_CONF=/etc/squid.conf +SQUID_OPTS="" + +# (Re)create log directory and give access to squid user (nobody) +if [ ! -d $SQUID_LOG_DIR ]; then + mkdir -p $SQUID_LOG_DIR + chmod 777 $SQUID_LOG_DIR +fi + +case "$1" in + start) + echo -n "Starting WWW-proxy squid " + start-stop-daemon -S -x $SQUID_BIN -- -f $SQUID_CONF $SQUID_OPTS + [ $? == 0 ] && echo "OK" || echo "FAIL" + ;; + stop) + echo -n "Shutting down WWW-proxy squid " + start-stop-daemon -K -x $SQUID_BIN + ;; + restart | force-reload) + $0 stop + sleep 2 + $0 start + if [ "$?" != "0" ]; then + exit 1 + fi + ;; + *) + echo "Usage: /etc/init.d/S97squid {start|stop|restart|force-reload}" + exit 1 +esac
package/squid/squid.mk +7 -0
@@ -50,4 +50,11 @@ endef SQUID_POST_INSTALL_TARGET_HOOKS += SQUID_CLEANUP_TARGET +define SQUID_INSTALL_INIT_SYSV + # install start/stop script + @if [ ! -f $(TARGET_DIR)/etc/init.d/S97squid ]; then \ + $(INSTALL) -m 0755 -D package/squid/S97squid $(TARGET_DIR)/etc/init.d/S97squid; \ + fi +endef + $(eval $(autotools-package))
Signature · 1 line
1.8.4.5
PATCH v3 2/5 package/squid: add init script
Dear Guillaume GARDET,
package/squid/S97squid line 12
Quoted 4 lines · Guillaume GARDET
package/squid/S97squid new file +4
-0+# (Re)create log directory and give access to squid user (nobody) +if [ ! -d $SQUID_LOG_DIR ]; then + mkdir -p $SQUID_LOG_DIR + chmod 777 $SQUID_LOG_DIR
Clearly, this doesn't look good. Don't we have a better option than 777 the log directory?
package/squid/S97squid line 27
Quoted 3 lines
package/squid/S97squid new file +3
-0+ restart | force-reload) + $0 stop + sleep 2
sleep 2 really needed here?
package/squid/S97squid line 34
Quoted 7 lines
package/squid/S97squid new file +7
-0+ $0 start + if [ "$?" != "0" ]; then + exit 1 + fi + ;; + *) + echo "Usage: /etc/init.d/S97squid {start|stop|restart|force-reload}"
Replace /etc/init.d/S97squid by $0 maybe?
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v3 2/5 package/squid: add init script
Le 23/11/2014 22:18, Thomas Petazzoni a ?crit :
Quoted 10 lines
Dear Guillaume GARDET,
package/squid/S97squid line 12
Quoted 4 lines · Guillaume GARDET
package/squid/S97squid new file +4
-0+# (Re)create log directory and give access to squid user (nobody) +if [ ! -d $SQUID_LOG_DIR ]; then + mkdir -p $SQUID_LOG_DIR + chmod 777 $SQUID_LOG_DIRClearly, this doesn't look good. Don't we have a better option than 777 the log directory?
Maybe create a squid user? Not sure how to handle this in buildroot. What do you think?
Quoted 5 lines
package/squid/S97squid line 27
Quoted 4 lines
package/squid/S97squid new file +3
-0+ restart | force-reload) + $0 stop + sleep 2sleep 2 really needed here?
Not sure.
Quoted 9 lines
package/squid/S97squid line 34
Quoted 8 lines
package/squid/S97squid new file +7
-0+ $0 start + if [ "$?" != "0" ]; then + exit 1 + fi + ;; + *) + echo "Usage: /etc/init.d/S97squid {start|stop|restart|force-reload}"Replace
/etc/init.d/S97squidby $0 maybe?
If you want.
Guillaume
PATCH v3 2/5 package/squid: add init script
Hello,
Quoted 8 lines · Guillaume GARDET - Olis?o
Quoted 6 lines
package/squid/S97squid line 12
Quoted 4 lines
package/squid/S97squid new file +4
-0+# (Re)create log directory and give access to squid user (nobody) +if [ ! -d $SQUID_LOG_DIR ]; then + mkdir -p $SQUID_LOG_DIR + chmod 777 $SQUID_LOG_DIRClearly, this doesn't look good. Don't we have a better option than 777 the log directory?
Maybe create a squid user? Not sure how to handle this in buildroot. What do you think?
Well, if squid currently runs as root, why do you need to "chmod 777" the log directory?
But indeed, it would be nicer to run squid as a user. Look at <pkg>_USERS and <pkg>_PERMISSIONS in the Buildroot manual, or grep through the packages for such definitions, you'll see some examples on how to achieve that.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v3 3/5 package/squid: enable ICAP client support in squid
In reply to Guillaume GARDET--- package/squid/squid.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
package/squid/squid.mk +2 -1
@@ -29,7 +29,8 @@ SQUID_CONF_OPTS = --enable-async-io=8 --enable-linux-netfilter \ --enable-external-acl-helpers="file_userip" \ --with-logdir=/var/log/squid/ \ --with-pidfile=/var/run/squid.pid \ - --with-swapdir=/var/cache/squid/ + --with-swapdir=/var/cache/squid/ \ + --enable-icap-client # On uClibc librt needs libpthread ifeq ($(BR2_TOOLCHAIN_HAS_THREADS)$(BR2_TOOLCHAIN_USES_UCLIBC),yy)
Signature · 1 line
1.8.4.5
Thomas Petazzoni
AppliedPATCH v3 3/5 package/squid: enable ICAP client support in squid
Dear Guillaume GARDET,
Quoted 5 lines · Guillaume GARDET
Signed-off-by Guillaume GARDET <[email protected]>--- package/squid/squid.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Applied to next, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v3 4/5 c-icap: new package
In reply to Guillaume GARDET--- package/Config.in | 1 + package/c-icap/Config.in | 15 ++++++++++++ package/c-icap/S96cicap | 35 ++++++++++++++++++++++++++ package/c-icap/c-icap.mk | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 115 insertions(+) create mode 100644 package/c-icap/Config.in create mode 100644 package/c-icap/S96cicap create mode 100644 package/c-icap/c-icap.mk
package/Config.in +1 -0
@@ -983,6 +983,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"
package/c-icap/Config.in new file +15 -0
@@ -0,0 +1,15 @@ +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 libdl library" + depends on BR2_PREFER_STATIC_LIB || !BR2_TOOLCHAIN_HAS_THREADS
package/c-icap/S96cicap new file +35 -0
@@ -0,0 +1,35 @@ +#!/bin/sh + +CICAP_BIN="/usr/bin/c-icap" +CICAP_DIR="/var/run/c-icap" +CICAP_LOG_DIR="/var/log/c-icap/" +# (Re)create directories +if [ ! -d $CICAP_DIR ]; then + mkdir -p $CICAP_DIR +fi +if [ ! -d $CICAP_LOG_DIR ]; then + mkdir -p $CICAP_LOG_DIR +fi + +case "$1" in + start) + echo -n "Starting c-icap server " + start-stop-daemon -S -x $CICAP_BIN + [ $? == 0 ] && echo "OK" || echo "FAIL" + ;; + stop) + echo -n "Shutting down c-icap server " + start-stop-daemon -K -x $CICAP_BIN + ;; + restart | force-reload) + $0 stop + sleep 2 + $0 start + if [ "$?" != "0" ]; then + exit 1 + fi + ;; + *) + echo "Usage: /etc/init.d/S96cicap {start|stop|restart|force-reload}" + exit 1 +esac
package/c-icap/c-icap.mk new file +64 -0
64 lines not on this page · raw message
Signature · 1 line
1.8.4.5
PATCH v3 4/5 c-icap: new package
Dear Guillaume GARDET,
Quoted 11 lines · Guillaume GARDET
Signed-off-by Guillaume GARDET <[email protected]>--- package/Config.in | 1 + package/c-icap/Config.in | 15 ++++++++++++ package/c-icap/S96cicap | 35 ++++++++++++++++++++++++++ package/c-icap/c-icap.mk | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 115 insertions(+) create mode 100644 package/c-icap/Config.in create mode 100644 package/c-icap/S96cicap create mode 100644 package/c-icap/c-icap.mk
I've applied, but a lot of changes were needed to make the patch correct. In fact, with the patch you posted, the c-icap daemon was not even starting properly at boot time because the c-icap.conf file contained invalid paths.
Here are the changes I made before committing:
[Thomas:
- Remove trailing whitespace everywhere
- Rewrap the Config.in help text
- Fix Config.in comment, the proper text for BR2_PREFER_STATIC_LIB is "dynamic library", not "libdl library"
- Use a PID file in the init script
- Show OK / FAIL when stopping the service
- Remove the largefile/IPv6 handling in c-icap.mk, since they are now mandatory. We therefore pass --enable-large-files and --enable-ipv6 unconditionally.
- Remove the reference to a non-existing C_ICAP_INSTALL_TARGET_CONFIGS install target hook.
- Install the init script unconditionally.
- Remove unneeded example configuration files (*.default) from /etc, and fixup the c-icap.conf so that the default values work with Buildroot
- Properly handle the *-config scripts installed by c-icap.
- Add hash file.]
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v3 4/5 c-icap: new package
Le 10/07/2015 19:09, Thomas Petazzoni a ?crit :
Quoted 14 lines
Dear Guillaume GARDET,
Quoted 11 lines · Guillaume GARDET
Signed-off-by Guillaume GARDET <[email protected]>--- package/Config.in | 1 + package/c-icap/Config.in | 15 ++++++++++++ package/c-icap/S96cicap | 35 ++++++++++++++++++++++++++ package/c-icap/c-icap.mk | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 115 insertions(+)create mode 100644 package/c-icap/Config.in
create mode 100644 package/c-icap/S96cicap
create mode 100644package/c-icap/c-icap.mk
Quoted 4 lines
I've applied, but a lot of changes were needed to make the patch correct. In fact, with the patch you posted, the c-icap daemon was not even starting properly at boot time because the c-icap.conf file contained invalid paths.
Thanks.
Guillaume
Quoted 25 lines
Here are the changes I made before committing:
[Thomas:
- Remove trailing whitespace everywhere
- Rewrap the Config.in help text
- Fix Config.in comment, the proper text forBR2_PREFER_STATIC_LIBis "dynamic library", not "libdl library"
- Use a PID file in the init script
- Show OK / FAIL when stopping the service
- Remove the largefile/IPv6 handling in c-icap.mk, since they are now mandatory. We therefore pass --enable-large-files and --enable-ipv6 unconditionally.
- Remove the reference to a non-existingC_ICAP_INSTALL_TARGET_CONFIGSinstall target hook.
- Install the init script unconditionally.
- Remove unneeded example configuration files (*.default) from /etc, and fixup the c-icap.conf so that the default values work with Buildroot
- Properly handle the *-config scripts installed by c-icap.
- Add hash file.]Thanks!
Thomas
PATCH v3 5/5 c-icap-modules: new package
In reply to Guillaume GARDET--- package/Config.in | 1 + package/c-icap-modules/Config.in | 7 +++++++ package/c-icap-modules/c-icap-modules.mk | 27 +++++++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 package/c-icap-modules/Config.in create mode 100644 package/c-icap-modules/c-icap-modules.mk
package/Config.in +1 -0
@@ -984,6 +984,7 @@ menu "Networking applications" source "package/bridge-utils/Config.in" source "package/bwm-ng/Config.in" source "package/c-icap/Config.in" + source "package/c-icap-modules/Config.in" source "package/can-utils/Config.in" source "package/chrony/Config.in" source "package/civetweb/Config.in"
package/c-icap-modules/Config.in new file +7 -0
@@ -0,0 +1,7 @@ +config BR2_PACKAGE_C_ICAP_MODULES + bool "c-icap-modules" + depends on BR2_PACKAGE_C_ICAP + help + Additionals modules for c-icap server. + + http://c-icap.sourceforge.net/
package/c-icap-modules/c-icap-modules.mk new file +27 -0
@@ -0,0 +1,27 @@ +################################################################################ +# +# c-icap-modules +# +################################################################################ + +C_ICAP_MODULES_VERSION = 0.3.2 +C_ICAP_MODULES_SOURCE = c_icap_modules-$(C_ICAP_MODULES_VERSION).tar.gz +C_ICAP_MODULES_SITE = http://downloads.sourceforge.net/c-icap/ +C_ICAP_MODULES_LICENCE = GPLv2+ +C_ICAP_MODULES_LICENCE_FILE = COPYING +C_ICAP_MODULES_CONF_OPTS = --with-c-icap=$(STAGING_DIR)/usr/ +C_ICAP_MODULES_CONF_ENV = CFLAGS="$(CFLAGS) -I$(STAGING_DIR)/usr/include/c_icap/" +C_ICAP_MODULES_DEPENDENCIES = c-icap + +# This sed hack is needed since values are obtained using c-icap-config script +define C_ICAP_MODULES_REMOVE_BROKEN_INCLUDE_PATH + $(SED) "s#-I/usr/include -I/usr/include/c_icap###" $(C_ICAP_MODULES_DIR)/Makefile + $(SED) "s#-I/usr/include -I/usr/include/c_icap###" $(C_ICAP_MODULES_DIR)/services/Makefile + $(SED) "s#-I/usr/include -I/usr/include/c_icap###" $(C_ICAP_MODULES_DIR)/services/url_check/Makefile + $(SED) "s#-I/usr/include -I/usr/include/c_icap###" $(C_ICAP_MODULES_DIR)/services/virus_scan/Makefile +endef + + +C_ICAP_MODULES_POST_CONFIGURE_HOOKS = C_ICAP_MODULES_REMOVE_BROKEN_INCLUDE_PATH + +$(eval $(autotools-package))
Signature · 1 line
1.8.4.5
PATCH v3 5/5 c-icap-modules: new package
Dear Guillaume GARDET,
Quoted 9 lines · Guillaume GARDET
Signed-off-by Guillaume GARDET <[email protected]>--- package/Config.in | 1 + package/c-icap-modules/Config.in | 7 +++++++ package/c-icap-modules/c-icap-modules.mk | 27 +++++++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 package/c-icap-modules/Config.in create mode 100644 package/c-icap-modules/c-icap-modules.mk
I applied your patch, but did quite a few changes before doing so:
[Thomas:
- Do not pass custom CFLAGS and remove the hacks on the Makefile:
since the c-icap-config script is now fixed, it returns correct values, and the hacks are no longer needed.
- Add optional dependency on zlib and berkeleydb.
- Explicitly disable clamav support.]
Thanks for your contribution!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v3 5/5 c-icap-modules: new package
Le 13/07/2015 00:26, Thomas Petazzoni a ?crit :
Quoted 14 lines
Dear Guillaume GARDET,
Quoted 9 lines · Guillaume GARDET
Signed-off-by Guillaume GARDET <[email protected]>--- package/Config.in | 1 + package/c-icap-modules/Config.in | 7 +++++++ package/c-icap-modules/c-icap-modules.mk | 27 +++++++++++++++++++++++++++ 3 files changed, 35 insertions(+)create mode 100644 package/c-icap-modules/Config.in create mode 100644
package/c-icap-modules/c-icap-modules.mkI applied your patch, but did quite a few changes before doing so:
Quoted 8 lines
[Thomas:
- Do not pass custom CFLAGS and remove the hacks on theMakefile:
since the c-icap-config script is now fixed, it returns correct values, and the hacks are no longer needed.
- Add optional dependency on zlib and berkeleydb.
- Explicitly disable clamav support.]Thanks for your contribution!
Thanks.
Guillaume
Quoted 2 lines
Thomas