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