diff options
author | Pav Lucistnik <pav@FreeBSD.org> | 2004-05-02 22:38:36 +0000 |
---|---|---|
committer | Pav Lucistnik <pav@FreeBSD.org> | 2004-05-02 22:38:36 +0000 |
commit | 725d95b3b4a498c9b57f3d177d4ddcf99c520aab (patch) | |
tree | 2233488343ce382876bcbf43b27e9c8f56c6934d /www/squid24 | |
parent | Add savelogs, a flexible and robust log file archival system. (diff) |
Infrastructural synchronization with www/squid and misc fixes:
- fix CONFLICTS glob
- reinstate LATEST_LINK and name it squid24
- correct CFLAGS/LDFLAGS handling
- remove SQUID_SSL, it does no longer compile
- prefer /bin/sh's features over external programs
- reduce the number of variables in pkg-{de,}install
- no longer hardcode the path to nologin(8)
- inform about squid.sh's rcNG-ness when /etc/rc.subr is present
at installation time
- other miscellaneous fixes
- schedule removal for the 31st October 2004
- bump PORTREVISION
PR: ports/66142
Submitted by: Thomas-Martin Seck <tmseck@netcologne.de> (maintainer)
Diffstat (limited to 'www/squid24')
-rw-r--r-- | www/squid24/Makefile | 55 | ||||
-rw-r--r-- | www/squid24/files/squid.sh | 4 | ||||
-rw-r--r-- | www/squid24/pkg-deinstall | 10 | ||||
-rw-r--r-- | www/squid24/pkg-install | 28 |
4 files changed, 63 insertions, 34 deletions
diff --git a/www/squid24/Makefile b/www/squid24/Makefile index 6a87ef1c87ea..9545b94a0ff2 100644 --- a/www/squid24/Makefile +++ b/www/squid24/Makefile @@ -7,7 +7,7 @@ # Tunables not (yet) configurable via 'make config': # SQUID_{U,G}ID # Which user/group squid should run as (default: squid/squid). -# The user and group will be created if they do not already exist with +# The user and group will be created if they do not already exist using # a uid:gid of 100:100. # NOTE: before version 2.4.7_11, these settings defaulted to # nobody/nogroup. @@ -33,7 +33,7 @@ PORTNAME= squid PORTVERSION= 2.4 -PORTREVISION= 12 +PORTREVISION= 13 CATEGORIES= www MASTER_SITES= \ ftp://ftp.squid-cache.org/pub/%SUBDIR%/ \ @@ -54,17 +54,17 @@ PATCH_DIST_STRIP= -p1 MAINTAINER= tmseck@netcologne.de COMMENT= The successful WWW proxy cache and accelerator -CONFLICTS= squid-2.[^4] +CONFLICTS= squid-2.[^4]* GNU_CONFIGURE= yes -STRIP= # won't install scripts correctly otherwise. +STRIP= # we need to strip the binaries manually MAKEFILE= makefile USE_PERL5= yes USE_REINPLACE= yes -NO_LATEST_LINK= yes +LATEST_LINK= squid24 DEPRECATED= This version of squid-2 is no longer officially supported -EXPIRATION_DATE= when the next release of squid-2 is out +EXPIRATION_DATE= on the 31st October 2004 SQUID_UID?= squid SQUID_GID?= squid @@ -80,7 +80,6 @@ OPTIONS= SQUID_LDAP_AUTH "Install LDAP authentication helpers" off \ SQUID_DELAY_POOLS "Enable delay pools" off \ SQUID_SNMP "Enable SNMP support" off \ SQUID_CARP "Enable CARP support" off \ - SQUID_SSL "Enable SSL support for reverse proxies" off \ SQUID_PINGER "Install the icmp helper" off \ SQUID_DNS_HELPER "Use the old 'dnsserver' helper" off \ SQUID_HTCP "Enable HTCP support" off \ @@ -107,8 +106,8 @@ CONFIGURE_ARGS= --bindir=${PREFIX}/sbin --sysconfdir=${PREFIX}/etc/squid \ auth_modules= MSNT NCSA PAM SMB YP getpwnam .if defined(WITH_SQUID_LDAP_AUTH) USE_OPENLDAP= yes -CONFIGURE_ENV+= CFLAGS="${CFLAGS} -I${LOCALBASE}/include" \ - LDFLAGS="-L${LOCALBASE}/lib" +CFLAGS+= -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib auth_modules+= LDAP libexec+= squid_ldap_auth .endif @@ -126,9 +125,6 @@ CONFIGURE_ARGS+= --enable-snmp .if defined(WITH_SQUID_CARP) CONFIGURE_ARGS+= --enable-carp .endif -.if defined(WITH_SQUID_SSL) -CONFIGURE_ARGS+= --enable-ssl -.endif .if defined(WITH_SQUID_PINGER) CONFIGURE_ARGS+= --enable-icmp libexec+= pinger @@ -149,7 +145,7 @@ CONFIGURE_ARGS+= --enable-cache-digests .if defined(WITHOUT_SQUID_WCCP) CONFIGURE_ARGS+= --disable-wccp .endif -.if defined(WITH_SQUID_UNDERSCORES) +.if !defined(WITHOUT_SQUID_UNDERSCORES) CONFIGURE_ARGS+= --enable-underscores .endif .if defined(WITH_SQUID_STRICT_HTTP) @@ -171,7 +167,6 @@ PLIST_FILES= etc/rc.d/squid.sh etc/squid/mib.txt \ PLIST_FILES+= ${libexec:S/^/libexec\/squid\//} ${sbin:S/^/sbin\//} # Other not so common configure options you can set via SQUID_CONFIGURE_ARGS: -# # Please see the configure script in the squid source distribution for a # complete list. # @@ -193,11 +188,25 @@ PLIST_FILES+= ${libexec:S/^/libexec\/squid\//} ${sbin:S/^/sbin\//} # Optimize time updates to one per second rather than calling gettimeofday() # --enable-cachemgr-hostname=some.hostname # Set an explicit hostname in cachemgr.cgi -# --enable-ipf-transparent -# Enable Transparent Proxy support for IP-Filter systems (incl 3.0) # --enable-truncate # Use truncate() rather than unlink() +# +# This option does not yet work on FreeBSD: +# +# --enable-ipf-transparent +# Enable Transparent Proxy support for IP-Filter systems (incl 3.0) +# (IPFilter headers are not currently installed to the base system, +# PRs ports/60700 and misc/44148 describe the problem; see +# http://www.squid-cache.org/Doc/FAQ/FAQ-17.html for information +# about how to do transparent proxying with ipfw) +# +# --enable-ssl +# This does not build anymore with recent OpenSSL versions + +CONFIGURE_ARGS+= ${SQUID_CONFIGURE_ARGS} +CONFIGURE_ENV+= CFLAGS="${CFLAGS}" \ + LDFLAGS="${LDFLAGS}" post-patch: @${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure @@ -206,12 +215,15 @@ pre-configure: -e 's|%%SQUID_GID%%|${SQUID_GID}|g' ${WRKSRC}/src/cf.data.pre pre-install: +# Prevent installation of .orig files by deleting them. + @${FIND} ${WRKSRC} -name '*.bak' -delete + @${FIND} ${WRKSRC} -name '*.orig' -delete @${SED} -e 's|%%PREFIX%%|${PREFIX}|g' \ -e 's|%%SQUID_UID%%|${SQUID_UID}|g' ${FILESDIR}/squid.sh \ >${WRKDIR}/squid.sh pre-su-install: - @${SETENV} SQUID_USER=${SQUID_UID} SQUID_GROUP=${SQUID_GID} \ + @${SETENV} squid_user=${SQUID_UID} squid_group=${SQUID_GID} \ PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL post-install: @@ -220,14 +232,15 @@ post-install: ${CHMOD} 4510 ${PREFIX}/libexec/squid/pinger ${CHGRP} ${SQUID_GID} ${PREFIX}/libexec/squid/pinger .endif - ${INSTALL_SCRIPT} ${WRKDIR}/squid.sh ${PREFIX}/etc/rc.d/squid.sh + ${INSTALL_SCRIPT} ${WRKDIR}/squid.sh ${PREFIX}/etc/rc.d .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} cd ${WRKSRC} && ${INSTALL_DATA} ${docs} ${DOCSDIR} .endif -cd ${PREFIX}/libexec/squid && ${STRIP_CMD} ${libexec} -cd ${PREFIX}/sbin && ${STRIP_CMD} ${sbin} - @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL + @${SETENV} PKG_PREFIX=${PREFIX} \ + ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL changeuser: # Recover from the problem that earlier versions of this port created the @@ -241,12 +254,12 @@ changeuser: ${ECHO_CMD} "this target!" exit 1 .endif - @if [ `id -u` -ne 0 ]; \ + @if [ `${ID} -u` -ne 0 ]; \ then ${ECHO_CMD} "Sorry, you must be root to use this target."; exit 1; fi; \ current_uid=`id -u ${SQUID_UID}`; \ current_gid=`pw groupshow ${SQUID_GID}|cut -f 3 -d :`; \ ${ECHO_CMD} "I will remove this user:"; \ - id -P $${current_uid}; \ + ${ID} -P $${current_uid}; \ ${ECHO_CMD} "and this group:"; \ pw groupshow ${SQUID_GID}; \ ${ECHO_CMD} "I will then re-create them with a user and group id of 100."; \ diff --git a/www/squid24/files/squid.sh b/www/squid24/files/squid.sh index 2844dba237f6..0c6f73a1adb4 100644 --- a/www/squid24/files/squid.sh +++ b/www/squid24/files/squid.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $FreeBSD: /tmp/pcvs/ports/www/squid24/files/Attic/squid.sh,v 1.5 2004-03-23 17:12:47 sada Exp $ +# $FreeBSD: /tmp/pcvs/ports/www/squid24/files/Attic/squid.sh,v 1.6 2004-05-02 22:38:36 pav Exp $ # # PROVIDE: squid # REQUIRE: NETWORKING SERVERS @@ -61,7 +61,7 @@ else fi ;; *) - echo "usage: `basename $0` {start|stop}" >&2 + echo "usage: ${0##*/} {start|stop}" >&2 exit 64 ;; esac diff --git a/www/squid24/pkg-deinstall b/www/squid24/pkg-deinstall index 51cf5f29698a..2162b413736e 100644 --- a/www/squid24/pkg-deinstall +++ b/www/squid24/pkg-deinstall @@ -1,10 +1,9 @@ #!/bin/sh # -# $FreeBSD: /tmp/pcvs/ports/www/squid24/Attic/pkg-deinstall,v 1.1 2004-03-23 17:12:47 sada Exp $ +# $FreeBSD: /tmp/pcvs/ports/www/squid24/Attic/pkg-deinstall,v 1.2 2004-05-02 22:38:35 pav Exp $ # PATH=/bin:/usr/bin:/usr/sbin -pkgname=$1 case $2 in DEINSTALL) @@ -16,10 +15,11 @@ DEINSTALL) POST-DEINSTALL) rmdir ${PKG_PREFIX}/etc/squid 2>/dev/null rmdir ${PKG_PREFIX}/squid/cache 2>/dev/null - rmdir -p ${PKG_PREFIX}/squid/logs 2>/dev/null - echo "===> post-deinstallation information for ${pkgname}" + rmdir ${PKG_PREFIX}/squid/logs 2>/dev/null + rmdir ${PKG_PREFIX}/squid 2>/dev/null + echo "===> post-deinstallation information for $1" echo "" - echo " Please note that ${pkgname} was not completely removed" + echo " Please note that $1 was not completely removed" echo " from this system." echo "" echo " The cache and log directories, squid's user account," diff --git a/www/squid24/pkg-install b/www/squid24/pkg-install index 13fe7847e491..9eee82933af4 100644 --- a/www/squid24/pkg-install +++ b/www/squid24/pkg-install @@ -1,14 +1,19 @@ #!/bin/sh # -# $FreeBSD: /tmp/pcvs/ports/www/squid24/Attic/pkg-install,v 1.9 2004-03-23 17:12:47 sada Exp $ +# $FreeBSD: /tmp/pcvs/ports/www/squid24/Attic/pkg-install,v 1.10 2004-05-02 22:38:35 pav Exp $ # PATH=/bin:/usr/bin:/usr/sbin pkgname=$1 squid_base=${PKG_PREFIX:-/usr/local}/squid squid_confdir=${PKG_PREFIX:-/usr/local}/etc/squid -squid_user=${SQUID_USER:=squid} -squid_group=${SQUID_GROUP:=squid} +if [ -x /usr/sbin/nologin ]; then + nologin=/usr/sbin/nologin +else + nologin=/sbin/nologin +fi +: ${squid_user:=squid} +: ${squid_group:=squid} squid_gid=100 squid_uid=100 # Try to catch the case where the $squid_user might have been created with an @@ -42,9 +47,11 @@ PRE-INSTALL) if ! pw usershow ${squid_user} -q >/dev/null ; then echo "There is no account '${squid_user}' on this system, so I will try to create it:" - if ! pw useradd ${squid_user} -u ${squid_uid} -q \ - -c "squid caching-proxy pseudo user" -g ${squid_group} \ - -d "${squid_base}" -s "/sbin/nologin" -h - ; then + if ! pw useradd -q -n ${squid_user} \ + -u ${squid_uid} -g ${squid_group} \ + -c "squid caching-proxy pseudo user" \ + -d "${squid_base}" -s "${nologin}" \ + -h - ; then echo "Failed to create user '${squid_user}'!" >&2 echo "Please create it manually." >&2 exit 1 @@ -148,6 +155,15 @@ POST-INSTALL) echo " Please check your squid.conf and update it if necessary." tput me echo "" + if [ -f /etc/rc.subr ]; then + echo " Please note that ${PKG_PREFIX}/etc/rc.d/squid.sh" + echo " will not start squid automatically on this system." + echo " You need to set squid_enable=yes in either" + echo " /etc/rc.conf, /etc/rc.conf.local or /etc/rc.conf.d/squid" + echo " See ${PKG_PREFIX}/etc/rc.d/squid.sh for more" + echo " configuration options." + echo "" + fi ;; *) exit 64 |