forked from csirtgadgets/massive-octo-spice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
116 lines (91 loc) · 3.26 KB
/
Makefile.am
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
SUBDIRS = elasticsearch
EXTRA_DIST = contrib src hacking
PERLOPTS=DESTDIR=$(DESTDIR) INSTALL_BASE=$(CIF_PATH) INSTALLPRIVLIB=${siteperldir}
PERL_INSTALLOPTS=INSTALL="$(INSTALL)" sysconfdir=$(sysconfdir) localstatedir=$(localstatedir) CIF_USER=$(CIF_USER) CIF_GROUP=$(CIF_GROUP)
CPANMOPTS=-n --mirror http://cpan.metacpan.org --wget --mirror-only
.PHONY: src elasticsearch test
all: default
default:
( cd src && $(PERL) Makefile.PL && make manifest && $(PERL) Makefile.PL $(PERLOPTS) && make )
test:
( cd src && CRITIC=$(PERL_CRITIC) make test )
deps: geoip
if HAVE_CPANM
$(CPANM) $(CPANMOPTS) --installdeps ./src
else
@echo "missing App::cpanminus, please install with \"perl -MCPAN -e 'install App::cpanminus'\" and re-run ./configure"
exit -1
endif
geoip:
if HAVE_GEOIP
if [ ! -f contrib/GeoLite2-City.mmdb ]; then \
$(CURL) http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz -o contrib/GeoLite2-City.mmdb.gz; \
$(GZIP) -d contrib/GeoLite2-City.mmdb.gz; \
else \
echo 'contrib/GeoLite2-City.mmdb already exists... skipping.'; \
fi;
else
@echo 'geoip not enabled, skipping...'
endif
install: install-files install-rules install-var install-geoip
install-geoip:
if HAVE_GEOIP
$(INSTALL) -m 666 "contrib/GeoLite2-City.mmdb" "$(DESTDIR)$(localstatedir)/cache/GeoLite2-City.mmdb"
else
@echo 'geoip not enabled, skipping...'
endif
install-files:
( cd src && make install )
install-rules:
[ -d $(DESTDIR)$(sysconfdir)/rules ] || $(INSTALL) -m 0770 -d $(DESTDIR)$(sysconfdir)/rules
-( cd src/rules && find . -type d -print ) | while read dir ; do \
$(INSTALL) -m 0770 -d "$(DESTDIR)$(sysconfdir)/rules/$$dir" ; \
done
-( cd src/rules && find . -type f -print ) | while read file ; do \
$(INSTALL) -m 0660 "src/rules/$$file" "$(DESTDIR)$(sysconfdir)/rules/$$file" ; \
done
install-var:
[ -d $(DESTDIR)$(localstatedir) ] || $(INSTALL) -m 0770 -d $(DESTDIR)$(localstatedir)
fixperms: fixperms-rules
fixperms-var:
chmod 0770 $(DESTDIR)$(localstatedir)
chown -R $(CIF_USER) $(DESTDIR)$(localstatedir)
chgrp -R $(CIF_GROUP) $(DESTDIR)$(localstatedir)
fixperms-rules:
chmod 0770 $(DESTDIR)$(sysconfdir)/rules
chown -R $(CIF_USER) $(DESTDIR)$(sysconfdir)/rules
chgrp -R $(CIF_GROUP) $(DESTDIR)$(sysconfdir)/rules
clean-local:
find . -name '*.log' -delete
elasticsearch:
( cd elasticsearch && make init )
elasticsearch-reload:
(cd elasticsearch && make reload )
elasticsearch-remove-templates:
(cd elasticsearch && make remove-templates)
debian7:
@echo 'not yet supported, try make ubuntu14'
ubuntu12:
( cd hacking/platforms/ubuntu && sudo ./ubuntu12.sh )
ubuntu14:
( cd hacking/platforms/ubuntu && sudo ./ubuntu14.sh )
rhel:
@echo 'not yet supported'
clean:
find . -name 'MANIFEST' -delete
find . -name 'MANIFEST.bak' -delete
( cd src && $(PERL) Makefile.PL && make realclean )
reconf:
autoreconf -vf
dist-hook:
sh ./version.sh > $(distdir)/.version
rm -rf $(distdir)/src/blib
find $(distdir) -name "*.gz" -delete
find $(distdir) -name "*.mmdb" -delete
find $(distdir)/src/testdata -name '*.log' -delete
find $(distdir) -name 'Makefile' -delete
find $(distdir) -name 'pm_to_blib' -delete
find $(distdir) -name 'CIF-.tar.gz' -delete
find $(distdir) -name '*.old' -delete
find $(distdir) -name '*.bak' -delete
find $(distdir) -name '.DS_Store' -delete