summaryrefslogtreecommitdiff
path: root/recipes/squid
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/squid')
-rw-r--r--recipes/squid/squid-native_2.6.STABLE14.bb11
-rw-r--r--recipes/squid/squid/fix_epoll_check.patch11
-rw-r--r--recipes/squid/squid/squid.init70
-rw-r--r--recipes/squid/squid_2.6.STABLE14.bb41
4 files changed, 133 insertions, 0 deletions
diff --git a/recipes/squid/squid-native_2.6.STABLE14.bb b/recipes/squid/squid-native_2.6.STABLE14.bb
new file mode 100644
index 0000000000..c8c4258275
--- /dev/null
+++ b/recipes/squid/squid-native_2.6.STABLE14.bb
@@ -0,0 +1,11 @@
+inherit native autotools
+
+SRC_URI = "http://www.squid-cache.org/Versions/v2/2.6/squid-${PV}.tar.bz2"
+S = "${WORKDIR}/squid-${PV}"
+
+inherit native autotools
+
+do_stage() {
+ install -d ${STAGING_BINDIR_NATIVE}
+ install -m 0755 src/cf_gen ${STAGING_BINDIR_NATIVE}/cf_gen
+}
diff --git a/recipes/squid/squid/fix_epoll_check.patch b/recipes/squid/squid/fix_epoll_check.patch
new file mode 100644
index 0000000000..8f195277fd
--- /dev/null
+++ b/recipes/squid/squid/fix_epoll_check.patch
@@ -0,0 +1,11 @@
+--- squid-2.6.STABLE14.orig/configure.in 2007-07-15 16:21:59.000000000 +0200
++++ squid-2.6.STABLE14/configure.in 2008-03-25 17:15:53.000000000 +0100
+@@ -2416,7 +2416,7 @@
+
+ if test -n "$SELECT_TYPE"; then
+ : # Nothing to do
+-elif test "$ac_cv_epoll_works" = "yes" ; then
++elif test "$ac_cv_func_epoll_ctl" = "yes" && "$ac_cv_epoll_works" = "yes" ; then
+ SELECT_TYPE="epoll"
+ elif test "$ac_cv_func_kqueue" = "yes" ; then
+ SELECT_TYPE="kqueue"
diff --git a/recipes/squid/squid/squid.init b/recipes/squid/squid/squid.init
new file mode 100644
index 0000000000..61d9de42dd
--- /dev/null
+++ b/recipes/squid/squid/squid.init
@@ -0,0 +1,70 @@
+#!/bin/sh
+DAEMON=/usr/sbin/squid
+NAME=squid
+DESC="Squid HTTP proxy"
+PIDFILE=/var/run/squid.pid
+SQUID_ARGS="-D -sYC"
+
+test -f $DAEMON || exit 0
+
+grepconf() {
+ w=" " # space tab
+ sq=/etc/$NAME.conf
+ # sed is cool.
+ res=`sed -ne '
+ s/^'$1'['"$w"']\+[^'"$w"']\+['"$w"']\+\([^'"$w"']\+\).*$/\1/p;
+ t end;
+ d;
+ :end q' < $sq`
+ [ -n "$res" ] || res=$2
+ echo "$res"
+}
+
+start() {
+ owner=nobody
+
+ cdr=`grepconf cache_dir /var/spool/$NAME`
+ if [ ! -d "$cdr/00" ]; then
+ mkdir -p $cdr
+ chown $owner $cdr
+ $DAEMON -z
+ fi
+
+ ldr="/var/log/$NAME"
+ if [ ! -d "$ldr" ]; then
+ mkdir -p $ldr
+ chown $owner $ldr
+ fi
+
+ start-stop-daemon -S -p $PIDFILE -x $DAEMON
+}
+
+stop() {
+ start-stop-daemon -K -p $PIDFILE -x $DAEMON
+}
+
+case "$1" in
+ start)
+ echo -n "Starting $DESC: $NAME... "
+ start
+ echo "done."
+ ;;
+ stop)
+ echo -n "Stopping $DESC: $NAME... "
+ stop
+ echo "done."
+ ;;
+ restart)
+ echo "Restarting $DESC: $NAME... "
+ stop
+ sleep 1
+ start
+ echo "done."
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/recipes/squid/squid_2.6.STABLE14.bb b/recipes/squid/squid_2.6.STABLE14.bb
new file mode 100644
index 0000000000..10c20c505e
--- /dev/null
+++ b/recipes/squid/squid_2.6.STABLE14.bb
@@ -0,0 +1,41 @@
+DESCRIPTION = "Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more"
+LICENSE = "GPLv2"
+PR = "r1"
+DEPENDS = "squid-native-${PV}"
+
+SRC_URI = "http://www.squid-cache.org/Versions/v2/2.6/squid-${PV}.tar.bz2 \
+ file://fix_epoll_check.patch;patch=1 \
+ file://squid.init"
+
+inherit autotools update-rc.d
+
+EXTRA_OECONF = "--disable-epoll --disable-nls"
+
+logdir = ${localstatedir}/log/squid
+EXTRA_OEMAKE = "\
+ DEFAULT_CACHE_LOG=${logdir}/cache.log \
+ DEFAULT_ACCESS_LOG=${logdir}/access.log \
+ DEFAULT_STORE_LOG=${logdir}/store.log \
+ DEFAULT_PID_FILE=${localstatedir}/run/squid.pid \
+ DEFAULT_SWAP_DIR=${localstatedir}/spool/squid \
+ "
+
+INITSCRIPT_NAME = "squid"
+
+do_configure_append() {
+ sed -i -e 's|./cf_gen |${STAGING_BINDIR_NATIVE}/cf_gen |g' src/Makefile
+}
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/init.d
+ install -m 755 ${WORKDIR}/squid.init ${D}${sysconfdir}/init.d/squid
+}
+
+# this packages the languages better and saves some space, installs
+# English as errors default and the others in locale package
+
+FILES_${PN} += " ${datadir}/errors/English/* \
+ ${datadir}/icons/* \
+ ${datadir}/mib.txt"
+
+FILES_${PN}-locale += " ${datadir}/errors/* "