wok-next annotate squid/receipt @ rev 21382

updated nbd (3.3 -> 3.20)
author Hans-G?nter Theisgen
date Thu Apr 16 17:27:00 2020 +0100 (2020-04-16)
parents 10df65db91ad
children a29cbdbef237
rev   line source
pascal@20177 1 # SliTaz package receipt v2.
pascal@1253 2
pascal@1253 3 PACKAGE="squid"
pascal@20177 4 VERSION="3.5.27"
pascal@1253 5 CATEGORY="network"
al@20534 6 SHORT_DESC="Web/FTP proxy"
pascal@1253 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@15002 8 LICENSE="GPL2"
al@20534 9 WEB_SITE="http://www.squid-cache.org/"
al@20534 10
pascal@1253 11 TARBALL="$PACKAGE-$VERSION.tar.bz2"
erjo@14812 12 WGET_URL="${WEB_SITE}Versions/v3/${VERSION%.*}/$TARBALL"
pascal@15002 13
pascal@12666 14 BUILD_DEPENDS="perl openssl-dev openldap-dev cyrus-sasl-dev libcap-dev"
al@21020 15 SPLIT="$PACKAGE-auth-helpers $PACKAGE-langpack"
pascal@1253 16
al@20534 17 compile_rules() {
pascal@20180 18 touch scripts/boilerplate.h
al@20534 19
pankso@10793 20 ./configure \
pankso@10793 21 --sysconfdir=/etc/squid \
pankso@10793 22 --datadir=/usr/share/squid \
pankso@10793 23 --libexecdir=/usr/lib/squid \
pankso@10793 24 --with-logdir=/var/log/squid \
pascal@20180 25 --with-openssl \
pankso@10793 26 --disable-poll \
pankso@10793 27 --disable-snmp \
pankso@10793 28 --disable-icmp \
pankso@10793 29 --enable-http-violations \
pankso@10793 30 --disable-ident-lookups \
pankso@10793 31 --enable-storeio="aufs,diskd,ufs" \
pankso@10793 32 --enable-ssl \
erjo@15767 33 --enable-ssl-crtd \
pankso@10793 34 --enable-underscores \
pankso@10793 35 --enable-ntlm-fail-open \
pankso@10793 36 --enable-removal-policies="heap,lru" \
pankso@10793 37 --enable-delay-pools \
pankso@10793 38 --enable-linux-netfilter \
pankso@10793 39 --enable-basic-auth-helpers="NCSA,SMB,MSNT,LDAP" \
pankso@10793 40 --enable-ntlm-auth-helpers="smb_lm,no_check,fakeauth" \
pankso@10793 41 --enable-useragent-log \
pankso@10793 42 --enable-referer-log \
erjo@11906 43 --enable-icap-client \
pankso@10793 44 --with-pthreads ac_cv_header_linux_netfilter_ipv4_h="yes" \
pankso@10793 45 $CONFIGURE_ARGS &&
al@20604 46 fix libtool &&
al@20534 47 make $MAKEFLAGS &&
al@20534 48 make install
pascal@1253 49 }
pascal@1253 50
al@20534 51 genpkg_rules() {
pascal@20177 52 case $PACKAGE in
al@20604 53 squid)
al@20604 54 CONFIG_FILES="/etc/squid"
al@20604 55 DEPENDS="libsasl libldap openssl libltdl"
al@20604 56 SUGGESTED="iptables"
al@20604 57 mkdir -p $fs/usr/share/squid/errors $fs/var/cache/squid \
al@20604 58 $fs/var/log/squid $fs/usr/lib/squid $fs/etc/squid/conf.d
al@20604 59
al@20604 60 touch $fs/var/log/squid/cache.log
al@20604 61
al@20604 62 cp -a $install/etc $fs
al@20604 63 rm -rf $fs/etc/squid/*.default
al@20604 64 cp -a $stuff/etc $fs
al@20604 65
al@20604 66 cp -a $install/var $fs
al@20604 67 cp -a $install/usr/bin $fs/usr
al@20604 68 cp -a $install/usr/sbin $fs/usr
al@20604 69 cp -a $install/usr/lib/squid/* $fs/usr/lib/squid
al@20604 70
al@20604 71 # Remove auth libs
al@20604 72 rm -f $fs/usr/lib/squid/*_auth*
al@20604 73
al@20604 74 cp -a $install/usr/share/squid/mib.txt $fs/usr/share/squid
al@20604 75 cp -a $install/usr/share/squid/icons $fs/usr/share/squid
al@20604 76 cp -a $install/usr/share/squid/errors/templates $fs/usr/share/squid/errors
al@20604 77 cp -a $install/usr/share/squid/errors/en* $fs/usr/share/squid/errors
al@20604 78 cp -a $install/usr/share/squid/errors/fr* $fs/usr/share/squid/errors
al@20604 79
al@20604 80 sed \
al@20604 81 -e 's/TAG: visible_hostname/TAG: visible_hostname\nvisible_hostname slitaz/' \
al@20604 82 -e 's|^#cache_dir ufs /var/cache 100|cache_dir ufs /var/cache/squid 256|' \
al@20604 83 -e 's|^#pid_filename /var/logs|pid_filename /var/run/squid.pid|' \
al@20604 84 -e "s|^coredump_dir.*|coredump_dir /var/cache/squid|" \
al@20604 85 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \
al@20604 86 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \
al@20604 87 -i $fs/etc/squid/squid.conf
al@20604 88
al@21020 89 cat >>$fs/etc/squid/squid.conf <<EOF
al@21020 90
erjo@11906 91 cache_effective_user squid
al@20534 92 cache_effective_group squid
erjo@11906 93
erjo@11915 94 access_log /var/log/squid/access.log
erjo@11915 95 cache_log /var/log/squid/cache.log
erjo@11915 96 cache_store_log /var/log/squid/store.log
erjo@11915 97
erjo@11915 98 include /etc/squid/conf.d/*.conf
erjo@11906 99 EOF
al@20604 100 ;;
al@20604 101 squid-auth-helpers)
al@20604 102 CAT="network|auth helpers"
al@20604 103 DEPENDS="squid libldap libsasl openssl libkrb5 libcomerr3"
al@20604 104 mkdir -p $fs/usr/lib/squid
al@20604 105 cp -a $install/usr/lib/squid/*_auth* $fs/usr/lib/squid
al@20604 106 ;;
al@20604 107 squid-langpack)
al@20604 108 CAT="network|language pack"
al@20604 109 DEPENDS="squid"
al@20604 110 mkdir -p $fs/usr/share
al@20604 111 cp -a $install/usr/share/squid/errors $fs/usr/share
al@20604 112 rm -rf $fs/usr/share/squid/errors/en*
al@20604 113 rm -rf $fs/usr/share/squid/errors/fr*
al@20604 114 ;;
pascal@20177 115 esac
pascal@1253 116 }
pascal@1253 117
al@20534 118 post_install_squid() {
al@20534 119 local user=squid group=squid
al@20534 120
pascal@18730 121 if ! grep -q $user "$1/etc/passwd"; then
pascal@18730 122 chroot "$1/" addgroup -S $group
pascal@18730 123 chroot "$1/" adduser -S -D -H -G $group $user
erjo@11906 124 fi
erjo@11906 125
erjo@11906 126 # Set perms for files and directories
al@20534 127 chroot "$1/" chown -R $user:$group /var/log/squid /var/cache/squid
erjo@11906 128
al@20534 129 [ -n "$quiet" ] || cat <<EOF
pascal@1253 130
al@20534 131 .----------------------------------------------.
al@20534 132 | To start squid server you can run: |
al@20534 133 | /etc/init.d/squid start |
al@20534 134 | |
al@20534 135 | Or add squid to RUN_DAEMONS in /etc/rcS.conf |
al@20534 136 '----------------------------------------------'
pascal@1253 137 EOF
pascal@1253 138 }
erjo@2387 139
al@20534 140 post_remove_squid() {
al@20534 141 # Removing stalled files...
al@20534 142 test -d /var/cache/squid && rm -rf /var/cache/squid
al@20534 143 test -d /var/log/squid && rm -rf /var/log/squid
al@20534 144 test -d /usr/share/squid && rm -rf /usr/share/squid
erjo@11906 145
al@20534 146 # Removing user/group squid
erjo@11906 147 deluser squid
erjo@2387 148 }