wok annotate squid/receipt @ rev 25491
Up foomatic-db-nonfree (20221116)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Nov 17 12:13:24 2022 +0000 (23 months ago) |
parents | 6da7dbdbf74a |
children | b81ceff0b056 |
rev | line source |
---|---|
pascal@1253 | 1 # SliTaz package receipt. |
pascal@1253 | 2 |
pascal@1253 | 3 PACKAGE="squid" |
Hans-G?nter@25324 | 4 VERSION="5.6" |
pascal@1253 | 5 CATEGORY="network" |
Hans-G?nter@25324 | 6 SHORT_DESC="The Squid proxy caching server." |
pascal@1253 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@15002 | 8 LICENSE="GPL2" |
pascal@1253 | 9 WEB_SITE="http://www.squid-cache.org/" |
Hans-G?nter@25324 | 10 |
Hans-G?nter@25324 | 11 TARBALL="$PACKAGE-$VERSION.tar.gz" |
Hans-G?nter@25324 | 12 WGET_URL="${WEB_SITE}Versions/v${VERSION%.*}/$TARBALL" |
Hans-G?nter@25324 | 13 |
Hans-G?nter@25324 | 14 SUGGESTED="iptables" |
Hans-G?nter@25325 | 15 DEPENDS="expat gcc83-lib-base gnutls libatomic libldap libltdl libsasl libssl libxml2" |
Hans-G?nter@25324 | 16 BUILD_DEPENDS="cyrus-sasl-dev expat-dev gcc83 gnutls-dev libcap-dev libdb |
Hans-G?nter@25324 | 17 libxml2-dev openssl-dev openldap-dev perl" |
Hans-G?nter@25324 | 18 |
pascal@1253 | 19 CONFIG_FILES="/etc/squid" |
pascal@15002 | 20 |
pascal@24094 | 21 current_version() |
pascal@24094 | 22 { |
pascal@24094 | 23 wget -O - $WEB_SITE/Versions 2>/dev/null | \ |
pascal@24384 | 24 sed '1,/suitable for production use/d;/href/!d;s|.*[0-9]/">||;s|href.*||;s|.*[0-9]</td><td>||;s|<.*||;q' |
pascal@24094 | 25 } |
pascal@24094 | 26 |
pascal@1253 | 27 # Rules to configure and make the package. |
pascal@1253 | 28 compile_rules() |
pascal@1253 | 29 { |
Hans-G?nter@25324 | 30 ./configure \ |
Hans-G?nter@25324 | 31 CC=gcc-83 \ |
Hans-G?nter@25324 | 32 CXX=g++-83 \ |
Hans-G?nter@25324 | 33 --prefix=/usr \ |
Hans-G?nter@25324 | 34 --sysconfdir=/etc/squid \ |
Hans-G?nter@25324 | 35 --datadir=/usr/share/squid \ |
Hans-G?nter@25324 | 36 --libexecdir=/usr/lib/squid \ |
Hans-G?nter@25324 | 37 --localstatedir=/var \ |
Hans-G?nter@25324 | 38 --with-logdir=/var/log/squid \ |
Hans-G?nter@25324 | 39 --disable-icmp \ |
Hans-G?nter@25324 | 40 --disable-ident-lookups \ |
Hans-G?nter@25324 | 41 --disable-poll \ |
Hans-G?nter@25324 | 42 --disable-snmp \ |
pankso@10793 | 43 --enable-basic-auth-helpers="NCSA,SMB,MSNT,LDAP" \ |
Hans-G?nter@25324 | 44 --enable-delay-pools \ |
Hans-G?nter@25324 | 45 --enable-http-violations \ |
Hans-G?nter@25324 | 46 --enable-icap-client \ |
Hans-G?nter@25324 | 47 --enable-linux-netfilter \ |
pankso@10793 | 48 --enable-ntlm-auth-helpers="smb_lm,no_check,fakeauth" \ |
Hans-G?nter@25324 | 49 --enable-ntlm-fail-open \ |
Hans-G?nter@25324 | 50 --enable-referer-log \ |
Hans-G?nter@25324 | 51 --enable-removal-policies="heap,lru" \ |
Hans-G?nter@25324 | 52 --enable-ssl \ |
Hans-G?nter@25324 | 53 --enable-ssl-crtd \ |
Hans-G?nter@25324 | 54 --enable-storeio="aufs,diskd,ufs" \ |
Hans-G?nter@25324 | 55 --enable-underscores \ |
Hans-G?nter@25324 | 56 --enable-useragent-log \ |
pankso@10793 | 57 --with-pthreads ac_cv_header_linux_netfilter_ipv4_h="yes" \ |
Hans-G?nter@25324 | 58 --with-openssl \ |
pankso@10793 | 59 $CONFIGURE_ARGS && |
Hans-G?nter@25324 | 60 make $MAKEFLAGS && |
Hans-G?nter@25324 | 61 make install |
pascal@1253 | 62 } |
pascal@1253 | 63 |
pascal@1253 | 64 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@1253 | 65 genpkg_rules() |
pascal@1253 | 66 { |
Hans-G?nter@25324 | 67 mkdir -p $fs/usr/share/squid/errors |
Hans-G?nter@25324 | 68 mkdir -p $fs/var/cache/squid |
Hans-G?nter@25324 | 69 mkdir -p $fs/var/log/squid |
Hans-G?nter@25324 | 70 mkdir -p $fs/usr/lib/squid |
Hans-G?nter@25324 | 71 mkdir -p $fs/etc/squid/conf.d |
Hans-G?nter@25324 | 72 |
Hans-G?nter@25324 | 73 touch $fs/var/log/squid/cache.log |
Hans-G?nter@25324 | 74 |
Hans-G?nter@25324 | 75 cp -a $install/etc $fs |
Hans-G?nter@25324 | 76 rm -rf $fs/etc/squid/*.default |
Hans-G?nter@25324 | 77 cp -a $stuff/etc $fs |
pankso@10793 | 78 |
Hans-G?nter@25324 | 79 cp -a $install/var $fs |
Hans-G?nter@25324 | 80 cp -a $install/usr/bin $fs/usr |
Hans-G?nter@25324 | 81 cp -a $install/usr/sbin $fs/usr |
Hans-G?nter@25324 | 82 cp -a $install/usr/lib/squid/* $fs/usr/lib/squid |
erjo@15767 | 83 |
erjo@15767 | 84 # Remove auth libs |
Hans-G?nter@25324 | 85 rm -f $fs/usr/lib/squid/*_auth* |
pankso@10793 | 86 |
Hans-G?nter@25324 | 87 cp -a $install/usr/share/squid/mib.txt $fs/usr/share/squid |
Hans-G?nter@25324 | 88 cp -a $install/usr/share/squid/icons $fs/usr/share/squid |
Hans-G?nter@25324 | 89 cp -a $install/usr/share/squid/errors/templates \ |
Hans-G?nter@25324 | 90 $fs/usr/share/squid/errors |
erjo@11906 | 91 cp -a $install/usr/share/squid/errors/en* $fs/usr/share/squid/errors |
erjo@11906 | 92 cp -a $install/usr/share/squid/errors/fr* $fs/usr/share/squid/errors |
Hans-G?nter@25324 | 93 |
pankso@10793 | 94 sed -i \ |
pankso@10793 | 95 -e 's/TAG: visible_hostname/TAG: visible_hostname\nvisible_hostname slitaz/' \ |
erjo@11906 | 96 -e 's|^#cache_dir ufs /var/cache 100|cache_dir ufs /var/cache/squid 256|' \ |
erjo@11906 | 97 -e 's|^#pid_filename /var/logs|pid_filename /var/run/squid.pid|' \ |
erjo@11906 | 98 -e "s|^coredump_dir.*|coredump_dir /var/cache/squid|" \ |
erjo@11906 | 99 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \ |
erjo@2387 | 100 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \ |
pascal@1253 | 101 $fs/etc/squid/squid.conf |
Hans-G?nter@25324 | 102 |
erjo@11906 | 103 cat <<EOF>>$fs/etc/squid/squid.conf |
erjo@11906 | 104 |
erjo@11906 | 105 cache_effective_user squid |
erjo@11906 | 106 cache_effective_group squid |
erjo@11906 | 107 |
erjo@11915 | 108 access_log /var/log/squid/access.log |
erjo@11915 | 109 cache_log /var/log/squid/cache.log |
erjo@11915 | 110 cache_store_log /var/log/squid/store.log |
erjo@11915 | 111 |
erjo@11915 | 112 include /etc/squid/conf.d/*.conf |
erjo@11906 | 113 EOF |
pascal@1253 | 114 } |
pascal@1253 | 115 |
pascal@1253 | 116 # Pre and post install commands for Tazpkg. |
pascal@1253 | 117 post_install() |
pascal@1253 | 118 { |
erjo@11906 | 119 local user |
erjo@11906 | 120 local group |
erjo@11906 | 121 |
erjo@11906 | 122 user=squid |
erjo@11906 | 123 group=squid |
erjo@11906 | 124 |
Hans-G?nter@25324 | 125 if ! grep -q $user "$1/etc/passwd" |
Hans-G?nter@25324 | 126 then |
erjo@11906 | 127 echo -n "Adding user/group $user..." |
pascal@18730 | 128 chroot "$1/" addgroup -S $group |
pascal@18730 | 129 chroot "$1/" adduser -S -D -H -G $group $user |
erjo@11906 | 130 status |
erjo@11906 | 131 fi |
erjo@11906 | 132 |
erjo@11906 | 133 |
Hans-G?nter@25324 | 134 # Set permissions for files and directories |
Hans-G?nter@25324 | 135 chroot "$1/" chown -R ${user}.${group} /var/log/squid |
Hans-G?nter@25324 | 136 chroot "$1/" chown -R ${user}.${group} /var/cache/squid |
erjo@11906 | 137 |
pascal@1253 | 138 cat <<EOF |
pascal@1253 | 139 ---- |
pascal@1253 | 140 To start $PACKAGE server you can run : |
pascal@1253 | 141 |
pascal@1253 | 142 /etc/init.d/$PACKAGE start |
pascal@1253 | 143 |
pascal@1253 | 144 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf |
pascal@1253 | 145 ---- |
pascal@1253 | 146 EOF |
pascal@1253 | 147 } |
erjo@2387 | 148 |
erjo@11906 | 149 |
erjo@2387 | 150 post_remove() |
erjo@2387 | 151 { |
erjo@2387 | 152 echo "Removing stalled files..." |
Hans-G?nter@25324 | 153 test -d /var/cache/squid && |
Hans-G?nter@25324 | 154 rm -rf /var/cache/squid |
Hans-G?nter@25324 | 155 test -d /var/log/squid && |
Hans-G?nter@25324 | 156 rm -rf /var/log/squid |
Hans-G?nter@25324 | 157 test -d /usr/share/squid && |
Hans-G?nter@25324 | 158 rm -rf /usr/share/squid |
erjo@11906 | 159 |
Hans-G?nter@25324 | 160 echo "Removing user and group squid" |
erjo@11906 | 161 deluser squid |
erjo@2387 | 162 } |