3 # Uncomment this to turn on verbose mode.
8 PKGDIR = $(CURDIR)/debian/ossec-hids
9 DESTDIR = $(PKGDIR)/var/ossec
11 # OSSEC INSTALL SUBDIRS
12 SUBDIRS = logs logs/archives logs/alerts logs/firewall bin queue queue/ossec queue/alerts queue/syscheck queue/rids queue/fts queue/syscheck queue/rootcheck queue/diff queue/agent-info queue/agentless tmp var var/run etc etc/shared stats rules active-response active-response/bin agentless .ssh
14 ###################### main ######################
21 $(MAKE) -C $(SRCDIR) setlocal all build
30 # Add here commands to clean up after the build process.
31 $(MAKE) -C $(SRCDIR) clean
41 # ugly directory creation
42 for i in $(SUBDIRS); do \
43 mkdir -p -m 700 $(DESTDIR)/$$i; \
47 chmod -R 550 $(DESTDIR)
48 chmod -R 770 $(DESTDIR)/queue/alerts
49 chmod -R 770 $(DESTDIR)/queue/ossec
50 chmod -R 750 $(DESTDIR)/queue/fts
51 chmod -R 750 $(DESTDIR)/queue/syscheck
52 chmod -R 750 $(DESTDIR)/queue/rootcheck
53 chmod -R 750 $(DESTDIR)/queue/diff
54 chmod -R 755 $(DESTDIR)/queue/agent-info
55 chmod -R 755 $(DESTDIR)/queue/rids
56 chmod -R 755 $(DESTDIR)/queue/agentless
57 chmod -R 750 $(DESTDIR)/stats
58 chmod -R 750 $(DESTDIR)/logs
59 chmod -R 550 $(DESTDIR)/rules
60 chmod 770 $(DESTDIR)/var/run
61 chmod 550 $(DESTDIR)/etc
62 chmod 770 $(DESTDIR)/etc/shared
63 chmod 700 $(DESTDIR)/.ssh
65 # various files installation
66 install -m 644 etc/internal_options.conf $(DESTDIR)/etc
67 install -m 644 etc/decoder.xml $(DESTDIR)/etc
68 install -m 644 src/rootcheck/db/*.txt $(DESTDIR)/etc/shared
69 if [ -e etc/ossec.mc ]; then \
70 install -m 440 etc/ossec.mc $(DESTDIR)/etc/ossec.conf; \
72 install -m 440 etc/ossec-agent.conf $(DESTDIR)/etc/ossec.conf; \
74 install -m 440 etc/ossec-*.conf $(DESTDIR)/etc
75 cp -r etc/rules/* $(DESTDIR)/rules
76 install -m 750 src/agentlessd/scripts/* $(DESTDIR)/agentless
77 install -m 755 bin/* $(DESTDIR)/bin
78 install -m 755 src/init/ossec-*.sh $(DESTDIR)/bin
79 ln -s ossec-local.sh $(DESTDIR)/bin/ossec-control
80 install -m 755 active-response/*.sh $(DESTDIR)/active-response/bin
81 install -m 755 active-response/firewalls/*.sh \
82 $(DESTDIR)/active-response/bin
85 mkdir -p $(PKGDIR)/etc/init.d
86 install -m 755 src/init/ossec-hids.init $(PKGDIR)/etc/init.d/ossec-hids
89 echo "DIRECTORY=\"/var/ossec\"" > $(PKGDIR)/etc/ossec-init.conf
90 echo "VERSION=\"`cat src/VERSION`\"" >> $(PKGDIR)/etc/ossec-init.conf
91 echo "DATE=\"`date --utc`\"" >> $(PKGDIR)/etc/ossec-init.conf
92 echo "TYPE=\"local\"" >> $(PKGDIR)/etc/ossec-init.conf
94 # Build architecture-independent files here.
95 binary-indep: build install
103 # dh_installlogrotate
123 # Build architecture-dependent files here.
124 binary-arch: build install
125 # We have nothing to do by default.
127 binary: binary-indep binary-arch
128 .PHONY: build clean binary-indep binary-arch binary install