wok view squid/receipt @ rev 18962
Add radvd
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Mar 09 12:10:42 2016 +0100 (2016-03-09) |
parents | 451ec7e0b47b |
children | a12efd5783ec |
line source
1 # SliTaz package receipt.
3 PACKAGE="squid"
4 VERSION="3.4.2"
5 CATEGORY="network"
6 SHORT_DESC="Web/ftp proxy."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 TARBALL="$PACKAGE-$VERSION.tar.bz2"
10 WEB_SITE="http://www.squid-cache.org/"
11 WGET_URL="${WEB_SITE}Versions/v3/${VERSION%.*}/$TARBALL"
12 CONFIG_FILES="/etc/squid"
14 DEPENDS="libsasl libldap libssl libltdl"
15 BUILD_DEPENDS="perl openssl-dev openldap-dev cyrus-sasl-dev libcap-dev"
16 SUGGESTED="iptables"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 cd $src
22 ./configure \
23 --prefix=/usr \
24 --sysconfdir=/etc/squid \
25 --datadir=/usr/share/squid \
26 --libexecdir=/usr/lib/squid \
27 --localstatedir=/var \
28 --with-logdir=/var/log/squid \
29 --disable-poll \
30 --disable-snmp \
31 --disable-icmp \
32 --enable-http-violations \
33 --disable-ident-lookups \
34 --enable-storeio="aufs,diskd,ufs" \
35 --enable-ssl \
36 --enable-ssl-crtd \
37 --enable-underscores \
38 --enable-ntlm-fail-open \
39 --enable-removal-policies="heap,lru" \
40 --enable-delay-pools \
41 --enable-linux-netfilter \
42 --enable-basic-auth-helpers="NCSA,SMB,MSNT,LDAP" \
43 --enable-ntlm-auth-helpers="smb_lm,no_check,fakeauth" \
44 --enable-useragent-log \
45 --enable-referer-log \
46 --enable-icap-client \
47 --with-pthreads ac_cv_header_linux_netfilter_ipv4_h="yes" \
48 $CONFIGURE_ARGS &&
49 make $MAKEFLAGS && make install
50 }
52 # Rules to gen a SliTaz package suitable for Tazpkg.
53 genpkg_rules()
54 {
55 mkdir -p $fs/usr/share/squid/errors $fs/var/cache/squid $fs/var/log/squid \
56 $fs/usr/lib/squid $fs/etc/squid/conf.d
58 touch $fs/var/log/squid/cache.log
60 cp -a $install/etc $fs
61 rm -rf $fs/etc/squid/*.default
62 cp -a $stuff/etc $fs
64 cp -a $install/var $fs
65 cp -a $install/usr/bin $fs/usr
66 cp -a $install/usr/sbin $fs/usr
67 cp -a $install/usr/lib/squid/* $fs/usr/lib/squid
69 # Remove auth libs
70 rm -f $fs/usr/lib/squid/*_auth*
72 cp -a $install/usr/share/squid/mib.txt $fs/usr/share/squid
73 cp -a $install/usr/share/squid/icons $fs/usr/share/squid
74 cp -a $install/usr/share/squid/errors/templates $fs/usr/share/squid/errors
75 cp -a $install/usr/share/squid/errors/en* $fs/usr/share/squid/errors
76 cp -a $install/usr/share/squid/errors/fr* $fs/usr/share/squid/errors
78 sed -i \
79 -e 's/TAG: visible_hostname/TAG: visible_hostname\nvisible_hostname slitaz/' \
80 -e 's|^#cache_dir ufs /var/cache 100|cache_dir ufs /var/cache/squid 256|' \
81 -e 's|^#pid_filename /var/logs|pid_filename /var/run/squid.pid|' \
82 -e "s|^coredump_dir.*|coredump_dir /var/cache/squid|" \
83 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \
84 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \
85 $fs/etc/squid/squid.conf
87 cat <<EOF>>$fs/etc/squid/squid.conf
89 cache_effective_user squid
90 cache_effective_group squid
92 access_log /var/log/squid/access.log
93 cache_log /var/log/squid/cache.log
94 cache_store_log /var/log/squid/store.log
96 include /etc/squid/conf.d/*.conf
97 EOF
98 }
100 # Pre and post install commands for Tazpkg.
101 post_install()
102 {
103 local user
104 local group
106 user=squid
107 group=squid
109 if ! grep -q $user "$1/etc/passwd"; then
110 echo -n "Adding user/group $user..."
111 chroot "$1/" addgroup -S $group
112 chroot "$1/" adduser -S -D -H -G $group $user
113 status
114 fi
117 # Set perms for files and directories
118 chroot "$1/" chown -R ${user}.${group} /var/log/squid \
119 /var/cache/squid
121 cat <<EOF
122 ----
123 To start $PACKAGE server you can run :
125 /etc/init.d/$PACKAGE start
127 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
128 ----
129 EOF
130 }
133 post_remove()
134 {
135 echo "Removing stalled files..."
136 test -d /var/cache/squid && rm -rf /var/cache/squid
137 test -d /var/log/squid && rm -rf /var/log/squid
138 test -d /usr/share/squid && rm -rf /usr/share/squid
140 echo "Removing user/group squid"
141 deluser squid
142 }