]> git.ipfire.org Git - ipfire-2.x.git/blame_incremental - lfs/guardian
suricata: Change midstream policy to "pass-flow"
[ipfire-2.x.git] / lfs / guardian
... / ...
CommitLineData
1###############################################################################
2# #
3# IPFire.org - A linux based firewall #
4# Copyright (C) 2007-2022 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
25include Config
26
27SUMMARY = A perl written Intrusion Prevention System
28
29VER = 2.0.2
30
31THISAPP = guardian-$(VER)
32DL_FILE = $(THISAPP).tar.gz
33DL_FROM = $(URL_IPFIRE)
34DIR_APP = $(DIR_SRC)/$(THISAPP)
35TARGET = $(DIR_INFO)/$(THISAPP)
36
37PROG = guardian
38PAK_VER = 27
39
40DEPS = perl-inotify2 perl-Net-IP
41
42SERVICES = guardian
43
44###############################################################################
45# Top-level Rules
46###############################################################################
47
48objects = $(DL_FILE)
49
50$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
51
52$(DL_FILE)_BLAKE2 = eeb37f7ce81102ff75ee6b41c39e18ffb1b7dc72c7355c50afc6c0ef4f62acc3b7b342aea09ebcc262fbc3e9af32f123cbadb7a7266d897683ca4ef1b4304868
53
54install : $(TARGET)
55
56check : $(patsubst %,$(DIR_CHK)/%,$(objects))
57
58download :$(patsubst %,$(DIR_DL)/%,$(objects))
59
60b2 : $(subst %,%_BLAKE2,$(objects))
61
62dist:
63 @$(PAK)
64
65###############################################################################
66# Downloading, checking, b2sum
67###############################################################################
68
69$(patsubst %,$(DIR_CHK)/%,$(objects)) :
70 @$(CHECK)
71
72$(patsubst %,$(DIR_DL)/%,$(objects)) :
73 @$(LOAD)
74
75$(subst %,%_BLAKE2,$(objects)) :
76 @$(B2SUM)
77
78###############################################################################
79# Installation Details
80###############################################################################
81
82$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
83 @$(PREBUILD)
84 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axvf $(DIR_DL)/$(DL_FILE)
85
86 # Add upstream patches.
87 cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/guardian-2.0.2-http-parser.patch
88
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
97 chown nobody.nobody /var/ipfire/guardian
98
99 # Create directory and file for logging.
100 -mkdir -pv /var/log/guardian
101 touch /var/log/guardian/guardian.log
102
103 #install initscripts
104 $(call INSTALL_INITSCRIPTS,$(SERVICES))
105
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
120 # Install addon-specific language-files.
121 install -v -m 004 $(DIR_SRC)/config/guardian/guardian.*.pl \
122 /var/ipfire/addon-lang/
123
124 @rm -rf $(DIR_APP)
125 @$(POSTBUILD)