forked from CpanelInc/tech-CSI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.csi
59 lines (41 loc) · 1.38 KB
/
Makefile.csi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#-*-Makefile-*-
.PHONY: all fetch install chkrootkit rkhunter clean
CWD := $(shell pwd)
WGET := $(shell which wget)
TAR := $(shell which tar)
MKDIR := $(shell which mkdir) -p
MV := $(shell which mv) -f
RM := $(shell which rm) -f
CP := $(shell which cp) -f
CHKROOTKITURL:= ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz
RKHUNTERURL:= http://sourceforge.net/projects/rkhunter/files/latest/download
CHKROOTKIT:= chkrootkit.tar.gz
RKHUNTER := rkhunter.tar.gz
TARGET := $(CWD)/CSI
all: fetch install
fetch: $(RKHUNTER) $(CHKROOTKIT)
$(CHKROOTKIT):
$(WGET) -O $(CHKROOTKIT) $(CHKROOTKITURL) &> /dev/null
$(TAR) -C $(TARGET) -xzvf $(CHKROOTKIT) &> /dev/null
$(RKHUNTER):
$(MKDIR) $(TARGET)
$(WGET) -O $(RKHUNTER) $(RKHUNTERURL) &> /dev/null
$(TAR) -C $(TARGET) -xzvf $(RKHUNTER) &> /dev/null
install: rkhunter chkrootkit
rkhunter: $(TARGET)/rkhunter
$(shell cd $< ; ./bin/$@ --update &> /dev/null)
chkrootkit: $(TARGET)/chkrootkit
make -C $(TARGET)/$@ &> /dev/null
$(TARGET)/rkhunter: $(TARGET)/rkhunterinstall
$(shell cd $< ; ./installer.sh --layout custom $@ --install &> /dev/null)
$(TARGET)/rkhunterinstall: $(RKHUNTER)
$(MV) $(TARGET)/rkhunter-* $@
$(MKDIR) $(TARGET)/rkhunter
$(TARGET)/chkrootkit: $(CHKROOTKIT)
$(MV) $(TARGET)/chkrootkit-* $(TARGET)/chkrootkit
clean:
$(RM) $(CHKROOTKIT)
$(RM) $(RKHUNTER)
uberclean: clean
$(RM) chkrootkit-*.tar.gz
$(RM) rkhunter-*.tar.gz