wok-next annotate squid/receipt @ rev 20587
Up librsync (2.0.2)
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sat Apr 14 15:01:16 2018 +0300 (2018-04-14) |
parents | e6615350078d |
children | 10df65db91ad |
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" |
pascal@20177 | 15 SPLIT="squid squid-auth-helpers squid-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@20534 | 46 make $MAKEFLAGS && |
al@20534 | 47 make install |
pascal@1253 | 48 } |
pascal@1253 | 49 |
al@20534 | 50 genpkg_rules() { |
pascal@20177 | 51 case $PACKAGE in |
pascal@20177 | 52 squid) |
pascal@20177 | 53 CONFIG_FILES="/etc/squid" |
al@20453 | 54 DEPENDS="libsasl libldap openssl libltdl" |
pascal@20177 | 55 SUGGESTED="iptables" |
pascal@20177 | 56 mkdir -p $fs/usr/share/squid/errors $fs/var/cache/squid \ |
pascal@20177 | 57 $fs/var/log/squid $fs/usr/lib/squid $fs/etc/squid/conf.d |
pankso@10793 | 58 |
pascal@20177 | 59 touch $fs/var/log/squid/cache.log |
pankso@10793 | 60 |
pascal@20177 | 61 cp -a $install/etc $fs |
pascal@20177 | 62 rm -rf $fs/etc/squid/*.default |
pascal@20177 | 63 cp -a $stuff/etc $fs |
pankso@10793 | 64 |
pascal@20177 | 65 cp -a $install/var $fs |
pascal@20177 | 66 cp -a $install/usr/bin $fs/usr |
pascal@20177 | 67 cp -a $install/usr/sbin $fs/usr |
pascal@20177 | 68 cp -a $install/usr/lib/squid/* $fs/usr/lib/squid |
erjo@15767 | 69 |
pascal@20177 | 70 # Remove auth libs |
pascal@20177 | 71 rm -f $fs/usr/lib/squid/*_auth* |
pankso@10793 | 72 |
pascal@20177 | 73 cp -a $install/usr/share/squid/mib.txt $fs/usr/share/squid |
pascal@20177 | 74 cp -a $install/usr/share/squid/icons $fs/usr/share/squid |
pascal@20177 | 75 cp -a $install/usr/share/squid/errors/templates $fs/usr/share/squid/errors |
pascal@20177 | 76 cp -a $install/usr/share/squid/errors/en* $fs/usr/share/squid/errors |
pascal@20177 | 77 cp -a $install/usr/share/squid/errors/fr* $fs/usr/share/squid/errors |
pankso@10793 | 78 |
pascal@20177 | 79 sed -i \ |
pascal@20177 | 80 -e 's/TAG: visible_hostname/TAG: visible_hostname\nvisible_hostname slitaz/' \ |
pascal@20177 | 81 -e 's|^#cache_dir ufs /var/cache 100|cache_dir ufs /var/cache/squid 256|' \ |
pascal@20177 | 82 -e 's|^#pid_filename /var/logs|pid_filename /var/run/squid.pid|' \ |
pascal@20177 | 83 -e "s|^coredump_dir.*|coredump_dir /var/cache/squid|" \ |
pascal@20177 | 84 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \ |
pascal@20177 | 85 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \ |
pascal@20177 | 86 $fs/etc/squid/squid.conf |
erjo@11906 | 87 |
pascal@20177 | 88 cat <<EOF>>$fs/etc/squid/squid.conf |
erjo@11906 | 89 |
erjo@11906 | 90 cache_effective_user squid |
al@20534 | 91 cache_effective_group squid |
erjo@11906 | 92 |
erjo@11915 | 93 access_log /var/log/squid/access.log |
erjo@11915 | 94 cache_log /var/log/squid/cache.log |
erjo@11915 | 95 cache_store_log /var/log/squid/store.log |
erjo@11915 | 96 |
erjo@11915 | 97 include /etc/squid/conf.d/*.conf |
erjo@11906 | 98 EOF |
pascal@20177 | 99 ;; |
pascal@20177 | 100 squid-auth-helpers) |
pascal@20177 | 101 CAT="network|Web/ftp proxy." |
al@20453 | 102 DEPENDS="squid libldap libsasl openssl libkrb5 libcomerr3" |
pascal@20177 | 103 mkdir -p $fs/usr/lib/squid |
pascal@20177 | 104 cp -a $install/usr/lib/squid/*_auth* $fs/usr/lib/squid |
pascal@20177 | 105 ;; |
pascal@20177 | 106 squid-langpack) |
pascal@20177 | 107 CAT="network|Web/ftp proxy language pack." |
pascal@20177 | 108 DEPENDS="squid" |
pascal@20177 | 109 mkdir -p $fs/usr/share |
pascal@20177 | 110 cp -a $install/usr/share/squid/errors $fs/usr/share |
pascal@20177 | 111 rm -rf $fs/usr/share/squid/errors/en* |
pascal@20177 | 112 rm -rf $fs/usr/share/squid/errors/fr* |
pascal@20177 | 113 ;; |
pascal@20177 | 114 esac |
pascal@1253 | 115 } |
pascal@1253 | 116 |
al@20534 | 117 post_install_squid() { |
al@20534 | 118 local user=squid group=squid |
al@20534 | 119 |
pascal@18730 | 120 if ! grep -q $user "$1/etc/passwd"; then |
pascal@18730 | 121 chroot "$1/" addgroup -S $group |
pascal@18730 | 122 chroot "$1/" adduser -S -D -H -G $group $user |
erjo@11906 | 123 fi |
erjo@11906 | 124 |
erjo@11906 | 125 # Set perms for files and directories |
al@20534 | 126 chroot "$1/" chown -R $user:$group /var/log/squid /var/cache/squid |
erjo@11906 | 127 |
al@20534 | 128 [ -n "$quiet" ] || cat <<EOF |
pascal@1253 | 129 |
al@20534 | 130 .----------------------------------------------. |
al@20534 | 131 | To start squid server you can run: | |
al@20534 | 132 | /etc/init.d/squid start | |
al@20534 | 133 | | |
al@20534 | 134 | Or add squid to RUN_DAEMONS in /etc/rcS.conf | |
al@20534 | 135 '----------------------------------------------' |
pascal@1253 | 136 EOF |
pascal@1253 | 137 } |
erjo@2387 | 138 |
al@20534 | 139 post_remove_squid() { |
al@20534 | 140 # Removing stalled files... |
al@20534 | 141 test -d /var/cache/squid && rm -rf /var/cache/squid |
al@20534 | 142 test -d /var/log/squid && rm -rf /var/log/squid |
al@20534 | 143 test -d /usr/share/squid && rm -rf /usr/share/squid |
erjo@11906 | 144 |
al@20534 | 145 # Removing user/group squid |
erjo@11906 | 146 deluser squid |
erjo@2387 | 147 } |