]> git.ipfire.org Git - ipfire-2.x.git/blob - lfs/squidguard
c5decc79f0b3152a2284d49615f26461c985e0e8
[ipfire-2.x.git] / lfs / squidguard
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2021 IPFire Team <info@ipfire.org> #
5 # #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
10 # #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
15 # #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
18 # #
19 ###############################################################################
20
21 ###############################################################################
22 # Definitions
23 ###############################################################################
24
25 include Config
26
27 VER = 1.6.0
28
29 THISAPP = squidguard-$(VER)
30 DL_FILE = $(THISAPP).tar.gz
31 DL_FROM = $(URL_IPFIRE)
32 DIR_APP = $(DIR_SRC)/$(THISAPP)
33 TARGET = $(DIR_INFO)/$(THISAPP)
34
35 CFLAGS += -fcommon
36
37 ###############################################################################
38 # Top-level Rules
39 ###############################################################################
40
41 objects = $(DL_FILE)
42
43 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
44
45 $(DL_FILE)_BLAKE2 = 36b422fb2424c79532e0d9dc237b4a60b7817190a45de3646a50031b341c5e94540f55adea7b3e8241b8d87fdec551c5c40d1f60ea90e25347305ef9e473b5d3
46
47 install : $(TARGET)
48
49 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
50
51 download :$(patsubst %,$(DIR_DL)/%,$(objects))
52
53 b2 : $(subst %,%_BLAKE2,$(objects))
54
55 ###############################################################################
56 # Downloading, checking, b2sum
57 ###############################################################################
58
59 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
60 @$(CHECK)
61
62 $(patsubst %,$(DIR_DL)/%,$(objects)) :
63 @$(LOAD)
64
65 $(subst %,%_BLAKE2,$(objects)) :
66 @$(B2SUM)
67
68 ###############################################################################
69 # Installation Details
70 ###############################################################################
71
72 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
73 @$(PREBUILD)
74 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
75 cd $(DIR_APP) && ./autogen.sh
76 cd $(DIR_APP) && ./configure \
77 --prefix=/usr \
78 --datadir=/usr/share \
79 --sysconfdir=/etc \
80 --localstatedir=/var \
81 --infodir=/usr/info \
82 --mandir=/usr/man \
83 --with-sg-config=/var/ipfire/urlfilter/squidGuard.conf \
84 --with-sg-logdir=/var/log/squidGuard \
85 --with-syslog=yes \
86 --with-sg-dbhome=/var/lib/squidguard \
87 --with-db=/usr \
88 --with-db-inc=/usr/include \
89 --with-db-lib=/usr/lib
90
91 cd $(DIR_APP) && make
92 cd $(DIR_APP) && make install
93
94 # URL-Filter
95 -mkdir /etc/squidGuard /var/urlrepo
96 cp -f $(DIR_CONF)/urlfilter/autoupdate.urls /var/ipfire/urlfilter/autoupdate/autoupdate.urls
97 ln -fs /bin/false /var/ipfire/urlfilter/autoupdate/cron.daily
98 ln -fs /bin/false /var/ipfire/urlfilter/autoupdate/cron.weekly
99 ln -fs /bin/false /var/ipfire/urlfilter/autoupdate/cron.monthly
100 cp -f $(DIR_CONF)/urlfilter/squidGuard.conf /var/ipfire/urlfilter/squidGuard.conf
101 ln -fs /var/ipfire/urlfilter/squidGuard.conf /etc/squidGuard/squidGuard.conf
102 cp -f $(DIR_CONF)/urlfilter/prebuild.pl /var/ipfire/urlfilter/bin/prebuild.pl
103 chmod 755 /var/ipfire/urlfilter/bin/prebuild.pl
104 cp -f $(DIR_CONF)/urlfilter/autoupdate.pl /var/ipfire/urlfilter/bin/autoupdate.pl
105 chmod 755 /var/ipfire/urlfilter/bin/autoupdate.pl
106 echo "1.5-beta" > /var/ipfire/urlfilter/version
107
108 # Wrapper
109 cp -f $(DIR_CONF)/urlfilter/redirect_wrapper /usr/sbin
110 chmod 755 /usr/sbin/redirect_wrapper
111
112 /bin/tar --no-same-owner -xzf $(DIR_CONF)/urlfilter/blacklists.tar.gz -C /var/ipfire/urlfilter
113 /usr/bin/perl $(DIR_CONF)/urlfilter/makeconf.pl
114 touch /var/ipfire/urlfilter/settings
115 chown -R nobody:nobody /var/ipfire/urlfilter
116 chown -R root:root /var/ipfire/urlfilter/bin
117 chmod 755 /srv/web/ipfire/html/images/urlfilter
118 chmod 644 /srv/web/ipfire/html/images/urlfilter/*
119 chown -R nobody:nobody /var/urlrepo
120 chown -R squid:squid /var/log/squidGuard
121
122 @rm -rf $(DIR_APP)
123 @$(POSTBUILD)