]> git.ipfire.org Git - ipfire-2.x.git/blame - lfs/guardian
suricata: Change midstream policy to "pass-flow"
[ipfire-2.x.git] / lfs / guardian
CommitLineData
7c4cc0d8 1###############################################################################
7c4cc0d8 2# #
70df8302 3# IPFire.org - A linux based firewall #
e80e1fda 4# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
70df8302
MT
5# #
6# This program is free software: you can redistribute it and/or modify #
7c4cc0d8 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 #
7c4cc0d8
CS
9# (at your option) any later version. #
10# #
70df8302 11# This program is distributed in the hope that it will be useful, #
7c4cc0d8
CS
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/>. #
7c4cc0d8
CS
18# #
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
f15707c7
RR
27SUMMARY = A perl written Intrusion Prevention System
28
b9365dcc 29VER = 2.0.2
7c4cc0d8
CS
30
31THISAPP = guardian-$(VER)
a11aaa91
SS
32DL_FILE = $(THISAPP).tar.gz
33DL_FROM = $(URL_IPFIRE)
7c4cc0d8
CS
34DIR_APP = $(DIR_SRC)/$(THISAPP)
35TARGET = $(DIR_INFO)/$(THISAPP)
a11aaa91 36
7c4cc0d8 37PROG = guardian
e80e1fda 38PAK_VER = 27
a11aaa91 39
2dc2a278 40DEPS = perl-inotify2 perl-Net-IP
7c4cc0d8 41
f15707c7
RR
42SERVICES = guardian
43
7c4cc0d8
CS
44###############################################################################
45# Top-level Rules
46###############################################################################
47
a11aaa91
SS
48objects = $(DL_FILE)
49
50$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
51
9a7e4d85 52$(DL_FILE)_BLAKE2 = eeb37f7ce81102ff75ee6b41c39e18ffb1b7dc72c7355c50afc6c0ef4f62acc3b7b342aea09ebcc262fbc3e9af32f123cbadb7a7266d897683ca4ef1b4304868
7c4cc0d8
CS
53
54install : $(TARGET)
55
a11aaa91 56check : $(patsubst %,$(DIR_CHK)/%,$(objects))
7c4cc0d8 57
a11aaa91 58download :$(patsubst %,$(DIR_DL)/%,$(objects))
7c4cc0d8 59
9a7e4d85 60b2 : $(subst %,%_BLAKE2,$(objects))
7c4cc0d8 61
a11aaa91 62dist:
7c4cc0d8
CS
63 @$(PAK)
64
a11aaa91 65###############################################################################
9a7e4d85 66# Downloading, checking, b2sum
a11aaa91
SS
67###############################################################################
68
69$(patsubst %,$(DIR_CHK)/%,$(objects)) :
70 @$(CHECK)
71
72$(patsubst %,$(DIR_DL)/%,$(objects)) :
73 @$(LOAD)
74
9a7e4d85
PM
75$(subst %,%_BLAKE2,$(objects)) :
76 @$(B2SUM)
a11aaa91 77
7c4cc0d8
CS
78###############################################################################
79# Installation Details
80###############################################################################
81
82$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
83 @$(PREBUILD)
a11aaa91
SS
84 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axvf $(DIR_DL)/$(DL_FILE)
85
56f4f279
SS
86 # Add upstream patches.
87 cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/guardian-2.0.2-http-parser.patch
88
a11aaa91
SS
89 # Adjust path for firewall binaries.
90 cd $(DIR_APP) && sed -i "s|/usr/sbin/|/sbin/|g" modules/IPtables.pm
91
92 cd $(DIR_APP) && make
93 cd $(DIR_APP) && make install
94
95 # Create config directory and create files.
96 -mkdir -pv /var/ipfire/guardian
a332b303 97 chown nobody.nobody /var/ipfire/guardian
a11aaa91
SS
98
99 # Create directory and file for logging.
100 -mkdir -pv /var/log/guardian
101 touch /var/log/guardian/guardian.log
102
ba43a6fe 103 #install initscripts
f15707c7 104 $(call INSTALL_INITSCRIPTS,$(SERVICES))
ba43a6fe 105
a11aaa91
SS
106 # Create symlinks for runlevel interaction.
107 ln -svf /etc/rc.d/init.d/guardian /etc/rc.d/rc3.d/S45guardian
108 ln -svf /etc/rc.d/init.d/guardian /etc/rc.d/rc0.d/K76guardian
109 ln -svf /etc/rc.d/init.d/guardian /etc/rc.d/rc6.d/K76guardian
110
111 # Install include file for backup.
112 install -v -m 644 $(DIR_SRC)/config/backup/includes/guardian \
113 /var/ipfire/backup/addons/includes/guardian
114
115 # Logrotate.
116 -mkdir -pv /etc/logrotate.d
117 install -v -m 644 $(DIR_SRC)/config/guardian/guardian.logrotate \
118 /etc/logrotate.d/guardian
119
c5f633c9
MF
120 # Install addon-specific language-files.
121 install -v -m 004 $(DIR_SRC)/config/guardian/guardian.*.pl \
122 /var/ipfire/addon-lang/
123
a11aaa91 124 @rm -rf $(DIR_APP)
7c4cc0d8 125 @$(POSTBUILD)