summaryrefslogtreecommitdiff
path: root/www/squid/Makefile.squid
blob: a3596dbe19b5dd6a85c0a93d258d2b3dbd81a5c1 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# $NetBSD: Makefile.squid,v 1.7 2009/06/06 22:49:50 tron Exp $
#
# used by www/squid26/Makefile
# used by www/squid27/Makefile
# used by www/squid30/Makefile
# used by www/squid31/Makefile

.include "Makefile.common"

DOCDIR=	share/doc/squid
EGDIR=		share/examples/squid
BUILD_DEFS+=	LOGDIR VARBASE

#
MAKE_ENV+=	INSTALL_SCRIPT=${INSTALL_SCRIPT:Q}
MAKE_ENV+=	PKG_PREFIX=${PREFIX:Q} VARBASE=${VARBASE:Q}

CONFIGURE_ARGS=	--sysconfdir=${PKG_SYSCONFDIR:Q} \
		--localstatedir=${SQUID_DATADIR:Q} \
		--datarootdir=${PREFIX}/share/squid \
		--enable-auth=basic,digest,ntlm \
		--enable-cachemgr-hostname=localhost \
		--enable-delay-pools \
		--enable-icmp \
		--enable-removal-policies=lru,heap \
		--enable-poll \
		--enable-underscores \
		--enable-storeio=${SQUID_BACKENDS:Q} \
		--with-aio

#
PLIST_SRC=	${WRKDIR}/PLIST

MESSAGE_SRC=		../squid/MESSAGE
RCD_SCRIPTS=		squid
RCD_SCRIPT_SRC.squid?=	../squid/files/squid.sh

CONFS=		cachemgr.conf mime.conf squid.conf msntauth.conf
.for f in ${CONFS}
CONF_FILES+=	${PREFIX}/${EGDIR}/${f} ${PKG_SYSCONFDIR}/${f}
.endfor
OWN_DIRS=	${SQUID_DATADIR}
OWN_DIRS_PERMS+= \
		${SQUID_DATADIR}/cache ${SQUID_USER} ${SQUID_GROUP} 0750 \
		${SQUID_DATADIR}/logs ${SQUID_USER} ${SQUID_GROUP} 0750

DOCFILES=	ChangeLog RELEASENOTES.html doc/debug-sections.txt
READMES=	README.FreeBSD README.NetBSD README.OpenBSD README.Solaris
EGFILES=	src/mime.conf.default src/squid.conf.default \
		helpers/basic_auth/MSNT/msntauth.conf.default \
		tools/cachemgr.conf

SUBST_CLASSES+=		confs
SUBST_STAGE.confs=	pre-configure
SUBST_FILES.confs=	src/cf.data.pre
SUBST_SED.confs=	-e "s/@USER@/${SQUID_USER}/"
SUBST_MESSAGE.confs=	Fixing configuration files.

CHECK_PORTABILITY_SKIP+=	icons/icons.shar

INSTALL_TARGET=		install install-pinger
INSTALLATION_DIRS=	bin libexec ${PKGMANDIR}/man8 sbin \
			share/squid share/squid/errors share/squid/icons \
			${DOCDIR} ${EGDIR}

post-install:
	for f in ${EGFILES}; do \
		${INSTALL_DATA}	${WRKSRC}/$$f \
			${DESTDIR}${PREFIX}/${EGDIR}/`basename $$f .default`; \
	done
	for f in ${DOCFILES}; do \
		${INSTALL_DATA} ${WRKSRC}/$$f \
			${DESTDIR}${PREFIX}/${DOCDIR}; \
	done
	for f in ${READMES}; do \
		${INSTALL_DATA} ${PKGDIR}/../squid/files/$$f \
			${DESTDIR}${PREFIX}/${DOCDIR}; \
	done
	${CHMOD} -w ${PREFIX}/libexec/pinger
	${CP} ${PKGDIR}/PLIST ${PLIST_SRC}
	(							\
	cd ${WRKSRC}/errors;					\
	for i in *; do						\
		${TEST} -d $$i &&				\
		(${LS} $$i/ERR_* |				\
		${SED} -e 's@^@share/squid/errors/@';		\
		${ECHO} "@dirrm share/squid/errors/$$i");	\
	done; 							\
	${ECHO} "@dirrm share/squid/errors";			\
	cd ${WRKSRC}/icons;					\
	${LS} anthony-*.gif |					\
		${SED} -e 's@^@share/squid/icons/@';		\
	) >>${PLIST_SRC}
	${CAT} ${PKGDIR}/PLIST.common_end >>${PLIST_SRC}