summaryrefslogtreecommitdiff
path: root/recipes/squid/squid.inc
blob: daeeb55f98d2e722f68457568e759fa480d74d92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
DESCRIPTION = "Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more"
LICENSE = "GPL"
INC_PR = "r10"
DEPENDS = "openssl openssl-native openldap"

SQ_MAJ = "${@bb.data.getVar('PV',d,1).split('.')[0]}"
SQ_MIN = "${@bb.data.getVar('PV',d,1).split('.')[1]}"

SRC_URI = "http://www.squid-cache.org/Versions/v${SQ_MAJ}/${SQ_MAJ}.${SQ_MIN}/squid-${PV}.tar.bz2;name=squid-${PV} \
           file://squid.init \
	   file://squid-volatiles \
	   "

inherit autotools update-rc.d

EXTRA_OECONF = "--disable-epoll --disable-nls --enable-ssl --enable-digest-auth-helpers=ldap --enable-basic-auth-helpers=LDAP"

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 \
  DEFAULT_CONFIG_FILE=${sysconfdir}/squid/squid.conf \
  DEFAULT_MIME_TABLE=${sysconfdir}/squid/mime.conf \
  DEFAULT_CACHEMGR_CONFIG=${sysconfdir}/squid/cachemgr.conf \
  "

INITSCRIPT_NAME = "squid"

do_install_prepend() {
	install -d ${D}${sysconfdir}/squid
}

do_install_append() {
	install -d ${D}${sysconfdir}/init.d
	install -d ${D}${sysconfdir}/default/volatiles
	install -m 755 ${WORKDIR}/squid.init ${D}${sysconfdir}/init.d/squid
	mv ${D}${sysconfdir}/mime.conf.default ${D}${sysconfdir}/squid/
	mv ${D}${sysconfdir}/squid.conf.default ${D}${sysconfdir}/squid/
	install -m 0644 ${WORKDIR}/squid-volatiles ${D}${sysconfdir}/default/volatiles/squid
	sed -ri "s,^\#?\ *(pid_filename.+)$,\1," ${D}${sysconfdir}/squid/squid.conf
}

# this packages the languages better and saves some space, installs
# English as errors default and the others in locale package

PACKAGES =+ "${PN}-auth-ldap"
RDEPENDS_${PN}-auth-ldap += "${PN}"

FILES_${PN} += " ${datadir}/errors/English/* \
                 ${datadir}/icons/* \
                 ${datadir}/mib.txt"

FILES_${PN}-locale += " ${datadir}/errors/* " 
FILES_${PN}-auth-ldap = "${libexecdir}/digest_ldap_auth ${libexecdir}/squid_ldap_auth"