]> git.ipfire.org Git - ipfire-2.x.git/blame - lfs/squidguard
Core Update 171: Fix Suricata stop/start
[ipfire-2.x.git] / lfs / squidguard
CommitLineData
60cbd6e7 1###############################################################################
60cbd6e7 2# #
70df8302 3# IPFire.org - A linux based firewall #
e47f7a60 4# Copyright (C) 2007-2021 IPFire Team <info@ipfire.org> #
70df8302
MT
5# #
6# This program is free software: you can redistribute it and/or modify #
60cbd6e7 7# it under the terms of the GNU General Public License as published by #
70df8302 8# the Free Software Foundation, either version 3 of the License, or #
60cbd6e7
MT
9# (at your option) any later version. #
10# #
70df8302 11# This program is distributed in the hope that it will be useful, #
60cbd6e7
MT
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 #
70df8302 17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
60cbd6e7
MT
18# #
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
82db9e59 27VER = 1.6.0
60cbd6e7 28
736c3b18 29THISAPP = squidguard-$(VER)
60cbd6e7
MT
30DL_FILE = $(THISAPP).tar.gz
31DL_FROM = $(URL_IPFIRE)
32DIR_APP = $(DIR_SRC)/$(THISAPP)
33TARGET = $(DIR_INFO)/$(THISAPP)
34
01876bda
MT
35CFLAGS += -fcommon
36
60cbd6e7
MT
37###############################################################################
38# Top-level Rules
39###############################################################################
40
66c36198 41objects = $(DL_FILE)
60cbd6e7
MT
42
43$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
44
9a7e4d85 45$(DL_FILE)_BLAKE2 = 36b422fb2424c79532e0d9dc237b4a60b7817190a45de3646a50031b341c5e94540f55adea7b3e8241b8d87fdec551c5c40d1f60ea90e25347305ef9e473b5d3
60cbd6e7
MT
46
47install : $(TARGET)
48
49check : $(patsubst %,$(DIR_CHK)/%,$(objects))
50
51download :$(patsubst %,$(DIR_DL)/%,$(objects))
52
9a7e4d85 53b2 : $(subst %,%_BLAKE2,$(objects))
60cbd6e7
MT
54
55###############################################################################
9a7e4d85 56# Downloading, checking, b2sum
60cbd6e7
MT
57###############################################################################
58
59$(patsubst %,$(DIR_CHK)/%,$(objects)) :
60 @$(CHECK)
61
62$(patsubst %,$(DIR_DL)/%,$(objects)) :
63 @$(LOAD)
64
9a7e4d85
PM
65$(subst %,%_BLAKE2,$(objects)) :
66 @$(B2SUM)
60cbd6e7
MT
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)
736c3b18 75 cd $(DIR_APP) && ./autogen.sh
b2742aeb
MF
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 \
10e4f239 83 --with-sg-config=/var/ipfire/urlfilter/squidGuard.conf \
b2742aeb
MF
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
889a288b 91 cd $(DIR_APP) && make
60cbd6e7 92 cd $(DIR_APP) && make install
bd365f3a
MT
93
94 # URL-Filter
e9007fef 95 -mkdir /etc/squidGuard /var/urlrepo
bd365f3a
MT
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
b2742aeb 106 echo "1.5-beta" > /var/ipfire/urlfilter/version
66c36198 107
a1d6b605
MT
108 # Wrapper
109 cp -f $(DIR_CONF)/urlfilter/redirect_wrapper /usr/sbin
110 chmod 755 /usr/sbin/redirect_wrapper
bd365f3a
MT
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
0ea91db2 114 touch /var/ipfire/urlfilter/settings
bd365f3a 115 chown -R nobody:nobody /var/ipfire/urlfilter
e47f7a60 116 chown -R root:root /var/ipfire/urlfilter/bin
d733119b
MT
117 chmod 755 /srv/web/ipfire/html/images/urlfilter
118 chmod 644 /srv/web/ipfire/html/images/urlfilter/*
e9007fef 119 chown -R nobody:nobody /var/urlrepo
bd365f3a
MT
120 chown -R squid:squid /var/log/squidGuard
121
60cbd6e7
MT
122 @rm -rf $(DIR_APP)
123 @$(POSTBUILD)