source: trunk/Makefile.in@ 423

Last change on this file since 423 was 415, checked in by katerina, 12 years ago

Fixes for tickets #314, #315, #316, #317, #318, #319, #320, and #321.

File size: 78.9 KB
Line 
1#
2# Copyright Rainer Wichmann (2006)
3#
4# License Information:
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19
20# --- boiler-plate stuff ---
21#
22SHELL = /bin/sh
23
24srcdir = @srcdir@
25srcsrc = @srcdir@/src
26srcinc = @srcdir@/include
27top_srcdir = @top_srcdir@
28
29# Don't use VPATH - it's a portability mess
30#
31# VPATH = $(top_srcdir)/src
32
33prefix = @prefix@
34exec_prefix = @exec_prefix@
35
36sbindir = @sbindir@
37sysconfdir = @sysconfdir@
38localstatedir = @localstatedir@
39mandir = @mandir@
40datarootdir = @datarootdir@
41mytmpdir = @mytmpdir@
42
43configfile = @myconffile@
44mydatafile = @mydatafile@
45mylockfile = @mylockfile@
46mylogfile = @mylogfile@
47
48mydatadir = @mydataroot@
49mylogdir = @mylogdir@
50mylockdir = @mylockdir@
51
52selectconfig = @selectconfig@
53
54top_builddir = .
55
56INSTALL = @INSTALL@
57INSTALL_PROGRAM = @INSTALL@ -s -m 700
58INSTALL_SHELL = @INSTALL@ -m 700
59INSTALL_DATA = @INSTALL@ -m 600
60INSTALL_MAN = @INSTALL@ -m 644
61INSTALL_SCRIPT = @INSTALL_SCRIPT@
62INSTALL_NAME = @install_name@
63INSTALL_DSYS = @INSTALL@ -m 755
64
65PACKAGE = @PACKAGE@
66VERSION = @VERSION@
67BUILD_NUM = 1
68
69DEFAULT_MAINTAINER = Nobody Nowhere <nobody@example.com>
70
71VFLAG = @mytclient@
72SETPWD = @setpwd_prg@
73STEGIN = @stegin_prg@
74SAMHAIN = @sh_main_prg@
75YULECTL = @yulectl_prg@
76XOR_CODE = @xor_code@
77SH_LKM = @sh_lkm@
78TIGER_SRC = @tiger_src@
79
80ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
81mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
82
83
84CC = @CC@
85BUILD_CC = @BUILD_CC@
86# DBGDEF = -pg -DSH_PROFILE=1
87DBGDEF = @mydebugdef@
88DEFS = $(DBGDEF) @DEFS@ -I. -I$(top_srcdir)/include
89CPPFLAGS = @CPPFLAGS@
90LDFLAGS = @LDFLAGS@
91LIBS_TRY = @LIBS@
92LIBS_SOCK = @sh_libsocket@
93LIBS_KVM = @sh_libkvm@
94CFLAGS = @CFLAGS@
95CUTEST =
96COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(CUTEST)
97LINK = $(CC) $(DBGDEF) -O $(LDFLAGS) -o $@
98
99DESTDIR =
100
101TAR = tar
102GZIP = --best
103
104# For creating a packed client
105#
106CLIENTPASSWD =
107
108.SUFFIXES: # Delete the default suffixes
109
110#
111# --- Files -------
112#
113
114
115HEADERS = samhain.h sh_unix.h sh_utils.h sh_error.h sh_error_min.h sh_files.h \
116 sh_getopt.h sh_readconf.h sh_tiger.h sh_hash.h \
117 sh_mail.h sh_mail_int.h sh_nmail.h sh_filter.h \
118 sh_mem.h sh_entropy.h sh_forward.h sh_modules.h sh_utmp.h \
119 sh_kern.h sh_suidchk.h sh_srp.h sh_fifo.h sh_html.h sh_tools.h \
120 sh_gpg.h sh_cat.h sh_calls.h sh_extern.h sh_database.h sh_trace.h \
121 sh_schedule.h bignum.h trustfile.h slib.h zAVLTree.h \
122 lzoconf.h minilzo.h rijndael-alg-fst.h rijndael-api-fst.h \
123 rijndael-boxes-fst.h sh_socket.h sh_ignore.h sh_prelude.h \
124 sh_mounts.h sh_userfiles.h sh_static.h sh_prelink.h \
125 sh_processcheck.h sh_portcheck.h sh_pthread.h sh_string.h \
126 sh_log_check.h sh_log_evalrule.h sh_log_correlate.h \
127 sh_log_mark.h sh_log_repeat.h sh_inotify.h sh_registry.h sh_ipvx.h \
128 sh_restrict.h sh_sub.h sh_fInotify.h
129
130
131SOURCES = $(srcsrc)/samhain.c $(srcsrc)/sh_unix.c \
132 $(srcsrc)/sh_utils.c $(srcsrc)/sh_error.c \
133 $(srcsrc)/sh_files.c $(srcsrc)/sh_getopt.c \
134 $(srcsrc)/sh_readconf.c $(srcsrc)/sh_tiger0.c \
135 $(srcsrc)/sh_tiger1.c $(srcsrc)/sh_tiger2.c \
136 $(srcsrc)/sh_tiger1_64.c $(srcsrc)/sh_tiger2_64.c \
137 $(srcsrc)/sh_hash.c $(srcsrc)/sh_mail.c $(srcsrc)/sh_nmail.c \
138 $(srcsrc)/sh_mem.c $(srcsrc)/sh_entropy.c \
139 $(srcsrc)/sh_forward.c $(srcsrc)/sh_modules.c \
140 $(srcsrc)/sh_utmp.c $(srcsrc)/sh_login_track.c $(srcsrc)/sh_kern.c \
141 $(srcsrc)/sh_suidchk.c $(srcsrc)/sh_srp.c \
142 $(srcsrc)/sh_fifo.c $(srcsrc)/sh_tools.c \
143 $(srcsrc)/sh_html.c $(srcsrc)/sh_gpg.c \
144 $(srcsrc)/sh_cat.c $(srcsrc)/sh_calls.c \
145 $(srcsrc)/sh_extern.c $(srcsrc)/sh_database.c \
146 $(srcsrc)/sh_err_log.c $(srcsrc)/sh_err_console.c \
147 $(srcsrc)/sh_err_syslog.c $(srcsrc)/sh_schedule.c \
148 $(srcsrc)/bignum.c $(srcsrc)/mkhdr.c \
149 $(srcsrc)/samhain_setpwd.c $(srcsrc)/samhain_stealth.c \
150 $(srcsrc)/encode.c $(srcsrc)/sstrip.c \
151 $(srcsrc)/trustfile.c $(srcsrc)/exepack.c \
152 $(srcsrc)/exepack_fill.c $(srcsrc)/exepack_mkdata.c \
153 $(srcsrc)/minilzo.c $(srcsrc)/slib.c \
154 $(srcsrc)/rijndael-alg-fst.c $(srcsrc)/rijndael-api-fst.c \
155 $(srcsrc)/zAVLTree.c $(srcsrc)/bignum.c \
156 $(srcsrc)/sh_socket.c $(srcsrc)/sh_ignore.c \
157 $(srcsrc)/yulectl.c $(srcsrc)/sh_mounts.c \
158 $(srcsrc)/sh_userfiles.c $(srcsrc)/sh_prelude.c \
159 $(srcsrc)/sh_prelink.c $(srcsrc)/sh_static.c \
160 $(srcsrc)/sh_portcheck.c $(srcsrc)/sh_port2proc.c\
161 $(srcsrc)/sh_processcheck.c $(srcsrc)/sh_filter.c \
162 $(srcsrc)/sh_pthread.c $(srcsrc)/sh_string.c \
163 $(srcsrc)/sh_log_parse_syslog.c $(srcsrc)/sh_log_parse_pacct.c \
164 $(srcsrc)/sh_log_parse_samba.c $(srcsrc)/sh_log_parse_generic.c \
165 $(srcsrc)/sh_log_parse_apache.c $(srcsrc)/sh_log_evalrule.c \
166 $(srcsrc)/sh_log_correlate.c $(srcsrc)/sh_log_mark.c \
167 $(srcsrc)/sh_log_check.c $(srcsrc)/dnmalloc.c \
168 $(srcsrc)/sh_inotify.c $(srcsrc)/sh_log_repeat.c \
169 $(srcsrc)/sh_audit.c $(srcsrc)/sh_registry.c \
170 $(srcsrc)/sh_ipvx.c $(srcsrc)/sh_restrict.c \
171 $(srcsrc)/sh_filetype.c $(srcsrc)/sh_sub.c $(srcsrc)/sh_fInotify.c\
172 $(srcsrc)/t-test1.c
173
174OBJECTS = sh_files.o sh_tiger0.o sh_tiger2.o sh_tiger2_64.o \
175 samhain.o sh_unix.o sh_utils.o sh_error.o \
176 sh_getopt.o sh_readconf.o sh_filter.o \
177 sh_hash.o sh_mail.o sh_nmail.o sh_mem.o sh_login_track.o \
178 sh_entropy.o sh_forward.o sh_modules.o sh_utmp.o sh_kern.o \
179 sh_suidchk.o sh_srp.o sh_fifo.o sh_tools.o sh_html.o sh_gpg.o \
180 sh_cat.o sh_calls.o sh_extern.o sh_database.o sh_err_log.o \
181 sh_err_console.o sh_err_syslog.o sh_schedule.o bignum.o \
182 trustfile.o rijndael-alg-fst.o rijndael-api-fst.o slib.o \
183 zAVLTree.o sh_socket.o sh_ignore.o sh_prelude.o \
184 sh_mounts.o sh_userfiles.o sh_prelink.o sh_static.o \
185 sh_processcheck.o sh_portcheck.o sh_port2proc.o \
186 sh_log_parse_syslog.o sh_log_parse_pacct.o sh_log_parse_apache.o \
187 sh_log_parse_samba.o sh_log_evalrule.o sh_log_check.o \
188 sh_log_parse_generic.o \
189 sh_log_correlate.o sh_log_mark.o sh_log_repeat.o \
190 sh_pthread.o sh_string.o sh_inotify.o dnmalloc.o \
191 sh_audit.o sh_registry.o sh_ipvx.o sh_restrict.o \
192 sh_filetype.o sh_sub.o sh_fInotify.o
193
194KERN = kern_head.h kern_head.c
195
196TESTSUITE = test.sh testcompile.sh testhash.sh testtiger.txt \
197 testtimesrv.sh \
198 testext.sh testrc_1ext.in test_ext.c.in testrun_1d.sh \
199 testrun_1.sh testrun_1a.sh testrun_1b.sh testrun_1c.sh testrc_1 \
200 testrun_2.sh testrun_2a.sh testrun_2b.sh testrc_2.in \
201 testrun_2c.sh testrun_2d.sh
202
203DIST_COMMON = README COPYING LICENSE samhain.jpg \
204samhainrc.linux samhainrc.solaris samhainrc.freebsd samhainrc.aix5.2.0 \
205samhainrc.netbsd yulerc.template \
206Install.sh
207
208DIST_NEEDED = Makefile.in deploy.sh.in samhain-install.sh.in \
209samhain.spec.in rules.deb.in rules.deb-light.in samhain.spec hp_ux.psf.in \
210stealth_template.jpg \
211config.guess config.h.in stamp-h.in config.sub configure \
212configure.ac acconfig.h aclocal.m4 install-sh missing mkinstalldirs \
213c_random.sh c_bits.sh depend.sum depend.dep stamp-hdep
214
215DISTFILES = $(DIST_COMMON) $(DIST_NEEDED) \
216 src include man scripts init docs sql_init test dsys
217
218PROGRAMS = $(SETPWD) $(STEGIN) $(SAMHAIN) $(YULECTL)
219
220#----------------------------------------------------------
221#
222# the first target is the default one
223#
224#----------------------------------------------------------
225
226all: $(top_srcdir)/depend.sum $(SETPWD) $(STEGIN) $(SAMHAIN) $(YULECTL) @sh_lkm@ sstrip
227
228
229#----------------------------------------------------------
230#
231# rules for automatic updating of configuration information
232# after changing the configuration files
233#
234#----------------------------------------------------------
235
236$(top_srcdir)/configure: $(top_srcdir)/configure.ac $(top_srcdir)/aclocal.m4
237 cd $(srcdir) && autoconf
238
239# autoheader might not change config.h.in, so touch a stamp file.
240$(top_srcdir)/config.h.in: $(top_srcdir)/stamp-h.in
241 touch $(top_srcdir)/config.h.in
242
243$(top_srcdir)/stamp-h.in: $(top_srcdir)/configure.ac $(top_srcdir)/aclocal.m4
244 cd $(top_srcdir) && autoheader
245 echo timestamp > $(top_srcdir)/stamp-h.in
246
247config.h: stamp-h
248 @sleep 1; \
249 touch config.h
250
251stamp-h: $(top_srcdir)/config.h.in config.status
252 ./config.status
253
254Makefile: $(top_srcdir)/Makefile.in config.status
255 ./config.status
256
257samhain-install.sh: $(top_srcdir)/samhain-install.sh.in config.status
258 ./config.status
259
260config.status: $(top_srcdir)/configure
261 ./config.status --recheck
262
263#----------------------------------------------------------
264#
265# rules for automatic dependency tracking
266#
267#----------------------------------------------------------
268
269
270depend-gen: $(srcsrc)/depend-gen.c
271 @echo "$(BUILD_CC) -I. -o depend-gen $(srcsrc)/depend-gen.c"; \
272 $(BUILD_CC) -I. -o depend-gen $(srcsrc)/depend-gen.c 2>/dev/null || \
273 echo "failed to compile ... hope depend.dep is ok"
274
275# redo if sources change
276#
277$(top_srcdir)/depend.dep: depend-gen $(SOURCES)
278 @echo "update depend.dep ..."; \
279 test -f $(srcdir)/depend.dep || echo > $(srcdir)/depend.dep; \
280 if test -f depend-gen; then \
281 failfiles=""; \
282 for ff in $(SOURCES) $(srcsrc)/kern_head.c; do \
283 ./depend-gen -i '$$(srcinc)/' -o $(top_srcdir)/depend.dep $$ff || \
284 failfiles="$${failfiles} $$ff"; \
285 done; \
286 if test x"$${failfiles}" != x; then \
287 echo "--------------------------------------------------------";\
288 echo " depend-gen failed to update depend.dep. You can safely"; \
289 echo " ignore this error, unless you have modified the source"; \
290 echo " files and changed their dependencies."; \
291 echo "--------------------------------------------------------";\
292 else \
293 echo $(srcsrc) > $(top_srcdir)/stamp-dep; \
294 fi; \
295 else \
296 echo "depend-gen not found ... depend.dep not modified"; \
297 fi
298
299# only updated if depencies change
300#
301$(top_srcdir)/depend.sum: $(top_srcdir)/depend.dep
302 @if test -f depend-gen; then \
303 nsum=`./depend-gen -c $(top_srcdir)/depend.dep|awk '{print $$1}'`; \
304 osum=`cat $(top_srcdir)/depend.sum 2>/dev/null`; \
305 if test "x$$osum" != "x$$nsum"; then \
306 echo "update $(top_srcdir)/depend.sum ..."; \
307 echo $$nsum > $(top_srcdir)/depend.sum; \
308 echo timestamp > $(top_srcdir)/stamp-hdep; \
309 fi; \
310 fi;
311
312$(top_srcdir)/stamp-hdep:
313 touch $(top_srcdir)/stamp-hdep && touch $(top_srcdir)/Makefile.in
314
315$(top_srcdir)/Makefile.in: $(top_srcdir)/stamp-hdep
316 @echo "update Makefile.in ..."; \
317 echo "cp Makefile.in Makefile.in.bak"; \
318 cp $(top_srcdir)/Makefile.in $(top_srcdir)/Makefile.in.bak; \
319 if test -f depend-gen; then \
320 failfiles=""; \
321 for ff in $(SOURCES) $(srcsrc)/kern_head.c; do \
322 ./depend-gen -i '$$(srcinc)/' -o $(top_srcdir)/Makefile.in $$ff || \
323 failfiles="$${failfiles} $$ff"; \
324 done; \
325 if test x"$${failfiles}" != x; then \
326 echo "--------------------------------------------------------";\
327 echo " depend-gen failed to update Makefile.in. You can safely"; \
328 echo " ignore this error, unless you have modified the source"; \
329 echo " files and changed their dependencies."; \
330 echo "--------------------------------------------------------";\
331 else \
332 echo $(srcsrc) > $(top_srcdir)/stamp-dep; \
333 fi; \
334 fi
335
336# do it manually
337#
338depend: depend-gen
339 @echo "update Makefile.in ..."; \
340 for ff in $(SOURCES) $(srcsrc)/kern_head.c; do \
341 ./depend-gen -i '$$(srcinc)/' -o $(top_srcdir)/Makefile.in $$ff; \
342 echo $(srcsrc) > $(top_srcdir)/stamp-dep; \
343 done
344
345
346#----------------------------------------------------------
347#
348# CLEAN rules
349#
350#----------------------------------------------------------
351
352
353# everything created by make
354#
355
356CLEANFILES = encode config_xor.h depend-gen sh_ks.h sh_ks_xor.h kern_head \
357 internal.h sh_MK.h trustfile sstrip samhain mkhdr encode cutest \
358 yule samhain_setpwd samhain_stealth samhainrc yulectl samhain_hide.ko
359
360clean:
361 -rm -f core *.o
362 @-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
363
364
365# everything created by (./configure && make)
366#
367
368DISTCLEANFILES = Makefile samhain.spec sh_gpg_checksum.h sh_gpg_fp.h \
369 init/samhain.startLinux init/samhain.startGentoo \
370 init/samhain.startLSB init/samhain.startFreeBSD \
371 init/samhain.startSolaris init/samhain.startHPUX \
372 init/samhain.startIRIX init/samhain.startMACOSX \
373 deploy.sh sh_MK.h samhain-install.sh sh_gpg_chksum.h sh_gpg_fp.h \
374 rules.deb rules.deb-light \
375 scripts/samhainadmin.pl scripts/check_samhain.pl \
376 scripts/samhain.ebuild scripts/samhain.ebuild-light
377
378TESTCLEANFILES = samhain.build samhain.new yule.html \
379 test_ext test_ext.c test_ext.res testhash.tmp \
380 testrc1.signed testrc_1ext testrc_2 testrc_2.signed \
381 test_dnmalloc
382
383distclean: clean
384 -rm -f config.status config.log configure.lineno config.h config.cache
385 @-test -z "$(TESTCLEANFILES)" || rm -f $(TESTCLEANFILES)
386 @-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
387
388
389#----------------------------------------------------------
390#
391# TEST rules
392#
393#----------------------------------------------------------
394
395test14: test
396 @cd test && TOP_SRCDIR=$(top_srcdir) && \
397 export TOP_SRCDIR && ./test.sh 14 `hostname -f`
398
399test13: test
400 @cd test && TOP_SRCDIR=$(top_srcdir) && \
401 export TOP_SRCDIR && ./test.sh 13 `hostname -f`
402
403test12: test
404 @cd test && TOP_SRCDIR=$(top_srcdir) && \
405 export TOP_SRCDIR && ./test.sh 12 `hostname -f`
406
407test11: test
408 @cd test && TOP_SRCDIR=$(top_srcdir) && \
409 export TOP_SRCDIR && ./test.sh 11 `hostname -f`
410
411test10: test
412 @cd test && TOP_SRCDIR=$(top_srcdir) && \
413 export TOP_SRCDIR && ./test.sh 10 `hostname -f`
414
415test7: test
416 @cd test && TOP_SRCDIR=$(top_srcdir) && \
417 export TOP_SRCDIR && ./test.sh 7
418
419test6: test
420 @cd test && TOP_SRCDIR=$(top_srcdir) && \
421 export TOP_SRCDIR && ./test.sh 6
422
423test5: test
424 @cd test && TOP_SRCDIR=$(top_srcdir) && \
425 export TOP_SRCDIR && ./test.sh 5
426
427test4: test
428 @cd test && TOP_SRCDIR=$(top_srcdir) && \
429 export TOP_SRCDIR && ./test.sh 4
430
431test3: test
432 @cd test && TOP_SRCDIR=$(top_srcdir) && \
433 export TOP_SRCDIR && ./test.sh 3
434
435test2: test
436 @cd test && TOP_SRCDIR=$(top_srcdir) && \
437 export TOP_SRCDIR && ./test.sh 2
438
439test1: test
440 @cd test && TOP_SRCDIR=$(top_srcdir) && \
441 export TOP_SRCDIR && ./test.sh 1
442
443test:
444 @if test -f test; then \
445 :; \
446 else \
447 cp -pr $(top_srcdir)/test .; \
448 cat $(top_srcdir)/test/test.sh | \
449 sed 's%XXXSRCXXX%$(top_srcdir)%' > test/test.sh; \
450 chmod +x test/test.sh; \
451 fi
452
453test_dnmalloc: $(srcsrc)/t-test1.c dnmalloc.o
454 $(COMPILE) $(VFLAG) -o t-test1.o -c $(srcsrc)/t-test1.c; \
455 $(LINK) t-test1.o dnmalloc.o $(LIBS_TRY)
456
457
458#----------------------------------------------------------
459#
460# INSTALL rules
461#
462#----------------------------------------------------------
463
464install: install-lkm install-program install-man install-data
465 @echo; \
466 echo " You can use 'samhain-install.sh uninstall' for uninstalling"; \
467 echo " i.e. you might consider saving that script for future use";\
468 echo; \
469 echo " Use 'make install-boot' if you want @install_name@ to start on system boot"; \
470 echo
471
472install-light: install-lkm install-program install-data
473 @echo; \
474 echo " You can use 'samhain-install.sh uninstall' for uninstalling"; \
475 echo " i.e. you might consider saving that script for future use";\
476 echo; \
477 echo " Use 'make install-boot' if you want @install_name@ to start on system boot"; \
478 echo
479
480purge: uninstall-lkm uninstall-program uninstall-man
481 @echo "./samhain-install.sh --destdir=$(DESTDIR) --force --verbose uninstall-data"; \
482 ./samhain-install.sh --destdir=$(DESTDIR) --force --verbose uninstall-data
483
484remove: uninstall
485
486uninstall: uninstall-lkm uninstall-program uninstall-man uninstall-data
487 @echo; \
488 echo " Use 'make purge' if you also want to uninstall the configuration file"; \
489 echo " Use 'make uninstall-boot' to uninstall the runlevel scripts"; \
490 echo
491
492#
493# --- boot ---
494#
495install-boot: samhain-install.sh
496 ./samhain-install.sh --destdir=$(DESTDIR) --express --verbose install-boot
497
498
499uninstall-boot: samhain-install.sh
500 ./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-boot
501
502#
503# --- program ---
504#
505
506# -- NEW --
507install-lkm: @sh_lkm@
508 @RVER=`uname -r`; \
509 if test "x@sh_lkm@" != "x"; then \
510 if test -d /lib/modules/$$RVER; then \
511 MODDIR="/lib/modules/$$RVER"; \
512 elif test -d /lib/modules/misc; then \
513 MODDIR="/lib/modules/misc"; \
514 elif test -d /lib/modules; then \
515 MODDIR="/lib/modules/misc"; \
516 fi; \
517 $(mkinstalldirs) $(DESTDIR)$${MODDIR}; \
518 list='@sh_lkm@'; for p in $$list; do \
519 echo " cp $$p $(DESTDIR)$${MODDIR}/`echo $$p|sed 's%samhain%@install_name@%'`"; \
520 cp $$p $(DESTDIR)$${MODDIR}/`echo $$p|sed 's%samhain%@install_name@%'` ; \
521 chown root $(DESTDIR)$${MODDIR}/`echo $$p|sed 's%samhain%@install_name@%'`; \
522 done; \
523 if test "x$(DESTDIR)" = x; then \
524 echo " depmod -a || /sbin/depmod -a"; \
525 depmod -a || /sbin/depmod -a; \
526 fi; \
527 fi
528
529uninstall-lkm:
530 @echo "./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-lkm";\
531 ./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-lkm
532
533
534install-program: $(PROGRAMS) sstrip
535 @$(mkinstalldirs) $(DESTDIR)$(sbindir)
536 @if test x$(mytmpdir) != x; then \
537 $(mkinstalldirs) $(DESTDIR)$(mytmpdir); \
538 fi
539 @list='$(PROGRAMS)'; for p in $$list; do \
540 if test -f $$p; then \
541 echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`"; \
542 $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`; \
543 chmod 0700 $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`; \
544 echo " ./sstrip $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`"; \
545 ./sstrip $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`; \
546 else :; fi; \
547 done
548
549uninstall-program:
550 @echo "./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-program";\
551 ./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-program
552
553
554#
555# -- data files
556#
557
558install-user:
559 @if test "x@need_user_install@" = x1; then \
560 echo "./samhain-install.sh --destdir=$(DESTDIR) --express --verbose install-user @myident@"; \
561 ./samhain-install.sh --destdir=$(DESTDIR) --express --verbose install-user @myident@; \
562 fi
563 @if test x"$(VFLAG)" = "x-DSH_WITH_SERVER"; then \
564 echo " chown root $(DESTDIR)$(mydatadir)"; \
565 chown root $(DESTDIR)$(mydatadir); \
566 echo " chmod 755 $(DESTDIR)$(mydatadir)"; \
567 chmod 755 $(DESTDIR)$(mydatadir); \
568 echo " chown @myident@ $(DESTDIR)$(configfile)"; \
569 chown @myident@ $(DESTDIR)$(configfile); \
570 if test x"$(mylogdir)" = "x/var/log"; then \
571 if test x"@myident@" = xroot; then \
572 :; \
573 else \
574 echo; \
575 echo " ----------------------------------------------------------------"; \
576 echo " Directory $(mylogdir) (log file) looks like a system directory."; \
577 echo " You may run into problems (need write access for user @myident@)."; \
578 echo " ----------------------------------------------------------------"; \
579 echo; \
580 fi; \
581 else \
582 echo " chown @myident@ $(DESTDIR)$(mylogdir)"; \
583 chown @myident@ $(DESTDIR)$(mylogdir); \
584 fi; \
585 fi
586
587install-data: trustfile
588 @$(mkinstalldirs) $(DESTDIR)$(sysconfdir)
589 @$(mkinstalldirs) $(DESTDIR)$(mylockdir)
590 @$(mkinstalldirs) $(DESTDIR)$(mylogdir)
591 @$(mkinstalldirs) $(DESTDIR)$(mydatadir); \
592 chmod 700 $(DESTDIR)$(mydatadir)
593 @if test -f samhainrc.$(selectconfig); then \
594 :; \
595 else \
596 if test -f $(srcdir)/samhainrc.$(selectconfig); then \
597 cp $(srcdir)/samhainrc.$(selectconfig) . ; \
598 fi; \
599 fi; \
600 if test -f yulerc; then \
601 :; \
602 else \
603 if test -f $(srcdir)/yulerc.template; then \
604 cp $(srcdir)/yulerc.template yulerc; \
605 fi; \
606 fi; \
607 if test -f stealth_template.jpg; then \
608 :; \
609 else \
610 if test -f $(srcdir)/stealth_template.jpg; then \
611 cp $(srcdir)/stealth_template.jpg . ; \
612 fi; \
613 fi
614 @if test -d /etc/logrotate.d; then \
615 if test ! -d $(DESTDIR)/etc/logrotate.d; then \
616 $(mkinstalldirs) $(DESTDIR)/etc/logrotate.d; \
617 fi; \
618 if test ! -f $(DESTDIR)/etc/logrotate.d/@install_name@; then \
619 if test -w $(DESTDIR)/etc/logrotate.d; then \
620 cp $(srcdir)/scripts/logrotate $(DESTDIR)/etc/logrotate.d/@install_name@; \
621 else \
622 echo "$(DESTDIR)/etc/logrotate.d not writable"; \
623 fi; \
624 else \
625 echo "$(DESTDIR)/etc/logrotate.d/@install_name@ exists, not overwriting"; \
626 fi; \
627 fi
628 @echo "./samhain-install.sh --destdir=$(DESTDIR) --express --verbose install-data"; \
629 ./samhain-install.sh --destdir=$(DESTDIR) --express --verbose install-data || \
630 echo " ERROR: Failed to install the configuration file to $(DESTDIR)$(configfile). You need to install the configuration file manually."
631 @if test x"$(VFLAG)" = "x-DSH_WITH_SERVER"; then \
632 echo;\
633 echo " -----------------------------------------------------";\
634 echo " The server will run as user @myident@ if started with";\
635 echo " root privileges, otherwise as the user of the parent ";\
636 echo " process (use --enable-identity=USER to change).";\
637 echo;\
638 echo " You may want to use: make install-user";\
639 echo;\
640 echo " - to add the user @myident@ (if not existing already)";\
641 echo " - to chown the data directory $(mydatadir)";\
642 echo " - to chown the log file directory $(mylogdir)";\
643 echo " - to chown the configuration file $(configfile)";\
644 echo " -----------------------------------------------------";\
645 else \
646 if test "x@need_user_install@" = x1; then \
647 echo;\
648 echo " -----------------------------------------------------";\
649 echo " You may want to use: make install-user";\
650 echo;\
651 echo " - to add the user @myident@ (if not existing already)";\
652 echo " -----------------------------------------------------";\
653 fi; \
654 fi
655
656uninstall-data:
657 @echo "./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-data"; \
658 ./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-data
659
660#
661# -- man files
662#
663
664install-man:
665 $(mkinstalldirs) $(DESTDIR)$(mandir)/man8
666 $(mkinstalldirs) $(DESTDIR)$(mandir)/man5
667 @if test -f $(top_srcdir)/man/samhain.8 ; then \
668 echo " $(INSTALL_MAN) $(top_srcdir)/man/samhain.8 $(DESTDIR)$(mandir)/man8/@install_name@.8"; \
669 $(INSTALL_MAN) $(top_srcdir)/man/samhain.8 $(DESTDIR)$(mandir)/man8/@install_name@.8; \
670 fi
671 @if test -f $(top_srcdir)/man/samhainrc.5 ; then \
672 echo " $(INSTALL_MAN) $(top_srcdir)/man/samhainrc.5 $(DESTDIR)$(mandir)/man5/@install_name@rc.5"; \
673 $(INSTALL_MAN) $(top_srcdir)/man/samhainrc.5 $(DESTDIR)$(mandir)/man5/@install_name@rc.5; \
674 fi
675
676uninstall-man:
677 @echo "./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-man";\
678 ./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-man
679
680
681#----------------------------------------------------------
682#
683# BUILD rules
684#
685#----------------------------------------------------------
686
687run: run-light
688
689run-light: all
690 @echo "Building $(PACKAGE)-$(VERSION).run"; \
691 STAGE=$(PACKAGE)-$(VERSION); \
692 mkdir $$STAGE; \
693 if test x"$$?" != x0; then \
694 echo "ERROR ... mkdir $$STAGE failed"; \
695 exit 1; \
696 fi; \
697 $(MAKE) DESTDIR=$$STAGE install-light; \
698 rm -f $$STAGE/@sbindir@/@install_name@_stealth; \
699 echo "#! /bin/sh" > $$STAGE/setup.sh; \
700 if test x$(mytmpdir) != x; then \
701 echo "./mkinstalldirs @mytmpdir@ || exit 1" >> $$STAGE/setup.sh; \
702 fi; \
703 echo "./mkinstalldirs @sbindir@ || exit 1" >> $$STAGE/setup.sh; \
704 echo "./mkinstalldirs @sysconfdir@ || exit 1" >> $$STAGE/setup.sh; \
705 echo "./mkinstalldirs @mylockdir@ || exit 1" >> $$STAGE/setup.sh; \
706 echo "./mkinstalldirs @mylogdir@ || exit 1" >> $$STAGE/setup.sh; \
707 echo "./mkinstalldirs @mydataroot@ || exit 1" >> $$STAGE/setup.sh; \
708 echo "chmod 700 @mydataroot@ || exit 1" >> $$STAGE/setup.sh; \
709 if test -f $$STAGE/lib/modules; then \
710 RVER=`uname -r`; \
711 echo "chown root:root lib/modules/$$RVER/*" >> $$STAGE/setup.sh; \
712 if test -d /lib/modules/$$RVER; then \
713 echo "./mkinstalldirs /lib/modules/$$RVER" >> $$STAGE/setup.sh; \
714 echo "cp -p lib/modules/$$RVER/* /lib/modules/$$RVER/" >> $$STAGE/setup.sh; \
715 elif test -d /lib/modules/misc; then \
716 echo "./mkinstalldirs /lib/modules/misc" >> $$STAGE/setup.sh; \
717 echo "cp -p lib/modules/misc/* /lib/modules/misc/" >> $$STAGE/setup.sh; \
718 elif test -d /lib/modules; then \
719 echo "./mkinstalldirs /lib/modules/misc" >> $$STAGE/setup.sh; \
720 echo "cp -p lib/modules/misc/* /lib/modules/misc/" >> $$STAGE/setup.sh; \
721 fi; \
722 echo "/sbin/depmod -a" >> $$STAGE/setup.sh; \
723 fi; \
724 temp=`echo $(sbindir) | sed s,^/,,`; \
725 echo "chown root $$temp/*" >> $$STAGE/setup.sh; \
726 echo "cp -p $$temp/* $(sbindir) || exit 1" >> $$STAGE/setup.sh; \
727 temp=`echo $(sysconfdir) | sed s,^/,,`; \
728 echo "chown root $$temp/*" >> $$STAGE/setup.sh; \
729 configfile=`echo @myconffile@ | sed 's%^REQ_FROM_SERVER%%'`; \
730 echo "test -f $$configfile || cp -p $$temp/* $$configfile" >> $$STAGE/setup.sh; \
731 echo "./samhain-install.sh --express --verbose install-boot || echo 'Cannot install init script'" >> $$STAGE/setup.sh; \
732 cp $(top_srcdir)/mkinstalldirs $$STAGE/; \
733 cp $(top_srcdir)/install-sh $$STAGE/; \
734 cp ./samhain-install.sh $$STAGE/; \
735 cp -r init/ $$STAGE/; \
736 chmod +x $$STAGE/setup.sh; \
737 chmod +x $$STAGE/samhain-install.sh; \
738 chmod +x $$STAGE/mkinstalldirs; \
739 chmod +x $$STAGE/install-sh; \
740 $(top_srcdir)/scripts/makeself/makeself.sh --header $(top_srcdir)/scripts/makeself/makeself-header.sh --nocomp --nomd5 --notemp $$STAGE $(PACKAGE)-$(VERSION).run "$(PACKAGE)_$(VERSION)_self_extracting_installer" ./setup.sh && \
741 rm -r $(PACKAGE)-$(VERSION)
742
743emerge-prepare: dist
744 @echo "Building $(PACKAGE)-$(VERSION)"; \
745 test -f /etc/make.globals && . /etc/make.globals; \
746 test -f /etc/make.conf && . /etc/make.conf; \
747 echo "$(INSTALL_MAN) $(PACKAGE)-$(VERSION).tar.gz $${DISTDIR}/@install_name@-$(VERSION).tar.gz"; \
748 $(INSTALL_MAN) $(PACKAGE)-$(VERSION).tar.gz $${DISTDIR}/@install_name@-$(VERSION).tar.gz; \
749 if test "x$${PORTDIR_OVERLAY}" = "x"; then \
750 COPY_TO="$${PORTDIR}"; \
751 else \
752 COPY_TO="$${PORTDIR_OVERLAY}"; \
753 fi; \
754 $(mkinstalldirs) $${COPY_TO}/app-admin/@install_name@; \
755 echo "$(INSTALL_MAN) scripts/samhain.ebuild $${COPY_TO}/app-admin/@install_name@/@install_name@-$(VERSION).ebuild";\
756 $(INSTALL_MAN) scripts/samhain.ebuild $${COPY_TO}/app-admin/@install_name@/@install_name@-$(VERSION).ebuild; \
757 test -f $${COPY_TO}/app-admin/@install_name@/files/digest-@install_name@-$(VERSION) && rm $${COPY_TO}/app-admin/@install_name@/files/digest-@install_name@-$(VERSION);\
758 ebuild $${COPY_TO}/app-admin/@install_name@/@install_name@-$(VERSION).ebuild digest;
759
760emerge-prepare-light: dist
761 @echo "Building $(PACKAGE)-$(VERSION)"; \
762 test -f /etc/make.globals && . /etc/make.globals; \
763 test -f /etc/make.conf && . /etc/make.conf; \
764 echo "$(INSTALL_MAN) $(PACKAGE)-$(VERSION).tar.gz $${DISTDIR}/@install_name@-$(VERSION).tar.gz"; \
765 $(INSTALL_MAN) $(PACKAGE)-$(VERSION).tar.gz $${DISTDIR}/@install_name@-$(VERSION).tar.gz; \
766 if test "x$${PORTDIR_OVERLAY}" = "x"; then \
767 COPY_TO="$${PORTDIR}"; \
768 else \
769 COPY_TO="$${PORTDIR_OVERLAY}"; \
770 fi; \
771 $(mkinstalldirs) $${COPY_TO}/app-admin/@install_name@; \
772 echo "$(INSTALL_MAN) scripts/samhain.ebuild-light $${COPY_TO}/app-admin/@install_name@/@install_name@-$(VERSION).ebuild";\
773 $(INSTALL_MAN) scripts/samhain.ebuild-light $${COPY_TO}/app-admin/@install_name@/@install_name@-$(VERSION).ebuild; \
774 test -f $${COPY_TO}/app-admin/@install_name@/files/digest-@install_name@-$(VERSION) && rm $${COPY_TO}/app-admin/@install_name@/files/digest-@install_name@-$(VERSION);\
775 ebuild $${COPY_TO}/app-admin/@install_name@/@install_name@-$(VERSION).ebuild digest;
776
777
778tbz2: emerge-prepare
779 @emerge --buildpkgonly @install_name@; \
780 test -f /etc/make.globals && . /etc/make.globals; \
781 test -f /etc/make.conf && . /etc/make.conf; \
782 echo; \
783 echo "@install_name@-$(VERSION).tbz2 should be in $${PKGDIR}/All"; \
784 if test -f $${PKGDIR}/All/@install_name@-$(VERSION).tbz2; then \
785 echo "Package $${PKGDIR}/All/@install_name@-$(VERSION).tbz2 built."; \
786 mv $${PKGDIR}/All/@install_name@-$(VERSION).tbz2 $(PACKAGE)-$(VERSION).tbz2; \
787 rm -f $${PKGDIR}/app-admin/@install_name@-$(VERSION).tbz2; \
788 rm -rf $${PORTAGE_TMPDIR}/portage/@install_name@-$(VERSION); \
789 else \
790 echo "Error ... cannot find package."; \
791 exit 1; \
792 fi; \
793 echo
794
795tbz2-light: emerge-prepare-light
796 @emerge --buildpkgonly @install_name@; \
797 test -f /etc/make.globals && . /etc/make.globals; \
798 test -f /etc/make.conf && . /etc/make.conf; \
799 echo; \
800 if test -f $${PKGDIR}/All/@install_name@-$(VERSION).tbz2; then \
801 echo "Package $${PKGDIR}/All/@install_name@-$(VERSION).tbz2 built."; \
802 mv $${PKGDIR}/All/@install_name@-$(VERSION).tbz2 $(PACKAGE)-$(VERSION).tbz2; \
803 rm -f $${PKGDIR}/app-admin/@install_name@-$(VERSION).tbz2; \
804 rm -rf $${PORTAGE_TMPDIR}/portage/@install_name@-$(VERSION); \
805 else \
806 echo "Error ... cannot find package."; \
807 exit 1; \
808 fi; \
809 echo
810
811emerge:
812 emerge $(PACKAGE);
813
814deb-light:
815 @echo "creating subdirectory debian"; \
816 mkdir -p debian; \
817 cp rules.deb-light debian/rules; \
818 chmod +x debian/rules; \
819 echo $(sbindir) | sed s,^/,, > debian/dirs; \
820 if test x$(mytmpdir) != x; then \
821 echo $(mytmpdir) | sed s,^/,, >> debian/dirs; \
822 fi; \
823 echo $(sysconfdir) | sed s,^/,, >> debian/dirs; \
824 echo etc/init.d >> debian/dirs; \
825 echo $(mydatadir) | sed s,^/,, >> debian/dirs; \
826 echo $(mylogdir) | sed s,^/,, >> debian/dirs; \
827 echo $(mylockdir) | sed s,^/,, >> debian/dirs; \
828 if test "x@sh_lkm@" != x; then \
829 RVER=`uname -r`; \
830 if test -d /lib/modules/$$RVER; then \
831 echo "lib/modules/$$RVER" >> debian/dirs; \
832 elif test -d /lib/modules/misc; then \
833 echo "lib/modules/misc" >> debian/dirs; \
834 elif test -d /lib/modules; then \
835 echo "lib/modules/misc" >> debian/dirs; \
836 fi; \
837 fi; \
838 $(MAKE) deb-run
839
840deb:
841 @echo "creating subdirectory debian"; \
842 mkdir -p debian; \
843 cp rules.deb debian/rules; \
844 chmod +x debian/rules; \
845 echo $(sbindir) | sed s,^/,, > debian/dirs; \
846 if test x$(mytmpdir) != x; then \
847 echo $(mytmpdir) | sed s,^/,, >> debian/dirs; \
848 fi; \
849 echo $(sysconfdir) | sed s,^/,, >> debian/dirs; \
850 echo etc/init.d >> debian/dirs; \
851 echo $(mydatadir) | sed s,^/,, >> debian/dirs; \
852 echo $(mylogdir) | sed s,^/,, >> debian/dirs; \
853 echo $(mylockdir) | sed s,^/,, >> debian/dirs; \
854 echo $(mandir)/man5 | sed s,^/,, >> debian/dirs; \
855 echo $(mandir)/man8 | sed s,^/,, >> debian/dirs; \
856 echo usr/share/doc/$(PACKAGE) >> debian/dirs; \
857 if test "x@sh_lkm@" != x; then \
858 RVER=`uname -r`; \
859 if test -d /lib/modules/$$RVER; then \
860 echo "lib/modules/$$RVER" >> debian/dirs; \
861 elif test -d /lib/modules/misc; then \
862 echo "lib/modules/misc" >> debian/dirs; \
863 elif test -d /lib/modules; then \
864 echo "lib/modules/misc" >> debian/dirs; \
865 fi; \
866 fi; \
867 echo $(top_srcdir)/README > debian/docs; \
868 echo $(top_srcdir)/test/testtiger.txt >> debian/docs; \
869 echo $(srcsrc)/simple-bignum.tar.bz2 >> debian/docs; \
870 echo $(top_srcdir)/scripts/head.html >> debian/docs; \
871 echo $(top_srcdir)/scripts/foot.html >> debian/docs; \
872 echo $(top_srcdir)/samhain.jpg >> debian/docs; \
873 echo $(top_srcdir)/docs/BUGS >> debian/docs; \
874 echo $(top_srcdir)/docs/HOWTO-client+server.html >> debian/docs; \
875 echo $(top_srcdir)/docs/HOWTO-samhain+GnuPG.html >> debian/docs; \
876 echo $(top_srcdir)/docs/MANUAL-2_3.html.tar >> debian/docs; \
877 echo $(top_srcdir)/docs/MANUAL-2_3.pdf >> debian/docs; \
878 echo $(top_srcdir)/docs/README.gcc_bug >> debian/docs; \
879 echo $(top_srcdir)/docs/README.LZO >> debian/docs; \
880 echo $(top_srcdir)/docs/README.sstrip >> debian/docs; \
881 echo $(top_srcdir)/docs/README.UPGRADE >> debian/docs; \
882 echo $(top_srcdir)/docs/README.win2K >> debian/docs; \
883 echo $(top_srcdir)/docs/TODO >> debian/docs; \
884 $(MAKE) deb-run
885
886deb-run:
887 @maintainer=`gpg --list-secret-keys | grep 'uid ' | cut -d" " -f 5- | sed 's/^ *//' | sed q1`;\
888 if test "x$$maintainer" = x; then \
889 maintainer="$(DEFAULT_MAINTAINER)"; \
890 fi; \
891 echo "$(PACKAGE) ($(VERSION)-$(BUILD_NUM)) stable; urgency=low" > debian/changelog; \
892 echo >> debian/changelog; \
893 echo " * Initial release." >> debian/changelog; \
894 echo >> debian/changelog; \
895 echo " -- $$maintainer `date -R`" >> debian/changelog; \
896 echo >> debian/changelog; \
897 echo "Local variables:" >> debian/changelog; \
898 echo "mode: debian-changelog" >> debian/changelog; \
899 echo "End:" >> debian/changelog; \
900 cp $(top_srcdir)/COPYING debian/copyright; \
901 touch debian/README.debian; \
902 echo "Document: @install_name@-manual" > debian/@install_name@.doc-base; \
903 echo "Title: @install_name@ Manual" >> debian/@install_name@.doc-base; \
904 echo "Author: Rainer Wichmann" >> debian/@install_name@.doc-base; \
905 echo "Abstract: This manual describes what @install_name@ is" >> debian/@install_name@.doc-base; \
906 echo " and how it can be used to check the file integrity of your" >> debian/@install_name@.doc-base; \
907 echo " server." >> debian/@install_name@.doc-base; \
908 echo "Section: System/Security" >> debian/@install_name@.doc-base; \
909 echo >> debian/@install_name@.doc-base; \
910 echo >> debian/@install_name@.doc-base; \
911 echo "Format: Postscript" >> debian/@install_name@.doc-base; \
912 echo "Files: /usr/share/doc/@install_name@/manual.pdf.gz" >> debian/@install_name@.doc-base; \
913 echo >> debian/@install_name@.doc-base; \
914 echo "Format: HTML" >> debian/@install_name@.doc-base; \
915 echo "Index: /usr/share/doc/@install_name@/manual.html/index.html" >> debian/@install_name@.doc-base; \
916 echo "Files: /usr/share/doc/@install_name@/manual.html/*.html" >> debian/@install_name@.doc-base; \
917 if test -f /usr/lib/lsb/install_initd; then \
918 cp init/samhain.startLSB debian/@install_name@.init; \
919 else \
920 cp init/samhain.startLinux debian/@install_name@.init; \
921 fi; \
922 echo "Source: samhain" > debian/control; \
923 echo "Section: admin" >> debian/control; \
924 echo "Priority: optional" >> debian/control; \
925 echo "Maintainer: $$maintainer" >> debian/control; \
926 echo "Standards-Version: 3.2.1" >> debian/control; \
927 echo >> debian/control; \
928 echo "Package: @install_name@" >> debian/control; \
929 echo "Architecture: any" >> debian/control; \
930 echo "Depends: libc6" >> debian/control; \
931 echo "Description: File integrity checker" >> debian/control; \
932 echo " A file integrity checker" >> debian/control; \
933 echo "running debuild -us -uc"; \
934 debuild -us -uc -b; \
935 DEBFILE=`find ../ -follow -maxdepth 1 -cnewer ./debian/control 2>/dev/null | grep '@install_name@_$(VERSION)' | grep '\.deb'`; \
936 if test x"$$DEBFILE" = x; then \
937 echo "Error ... cannot find package file"; \
938 exit 1; \
939 else \
940 echo "Package $$DEBFILE built."; \
941 cp $$DEBFILE ./$(PACKAGE)-$(VERSION)-$(BUILD_NUM).deb; \
942 ln -s ./$(PACKAGE)-$(VERSION)-$(BUILD_NUM).deb ./$(PACKAGE)-$(VERSION).deb; \
943 fi; \
944 echo
945
946#
947# Check samhain.spec
948#
949rpmspec-full:
950 @grep 'install-light' samhain.spec >/dev/null 2>&1; \
951 if test x"$$?" = "x0"; then \
952 echo "Your samhain.spec is from rpm-light. Please run"; \
953 echo " .config.status to re-create the original samhain.spec"; \
954 exit 1; \
955 fi
956
957# when editing the spec file, make an additional blank after 'make'
958# to avoid that it matches on a second processing
959#
960rpmspec-light: samhain.spec
961 @echo "Stripping docs from samhain.spec"; \
962 cat samhain.spec | sed 's,make DESTDIR=$${RPM_BUILD_ROOT} install,make DESTDIR=$${RPM_BUILD_ROOT} install-light,' | sed s,shkeep=yes,shkeep=no, | sed s,%doc.*,, | sed '/logrotate/! { s,%attr.*,, }' > samhain.spec-light; \
963 mv samhain.spec-light samhain.spec
964
965rpm-light: rpmspec-light distrpm
966 rpmbuild -ta ./$(PACKAGE)-$(VERSION).tar.gz;
967 @RPMTOP=`cat ~/.rpmmacros 2>/dev/null | grep '%_topdir' | awk '{ print $$2}'`; \
968 if test x"$$RPMTOP" = x; then RPMTOP=/usr/src; fi; \
969 echo "Searching the RPM package below $$RPMTOP ..."; \
970 RPMFILE=`find $$RPMTOP -follow -maxdepth 4 -cnewer ./samhain.spec 2>/dev/null | grep '@install_name@-$(VERSION)' | grep '\.rpm' | grep -v '\.src\.'`; \
971 echo; \
972 if test x"$$RPMFILE" = x; then \
973 echo "Error ... cannot find package file"; \
974 exit 1; \
975 else \
976 echo "Package $$RPMFILE built."; \
977 echo "Copying it to ./$(PACKAGE)-$(VERSION).rpm"; \
978 cp $$RPMFILE ./$(PACKAGE)-$(VERSION).rpm; \
979 fi; \
980 echo
981
982rpm: rpmspec-full distrpm
983 rpmbuild -ta ./$(PACKAGE)-$(VERSION).tar.gz;
984 @RPMTOP=`cat ~/.rpmmacros 2>/dev/null | grep '%_topdir' | awk '{ print $$2}'`; \
985 if test x"$$RPMTOP" = x; then RPMTOP=/usr/src; fi; \
986 echo "Searching the RPM package below $$RPMTOP ..."; \
987 RPMFILE=`find $$RPMTOP -follow -maxdepth 4 -cnewer ./samhain.spec 2>/dev/null | grep '@install_name@-$(VERSION)' | grep '\.rpm' | grep -v '\.src\.'`; \
988 echo; \
989 if test x"$$RPMFILE" = x; then \
990 echo "Error ... cannot find package file"; \
991 exit 1; \
992 else \
993 echo "Package $$RPMFILE built."; \
994 echo "Copying it to ./$(PACKAGE)-$(VERSION).rpm"; \
995 cp $$RPMFILE ./$(PACKAGE)-$(VERSION).rpm; \
996 fi; \
997 echo
998
999srpm-dist: rpmspec-full samhain.spec
1000 @cat samhain.spec | \
1001 sed s%\-\-with\-base=.*\,[0123456789]*%% | \
1002 sed s%\'\'%% > samhain.spec.m; \
1003 mv samhain.spec.m samhain.spec
1004 $(MAKE) distrpm
1005 rpmbuild -ts ./$(PACKAGE)-$(VERSION).tar.gz
1006
1007
1008srpm: rpmspec-full distrpm
1009 rpmbuild -ts ./$(PACKAGE)-$(VERSION).tar.gz
1010
1011solaris-pkg-light: all
1012 @STAGE=/tmp/samhain-pkg-staging; \
1013 mkdir $$STAGE; \
1014 if test x"$$?" != x0; then \
1015 echo "ERROR ... mkdir $$STAGE failed"; \
1016 exit 1; \
1017 fi; \
1018 $(MAKE) DESTDIR=$$STAGE install-light;
1019 $(MAKE) solaris-pkg-finish
1020
1021solaris-pkg: all
1022 @STAGE=/tmp/samhain-pkg-staging; \
1023 mkdir $$STAGE; \
1024 if test x"$$?" != x0; then \
1025 echo "ERROR ... mkdir $$STAGE failed"; \
1026 exit 1; \
1027 fi; \
1028 $(MAKE) DESTDIR=$$STAGE install;
1029 $(MAKE) solaris-pkg-finish
1030
1031solaris-pkg-finish:
1032 @STAGE=/tmp/samhain-pkg-staging; \
1033 $(mkinstalldirs) $$STAGE/etc/init.d; \
1034 $(INSTALL_SHELL) init/samhain.startSolaris $$STAGE/etc/init.d/@install_name@; \
1035 (echo 'i pkginfo'; pkgproto $$STAGE=/ ) >prototype; \
1036 user=`id | sed s,uid=[0123456789]*\(,, | sed s,\).*,,`; \
1037 group=`id | sed s,.*gid=[0123456789]*\(,, | sed s,\).*,,`; \
1038 cat prototype | grep -v 'none / ' | \
1039 sed s,$$user\ $$group,root\ sys,g > prototype.1; \
1040 rm -f prototype.2; \
1041 while read line; do \
1042 echo "$${line}" | egrep '^d none' >/dev/null 2>&1; \
1043 if [ $$? = 0 ]; then \
1044 dir=`echo "$${line}" | awk '{ print $$3 }'`; \
1045 if [ -d "$$dir" ]; then \
1046 echo "d none $${dir} ? ? ?" >> prototype.2; \
1047 else \
1048 echo "$${line}" >> prototype.2; \
1049 fi; \
1050 else \
1051 echo "$${line}" >> prototype.2; \
1052 fi; \
1053 done < prototype.1; \
1054 rm -f prototype && rm prototype.1 && mv prototype.2 prototype; \
1055 echo "d none /etc/rc0.d ? ? ?" >> prototype; \
1056 echo "d none /etc/rc1.d ? ? ?" >> prototype; \
1057 echo "d none /etc/rc3.d ? ? ?" >> prototype; \
1058 echo "l none /etc/rc3.d/S99@install_name@=/etc/init.d/@install_name@" >> prototype; \
1059 echo "l none /etc/rc0.d/K10@install_name@=/etc/init.d/@install_name@" >> prototype; \
1060 echo "l none /etc/rc1.d/K10@install_name@=/etc/init.d/@install_name@" >> prototype; \
1061 ARCH=`uname -p`; \
1062 PSTAMP=`date '+%c%y%m%d%H%M%S'`; \
1063 echo "PKG=@install_name@" > pkginfo; \
1064 echo "NAME=file integrity check" >> pkginfo; \
1065 echo "VERSION=$(VERSION)" >> pkginfo; \
1066 echo "CATEGORY=system" >> pkginfo; \
1067 echo "CLASSES=none" >> pkginfo; \
1068 echo "VENDOR=http://la-samhna.de/samhain" >> pkginfo; \
1069 echo "EMAIL=support@la-samhna.de" >> pkginfo; \
1070 echo "ARCH=$$ARCH" >> pkginfo; \
1071 echo "PSTAMP=$$PSTAMP" >> pkginfo; \
1072 pkgmk -o; \
1073 pkgtrans -s /var/spool/pkg /tmp/samhain-pkg-staging/@install_name@.pkg @install_name@; \
1074 if test -f /tmp/samhain-pkg-staging/@install_name@.pkg; then \
1075 echo; \
1076 cp /tmp/samhain-pkg-staging/@install_name@.pkg $(PACKAGE)-$(VERSION).pkg; \
1077 echo "Package $(PACKAGE)-$(VERSION).pkg is ready for installation"; \
1078 echo "to install, use: pkgadd -n -d $(PACKAGE)-$(VERSION).pkg all"; \
1079 echo; \
1080 rm -rf /var/spool/pkg/@install_name@ /tmp/samhain-pkg-staging; \
1081 else \
1082 echo; \
1083 echo "**************************************************************"; \
1084 echo "Error ... cannot find /tmp/samhain-pkg-staging/@install_name@.pkg."; \
1085 echo "Keeping /var/spool/pkg/@install_name@ /tmp/samhain-pkg-staging"; \
1086 if test -d /var/spool/pkg; then \
1087 echo "**************************************************************"; \
1088 else \
1089 echo "************** /var/spool/pkg is missing *********************"; \
1090 fi; \
1091 echo; \
1092 exit 1; \
1093 fi
1094
1095depot-prep: all
1096 STAGE=/tmp/samhain-pkg-staging; \
1097 mkdir $$STAGE; \
1098 if test x"$$?" != x0; then \
1099 echo "ERROR ... mkdir $$STAGE failed"; \
1100 exit 1; \
1101 fi; \
1102 $(MAKE) DESTDIR=$$STAGE install; \
1103 $(MAKE) DESTDIR=$$STAGE install-boot; \
1104 cp hp_ux.psf $$STAGE; \
1105 mkdir $$STAGE/sc; \
1106 echo "#!/sbin/sh" > $$STAGE/sc/configure; \
1107 echo "PATH=\$$SW_PATH; export PATH" >> $$STAGE/sc/configure; \
1108 echo "chmod 555 /sbin/init.d/samhain; chown bin:bin /sbin/init.d/@install_name@; (cd /sbin; ln -f -s /sbin/init.d/@install_name@ rc2.d/S900@install_name@; ln -f -s /sbin/init.d/@install_name@ rc1.d/K100@install_name@; )" >> $$STAGE/sc/configure; \
1109 chmod +x $$STAGE/sc/configure; \
1110 echo "#!/sbin/sh" > $$STAGE/sc/unconfigure; \
1111 echo "PATH=\$$SW_PATH; export PATH" >> $$STAGE/sc/unconfigure; \
1112 echo "rm -f /sbin/rc2.d/S900@install_name@; rm -f /sbin/rc1.d/K100@install_name@" >> $$STAGE/sc/unconfigure; \
1113 chmod +x $$STAGE/sc/unconfigure; \
1114 echo "#!/sbin/sh" > $$STAGE/sc/preremove; \
1115 echo "PATH=\$$SW_PATH; export PATH" >> $$STAGE/sc/preremove; \
1116 echo "/sbin/init.d/@install_name@ stop" >> $$STAGE/sc/preremove; \
1117 echo "exit 0" >> $$STAGE/sc/preremove; \
1118 chmod +x $$STAGE/sc/preremove;
1119
1120depot: depot-prep
1121 (cd /tmp/samhain-pkg-staging && /usr/sbin/swpackage -v -s ./hp_ux.psf -x media_type=tape @ $(PACKAGE)-$(VERSION).depot)
1122 cp /tmp/samhain-pkg-staging/$(PACKAGE)-$(VERSION).depot .
1123 rm -rf /tmp/samhain-pkg-staging
1124
1125depot-light: depot
1126
1127#---------------------------------------------------------------
1128
1129
1130trustfile: $(srcsrc)/trustfile.c config.h
1131 $(COMPILE) $(VFLAG) -DSH_IDENT=\"@myident@\" -DTRUST_MAIN -DSL_ALWAYS_TRUSTED=@mytrust@ -o trustfile $(srcsrc)/trustfile.c
1132
1133sh_MK.h: config.h
1134 @echo "creating sh_MK.h"; \
1135 echo "#ifndef SH_MK_H" > sh_MK.h; \
1136 echo "#define SH_MK_H" >> sh_MK.h; \
1137 $(top_srcdir)/c_bits.sh @my_key_1@ MKB >> sh_MK.h; \
1138 $(top_srcdir)/c_bits.sh @my_key_2@ MKA >> sh_MK.h; \
1139 $(top_srcdir)/c_bits.sh @my_key_3@ MKC >> sh_MK.h; \
1140 $(top_srcdir)/c_bits.sh @my_key_4@ MKD >> sh_MK.h; \
1141 echo "#endif" >> sh_MK.h
1142
1143
1144sstrip: $(srcsrc)/sstrip.c Makefile
1145 $(BUILD_CC) -I. -o sstrip $(srcsrc)/sstrip.c
1146
1147encode: $(srcsrc)/encode.c Makefile
1148 $(BUILD_CC) -I. -o encode $(srcsrc)/encode.c
1149
1150config_xor.h: config.h encode
1151 @echo 'encode $(XOR_CODE) config.h'; \
1152 sleep 1; \
1153 ./encode $(XOR_CODE) config.h; \
1154 mv x_config.h config_xor.h
1155
1156#.c.o:
1157# @echo "./encode $(XOR_CODE) $< --> x_`echo $< |sed 's%.*/%%'`"; \
1158# ./encode $(XOR_CODE) $<; \
1159# echo "$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $< |sed 's%.*/%%'`"; \
1160# $(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $< |sed 's%.*/%%'`; \
1161# rm x_`echo $< |sed 's%.*/%%'`
1162
1163$(OBJECTS): encode internal.h
1164 @echo "./encode $(XOR_CODE) $(srcsrc)/`echo $@ |sed 's%\.o$$%%'`.c --> x_`echo $@ |sed 's%\.o$$%%'`.c"; \
1165 ./encode $(XOR_CODE) $(srcsrc)/`echo $@ |sed 's%\.o$$%%'`.c; \
1166 echo "$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $@ |sed 's%\.o$$%%'`.c"; \
1167 $(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $@ |sed 's%\.o$$%%'`.c && \
1168 rm x_`echo $@ |sed 's%\.o$$%%'`.c
1169
1170sh_tiger_i.o: $(srcsrc)/$(TIGER_SRC) Makefile config_xor.h
1171 @echo "$(COMPILE) $(VFLAG) -o sh_tiger_i.o -c $(srcsrc)/$(TIGER_SRC)";\
1172 $(COMPILE) $(VFLAG) -o sh_tiger_i.o -c $(srcsrc)/$(TIGER_SRC);
1173
1174samhain_setpwd: encode config_xor.h $(srcsrc)/samhain_setpwd.c
1175 @echo '$(COMPILE) -o samhain_setpwd $(srcsrc)/samhain_setpwd.c'; \
1176 ./encode $(XOR_CODE) $(srcsrc)/samhain_setpwd.c; \
1177 $(COMPILE) -o samhain_setpwd x_samhain_setpwd.c; \
1178 rm x_samhain_setpwd.c
1179
1180samhain_stealth: encode config_xor.h $(srcsrc)/samhain_stealth.c
1181 @echo '$(COMPILE) -o samhain_stealth $(srcsrc)/samhain_stealth.c'; \
1182 ./encode $(XOR_CODE) $(srcsrc)/samhain_stealth.c; \
1183 $(COMPILE) -o samhain_stealth x_samhain_stealth.c; \
1184 rm x_samhain_stealth.c
1185
1186yulectl: encode config_xor.h $(srcsrc)/yulectl.c
1187 @echo '$(COMPILE) -o yulectl $(srcsrc)/yulectl.c $(LIBS_SOCK)'; \
1188 ./encode $(XOR_CODE) $(srcsrc)/yulectl.c; \
1189 $(COMPILE) -o yulectl x_yulectl.c $(LIBS_SOCK); \
1190 rm x_yulectl.c
1191
1192$(SAMHAIN): internal.h $(OBJECTS) sh_tiger_i.o
1193 @-rm -f $(SAMHAIN)
1194 @echo "$(LINK) sh_tiger_i.o $(OBJECTS) $(LIBS_TRY)"; \
1195 $(LINK) sh_tiger_i.o $(OBJECTS) $(LIBS_TRY)
1196
1197
1198CUTEST_SOURCES = $(srcsrc)/cutest_sh_tools.c \
1199 $(srcsrc)/cutest_sh_utils.c \
1200 $(srcsrc)/cutest_sh_unix.c \
1201 $(srcsrc)/cutest_slib.c \
1202 $(srcsrc)/cutest_zAVLTree.c \
1203 $(srcsrc)/cutest_sh_hash.c \
1204 $(srcsrc)/cutest_sh_tiger0.c
1205
1206CUTEST_OBJECTS = cutest_sh_tools.o \
1207 cutest_sh_utils.o \
1208 cutest_sh_unix.o \
1209 cutest_slib.o \
1210 cutest_zAVLTree.o \
1211 cutest_sh_hash.o \
1212 cutest_sh_tiger0.o
1213
1214$(CUTEST_OBJECTS): $(CUTEST_SOURCES) config_xor.h internal.h
1215 @echo "./encode $(XOR_CODE) $(srcsrc)/`echo $@ |sed 's%\.o$$%%'`.c --> x_`echo $@ |sed 's%\.o$$%%'`.c"; \
1216 ./encode $(XOR_CODE) $(srcsrc)/`echo $@ |sed 's%\.o$$%%'`.c; \
1217 echo "$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $@ |sed 's%\.o$$%%'`.c"; \
1218 $(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $@ |sed 's%\.o$$%%'`.c; \
1219 rm x_`echo $@ |sed 's%\.o$$%%'`.c
1220
1221
1222cutest: $(SOURCES) $(CUTEST_SOURCES)
1223 @$(MAKE) CUTEST='-DSH_CUTEST=1' intcutest
1224
1225$(srcsrc)/CuTestMain.c: $(SOURCES) $(CUTEST_SOURCES) $(srcsrc)/make-tests.sh
1226 cd $(srcsrc)/ && ./make-tests.sh >CuTestMain.c;
1227
1228intcutest: internal.h $(OBJECTS) $(CUTEST_OBJECTS) sh_tiger_i.o $(srcsrc)/CuTestMain.c
1229 @$(COMPILE) -o CuTestMain.o -c $(srcsrc)/CuTestMain.c; \
1230 $(COMPILE) -o CuTest.o -c $(srcsrc)/CuTest.c; \
1231 rm -f samhain.o; \
1232 ./encode $(XOR_CODE) $(srcsrc)/samhain.c; \
1233 $(COMPILE) $(VFLAG) -o samhain.o -c x_samhain.c; \
1234 rm x_samhain.c; \
1235 $(LINK) sh_tiger_i.o $(CUTEST_OBJECTS) CuTestMain.o CuTest.o $(OBJECTS) $(LIBS_TRY); \
1236 test -f ./intcutest && mv ./intcutest ./cutest; \
1237 ./cutest
1238
1239runcutest:
1240 gdb ./cutest
1241
1242samhain_hide.o: $(srcsrc)/samhain_hide.c samhain_erase.o
1243 gcc @lkm_inc@ -I. -Wall -O2 -c $(srcsrc)/samhain_hide.c
1244
1245samhain_erase.o: $(srcsrc)/samhain_erase.c
1246 gcc @lkm_inc@ -I. -Wall -O2 -c $(srcsrc)/samhain_erase.c
1247
1248# -- NEW --
1249samhain_hide.ko: $(srcsrc)/samhain_hide.c
1250 @test -d m_comp || mkdir m_comp; \
1251 echo "KVERSION := \$$(shell uname -r)" > m_comp/Makefile;\
1252 echo "KSOURCE ?= /lib/modules/\$$(KVERSION)/build" >> m_comp/Makefile;\
1253 echo "obj-m := samhain_hide.o" >> m_comp/Makefile;\
1254 echo ".PHONY: modules install clean modules_add" >> m_comp/Makefile;\
1255 echo "install : modules_add" >> m_comp/Makefile;\
1256 echo "modules modules_install clean:" >> m_comp/Makefile;\
1257 echo "T\$$(MAKE) -C \$$(KSOURCE) \$$@ SUBDIRS=\$$(CURDIR) KBUILD_VERBOSE=2" | tr T '\t' >> m_comp/Makefile;\
1258 cp config.h m_comp/; \
1259 cp $(srcsrc)/samhain_hide.c m_comp/; \
1260 cd m_comp && $(MAKE) modules
1261 @if test -f m_comp/samhain_hide.ko; then \
1262 cp -p m_comp/samhain_hide.ko samhain_hide.ko; \
1263 rm -rf m_comp/; \
1264 else \
1265 echo "Kernel module samhain_hide.ko not build"; \
1266 exit 1; \
1267 fi
1268
1269# -- NEW --
1270samhain_kmem.ko: $(srcsrc)/samhain_kmem.c
1271 @test -d m_comp || mkdir m_comp; \
1272 echo "KVERSION := \$$(shell uname -r)" > m_comp/Makefile;\
1273 echo "KSOURCE ?= /lib/modules/\$$(KVERSION)/build" >> m_comp/Makefile;\
1274 echo "obj-m := @install_name@_kmem.o" >> m_comp/Makefile;\
1275 echo ".PHONY: modules install clean modules_add" >> m_comp/Makefile;\
1276 echo "install : modules_add" >> m_comp/Makefile;\
1277 echo "modules modules_install clean:" >> m_comp/Makefile;\
1278 echo "T\$$(MAKE) -C \$$(KSOURCE) \$$@ SUBDIRS=\$$(CURDIR) KBUILD_VERBOSE=2" | tr T '\t' >> m_comp/Makefile;\
1279 cp config.h m_comp/; \
1280 cp $(srcsrc)/samhain_kmem.c m_comp/@install_name@_kmem.c; \
1281 cd m_comp && $(MAKE) modules
1282 @if test -f m_comp/@install_name@_kmem.ko; then \
1283 cp -p m_comp/@install_name@_kmem.ko samhain_kmem.ko; \
1284 rm -rf m_comp/; \
1285 else \
1286 echo "Kernel module samhain_kmem.ko not build"; \
1287 exit 1; \
1288 fi
1289
1290
1291# -- NEW --
1292lkm: @sh_lkm@
1293
1294
1295
1296# For kernel syscall monitoring
1297kern_head: Makefile $(top_srcdir)/include/kern_head.h $(srcsrc)/kern_head.c
1298 @echo "$(BUILD_CC) -I. -I./include -DSYSTEMMAP=\"@systemmap@\" -o kern_head $(srcsrc)/kern_head.c $(LIBS_KVM)"; \
1299 $(BUILD_CC) -I. -I./include -DSYSTEMMAP=\"@systemmap@\" -o kern_head $(srcsrc)/kern_head.c $(LIBS_KVM)
1300
1301sh_ks.h: kern_head
1302 @sleep 1; \
1303 ./kern_head > sh_ks.h
1304
1305sh_ks_xor.h: encode sh_ks.h
1306 @echo 'encode $(XOR_CODE) sh_ks.h'; \
1307 sleep 1; \
1308 ./encode $(XOR_CODE) sh_ks.h; \
1309 mv x_sh_ks.h sh_ks_xor.h
1310
1311# For bignum
1312internal.h: mkhdr
1313 @sleep 1; \
1314 ./mkhdr
1315
1316bignum.o: internal.h
1317
1318
1319# If your compiler can't handle long identifiers (> 6 chars), move the `#' to
1320# the other line.
1321
1322mkhdr: $(srcsrc)/mkhdr.c config.h
1323 @echo "$(BUILD_CC) -I. -o mkhdr $(srcsrc)/mkhdr.c"; \
1324 sleep 1; \
1325 $(BUILD_CC) -I. -o mkhdr $(srcsrc)/mkhdr.c
1326
1327# $(COMPILE) -DBIG_SHORT_NAMES -o mkhdr $(srcdir)/mkhdr.c
1328
1329#----------------------------------------------------------
1330#
1331# EXE PACKER rules
1332#
1333#----------------------------------------------------------
1334
1335minilzo.o: $(srcsrc)/minilzo.c $(srcinc)/lzoconf.h $(srcinc)/minilzo.h config.h
1336 @echo "$(COMPILE) -DMINILZO_HAVE_CONFIG_H -o minilzo.o -c $(srcsrc)/minilzo.c"; \
1337 $(COMPILE) -DMINILZO_HAVE_CONFIG_H -o minilzo.o -c $(srcsrc)/minilzo.c
1338
1339exepack_mkdata: $(srcsrc)/exepack_mkdata.c $(srcinc)/lzoconf.h $(srcinc)/minilzo.h minilzo.o
1340 @echo "$(COMPILE) -o exepack_mkdata.o -c $(srcsrc)/exepack_mkdata.c"; \
1341 $(COMPILE) -o exepack_mkdata.o -c $(srcsrc)/exepack_mkdata.c; \
1342 echo "$(LINK) exepack_mkdata.o minilzo.o"; \
1343 $(LINK) exepack_mkdata.o minilzo.o
1344
1345#
1346# prepare the data to be packed
1347#
1348exepack.data: $(SAMHAIN) exepack_mkdata sstrip
1349 @echo "cp ./$(SAMHAIN) ./samhain.pk.data"; \
1350 cp ./$(SAMHAIN) ./samhain.pk.data; \
1351 echo "strip ./samhain.pk.data"; \
1352 strip ./samhain.pk.data > /dev/null 2>&1 || echo "... is already stripped"; \
1353 echo "./sstrip ./samhain.pk.data"; \
1354 ./sstrip ./samhain.pk.data > /dev/null 2>&1 || echo "sstrip returned false"; \
1355 echo "./exepack_mkdata ./samhain.pk.data ./exepack.data 0"; \
1356 ./exepack_mkdata ./samhain.pk.data ./exepack.data 0; \
1357 echo "rm -f ./samhain.pk.data"; \
1358 rm -f ./samhain.pk.data;
1359
1360exepack: $(srcsrc)/exepack.c minilzo.o exepack.data
1361 @echo "$(COMPILE) -o exepack.o -c $(srcsrc)/exepack.c"; \
1362 $(COMPILE) -o exepack.o -c $(srcsrc)/exepack.c; \
1363 echo "$(LINK) exepack.o minilzo.o"; \
1364 $(LINK) exepack.o minilzo.o;
1365
1366#
1367# this program fills the data section with the binary
1368#
1369exepack_fill: $(srcsrc)/exepack_fill.c minilzo.o exepack
1370 @echo "$(COMPILE) -o exepack_fill.o -c $(srcsrc)/exepack_fill.c"; \
1371 $(COMPILE) -o exepack_fill.o -c $(srcsrc)/exepack_fill.c; \
1372 echo "$(LINK) exepack_fill.o minilzo.o"; \
1373 $(LINK) exepack_fill.o minilzo.o
1374
1375samhain.pk: $(SAMHAIN) exepack exepack_fill sstrip
1376 @echo "cp ./$(SAMHAIN) ./samhain.pk.data"; \
1377 cp ./$(SAMHAIN) ./samhain.pk.data; \
1378 echo "strip ./samhain.pk.data"; \
1379 strip ./samhain.pk.data > /dev/null 2>&1 || echo "... is already stripped"; \
1380 echo "./sstrip ./samhain.pk.data"; \
1381 ./sstrip ./samhain.pk.data > /dev/null 2>&1 || echo "sstrip returned false"; \
1382 test -f exepack.out && rm exepack.out; \
1383 echo "./exepack_fill exepack samhain.pk.data exepack.out"; \
1384 ./exepack_fill exepack samhain.pk.data exepack.out; \
1385 chmod +x exepack.out; \
1386 echo "strip exepack.out"; \
1387 strip exepack.out > /dev/null 2>&1 || echo "... is already stripped"; \
1388 ./sstrip exepack.out > /dev/null 2>&1 || echo "sstrip returned false"; \
1389 echo "mv exepack.out samhain.pk"; \
1390 rm -f samhain.pk; mv exepack.out samhain.pk
1391
1392samhain-packed: $(SAMHAIN) samhain_setpwd
1393 @echo "samhain_setpwd samhain new $(CLIENTPASSWD)"; \
1394 samhain_setpwd samhain new $(CLIENTPASSWD); \
1395 echo "rm -f samhain; mv samhain.new samhain"; \
1396 rm -f samhain; mv samhain.new samhain; \
1397 $(MAKE) samhain.pk; \
1398 echo "rm -f samhain; mv samhain.pk samhain"; \
1399 rm -f samhain; mv samhain.pk samhain
1400
1401#----------------------------------------------------------
1402#
1403# DEPLOY rules
1404#
1405#----------------------------------------------------------
1406
1407uninstall-deploy:
1408 rm -rf $(mydatadir)/profiles/source
1409 rm -rf $(mydatadir)/profiles/archpkg
1410 rm -rf $(mydatadir)/profiles/libexec
1411 rm -rf $(mydatadir)/profiles/tmp
1412 rm -rf $(mydatadir)/profiles/private
1413 @if test -f $(sbindir)/deploy.sh; then \
1414 old_deploy=`grep 'VERSION2' $(sbindir)/deploy.sh >/dev/null 2>&1 || echo old`; \
1415 if test x"$$old_deploy" = xold; then \
1416 echo "rm -f $(sbindir)/deploy2.sh"; \
1417 rm -f $(sbindir)/deploy2.sh; \
1418 else \
1419 echo "rm -f $(sbindir)/deploy.sh"; \
1420 rm -f $(sbindir)/deploy.sh; \
1421 fi; \
1422 fi
1423
1424EXECFILES= comCHECKSRC comDOWNLOAD comBUILD comCLEAN comINSTALL \
1425 funcDIALOG funcEXE funcPRINT funcSETUP funcBUILD funcINSTALL \
1426 funcDB comUNINSTALL \
1427 preinstall postinstall initscript
1428
1429# $(mydatadir)/profiles/
1430# |
1431# |
1432# |-- source -------------> (tarballs)
1433# |
1434# |-- configs ------------> (default configs)
1435# |
1436# |-- archpkg
1437# | |
1438# | |-- architecture -> (package, setup script)
1439# |
1440# |-- hosts
1441# | |
1442# | |-- hostname -----> (config)
1443# |
1444# |-- libexec ------------> (scripts)
1445# |
1446# |-- private ------------> (gpg key)
1447# |
1448# |-- tmp
1449#
1450install-deploy: deploy.sh samhain_stealth
1451 @echo "Creating directory tree under $(mydatadir)/profiles/"; \
1452 $(mkinstalldirs) $(sbindir); \
1453 $(mkinstalldirs) $(mydatadir)/profiles/source; \
1454 $(mkinstalldirs) $(mydatadir)/profiles/configs; \
1455 $(mkinstalldirs) $(mydatadir)/profiles/archpkg/debian_i386; \
1456 $(mkinstalldirs) $(mydatadir)/profiles/archpkg/gentoo_i386; \
1457 $(mkinstalldirs) $(mydatadir)/profiles/archpkg/redhat_i386; \
1458 $(mkinstalldirs) $(mydatadir)/profiles/archpkg/linux_i386; \
1459 $(mkinstalldirs) $(mydatadir)/profiles/archpkg/freebsd_i386;\
1460 $(mkinstalldirs) $(mydatadir)/profiles/archpkg/solaris; \
1461 $(mkinstalldirs) $(mydatadir)/profiles/archpkg/aix; \
1462 $(mkinstalldirs) $(mydatadir)/profiles/hosts; \
1463 $(mkinstalldirs) $(mydatadir)/profiles/libexec; \
1464 $(mkinstalldirs) $(mydatadir)/profiles/private; \
1465 $(mkinstalldirs) $(mydatadir)/profiles/tmp; \
1466 if test -f $(srcdir)/../$(PACKAGE)-$(VERSION).tar.gz.asc; then \
1467 if test -f $(srcdir)/../$(PACKAGE)-$(VERSION).tar.gz; then \
1468 echo "Installing source tarball"; \
1469 $(INSTALL_DATA) $(srcdir)/../$(PACKAGE)-$(VERSION).tar.gz.asc \
1470 $(mydatadir)/profiles/source/$(PACKAGE)-$(VERSION).tar.gz.asc; \
1471 $(INSTALL_DATA) $(srcdir)/../$(PACKAGE)-$(VERSION).tar.gz \
1472 $(mydatadir)/profiles/source/$(PACKAGE)-$(VERSION).tar.gz; \
1473 fi; \
1474 fi; \
1475 echo "Installing default configs"; \
1476 test -f $(mydatadir)/profiles/configs/freebsd_i386.samhainrc || \
1477 $(INSTALL_DATA) $(srcdir)/samhainrc.freebsd \
1478 $(mydatadir)/profiles/configs/freebsd_i386.samhainrc; \
1479 test -f $(mydatadir)/profiles/configs/debian_i386.samhainrc || \
1480 $(INSTALL_DATA) $(srcdir)/samhainrc.linux \
1481 $(mydatadir)/profiles/configs/debian_i386.samhainrc; \
1482 test -f $(mydatadir)/profiles/configs/gentoo_i386.samhainrc || \
1483 $(INSTALL_DATA) $(srcdir)/samhainrc.linux \
1484 $(mydatadir)/profiles/configs/gentoo_i386.samhainrc; \
1485 test -f $(mydatadir)/profiles/configs/redhat_i386.samhainrc || \
1486 $(INSTALL_DATA) $(srcdir)/samhainrc.linux \
1487 $(mydatadir)/profiles/configs/redhat_i386.samhainrc; \
1488 test -f $(mydatadir)/profiles/configs/linux_i386.samhainrc || \
1489 $(INSTALL_DATA) $(srcdir)/samhainrc.linux \
1490 $(mydatadir)/profiles/configs/linux_i386.samhainrc; \
1491 test -f $(mydatadir)/profiles/configs/solaris.samhainrc || \
1492 $(INSTALL_DATA) $(srcdir)/samhainrc.solaris \
1493 $(mydatadir)/profiles/configs/solaris.samhainrc; \
1494 test -f $(mydatadir)/profiles/configs/aix.samhainrc || \
1495 $(INSTALL_DATA) $(srcdir)/samhainrc.aix5.2.0 \
1496 $(mydatadir)/profiles/configs/aix.samhainrc; \
1497 if test -f $(mydatadir)/profiles/configs/generic.configure; then \
1498 :; \
1499 else \
1500 SH_FQDN_SYSTEM=`uname -n`; \
1501 SH_FQDN_DOMAIN=`grep -i domain /etc/resolv.conf |grep -v "\#" |awk '{print $$2}' |head -1`; \
1502 if test -n "$${SH_FQDN_SYSTEM}" -a -n "$${SH_FQDN_DOMAIN}"; then \
1503 sh_thishost="$${SH_FQDN_SYSTEM}.$${SH_FQDN_DOMAIN}"; \
1504 else \
1505 sh_thishost="FQDN_MISSING"; \
1506 fi; \
1507 outfile=$(mydatadir)/profiles/configs/generic.configure; \
1508 echo "'--enable-network=client'" > $$outfile; \
1509 echo "'--with-logserver=$${sh_thishost}'" >> $$outfile; \
1510 echo "'--with-data-file=REQ_FROM_SERVER/var/lib/samhain/samhain_file'" >> $$outfile; \
1511 echo "'--with-config-file=REQ_FROM_SERVER/etc/samhainrc'" >> $$outfile; \
1512 echo "'--enable-base=@mykeybase@'" >> $$outfile; \
1513 fi; \
1514 $(INSTALL_SHELL) $(srcdir)/mkinstalldirs \
1515 $(mydatadir)/profiles/libexec; \
1516 $(INSTALL_SHELL) $(srcdir)/install-sh \
1517 $(mydatadir)/profiles/libexec; \
1518 for ff in $(EXECFILES); do \
1519 test -f $(srcdir)/dsys/$$ff && $(INSTALL_SHELL) $(srcdir)/dsys/$$ff \
1520 $(mydatadir)/profiles/libexec; \
1521 done; \
1522 $(INSTALL_SHELL) samhain_stealth $(mydatadir)/profiles/libexec; \
1523 test -f $(srcdir)/dsys/0F571F6C.asc && $(INSTALL_DATA) $(srcdir)/dsys/0F571F6C.asc \
1524 $(mydatadir)/profiles/private; \
1525 convert +compress $(srcdir)/stealth_template.jpg stealth_template.ps >/dev/null || \
1526 { echo "*"; echo "* 'convert' not found or not working, not installing"; echo "* $(mydatadir)/profiles/private/stealth_template.ps"; echo "* (only required for installing packages built with --enable-stealth)"; echo "*"; }; \
1527 if test -f stealth_template.ps; then \
1528 if test -f $(mydatadir)/profiles/private/stealth_template.ps; then \
1529 :; \
1530 else \
1531 $(INSTALL_DATA) stealth_template.ps $(mydatadir)/profiles/private; \
1532 fi; \
1533 fi; \
1534 if test -f $(sbindir)/deploy.sh; then \
1535 old_deploy=`grep 'VERSION2' $(sbindir)/deploy.sh >/dev/null 2>&1 || echo old`; \
1536 if test x"$$old_deploy" = xold; then \
1537 echo "*"; echo "* Version 1 of deploy.sh found"; echo "*"; \
1538 echo "* Installing $(sbindir)/deploy2.sh"; echo "*"; \
1539 $(INSTALL_SHELL) deploy.sh $(sbindir)/deploy2.sh; \
1540 else \
1541 echo "Installing $(sbindir)/deploy.sh"; \
1542 $(INSTALL_SHELL) deploy.sh $(sbindir)/deploy.sh; \
1543 fi; \
1544 else \
1545 echo "Installing $(sbindir)/deploy.sh"; \
1546 $(INSTALL_SHELL) deploy.sh $(sbindir)/deploy.sh; \
1547 fi
1548
1549
1550#----------------------------------------------------------
1551#
1552# DISTRIBUTION rules
1553#
1554#----------------------------------------------------------
1555
1556distdir = $(PACKAGE)-$(VERSION)
1557top_distdir = $(distdir)
1558
1559# This target untars the dist file and tries a VPATH configuration. Then
1560# it guarantees that the distribution is self-contained by making another
1561# tarfile.
1562
1563#
1564# 1) make distribution tarfile
1565# 2) unpack the tarfile into distdir
1566# 3) create build and install directories
1567# 4) do the build in the build dir, with sources from distdir
1568# 5) check (there are no subdirs, thus does nothing)
1569# 6) install
1570# 7) installcheck (equal to check, does nothing)
1571#
1572distcheck: dist
1573 -rm -rf $(distdir)
1574 GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
1575 mkdir $(distdir)/=build
1576 mkdir $(distdir)/=inst
1577 dc_install_base=`cd $(distdir)/=inst && pwd`; \
1578 cd $(distdir)/=build \
1579 && ../configure --srcdir=.. --prefix=$$dc_install_base \
1580 && $(MAKE) \
1581 && $(MAKE) install
1582 -rm -rf $(distdir)
1583 -rm -f $(distdir).tar.gz.asc
1584 @gpg -a --detach-sign $(distdir).tar.gz; \
1585 $(TAR) chof $(distdir).tar $(distdir).tar.gz $(distdir).tar.gz.asc; \
1586 rm -f $(distdir).tar.gz; \
1587 rm -f $(distdir).tar.gz.asc; \
1588 gzip --best $(distdir).tar
1589 mv $(distdir).tar.gz $(PACKAGE)_signed-$(VERSION).tar.gz
1590 @echo "========================"; \
1591 echo "$(PACKAGE)_signed-$(VERSION).tar.gz is ready for distribution"; \
1592 echo "========================"
1593
1594#
1595# create a tarfile for the distibution
1596#
1597distrpm: distdirrpm
1598 -chmod -R a+r $(distdir)
1599 -rm -rf $(distdir).tar.gz
1600 -rm -rf $(distdir).tar
1601 $(TAR) chof $(distdir).tar $(distdir)
1602 gzip -c --best $(distdir).tar > $(distdir).tar.gz
1603 -rm -rf $(distdir)
1604
1605dist: distdir
1606 -chmod -R a+r $(distdir)
1607 -rm -rf $(distdir).tar.gz
1608 -rm -rf $(distdir).tar
1609 $(TAR) chof $(distdir).tar $(distdir)
1610 gzip -c --best $(distdir).tar > $(distdir).tar.gz
1611 -rm -rf $(distdir)
1612
1613#
1614# create a tarfile for the distibution
1615#
1616dist-sign: distdir
1617 -rm -f $(distdir)/scripts/samhain.ebuild
1618 -rm -f $(distdir)/scripts/samhain.ebuild-light
1619 -chmod -R a+r $(distdir)
1620 -rm -rf $(distdir).tar.gz
1621 -rm -rf $(distdir).tar
1622 $(TAR) chof $(distdir).tar $(distdir)
1623 gzip --best $(distdir).tar
1624 -rm -rf $(distdir)
1625 -rm -f $(distdir).tar.gz.asc
1626 gpg -a --detach-sign $(distdir).tar.gz
1627 $(TAR) chof $(distdir).tar $(distdir).tar.gz $(distdir).tar.gz.asc
1628 -rm -f $(distdir).tar.gz
1629 -rm -f $(distdir).tar.gz.asc
1630 gzip --best $(distdir).tar
1631 mv $(distdir).tar.gz $(PACKAGE)_signed-$(VERSION).tar.gz
1632
1633
1634#
1635# same as dist
1636#
1637dist-all: distdir
1638 -chmod -R a+r $(distdir)
1639 GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
1640 -rm -rf $(distdir)
1641
1642#
1643# create distribution directory and copy files into it
1644#
1645INITFILES=samhain.startIRIX samhain.startFreeBSD samhain.startSolaris \
1646samhain.startLSB samhain.startGentoo samhain.startLinux samhain.startHPUX \
1647samhain.startIRIX samhain.startMACOSX
1648
1649SCRIPTFILES=redhat_i386.client.spec check_samhain.pl samhainadmin.pl \
1650yuleadmin.pl samhain.ebuild samhain.ebuild-light samhain.spec
1651
1652distdir: distfilecheck
1653 -rm -f $(top_srcdir)/init/*~
1654 -rm -f $(top_srcdir)/sql_init/*~
1655 -rm -f $(top_srcdir)/dsys/*~
1656 -rm -f $(top_srcdir)/docs/*~
1657 -rm -f $(top_srcdir)/include/*~
1658 -rm -f $(top_srcdir)/src/*~
1659 -rm -f $(top_srcdir)/test/*~
1660 -rm -f $(top_srcdir)/scripts/*~
1661 (cd $(top_srcdir)/init && rm -f $(INITFILES))
1662 (cd $(top_srcdir)/scripts && rm -f $(SCRIPTFILES))
1663 -rm -rf $(distdir)
1664 mkdir $(distdir)
1665 -chmod 777 $(distdir)
1666 @for file in $(DISTFILES); do \
1667 d=$(top_srcdir); \
1668 if test -f $$d/$$file || test -d $$d/$$file; then \
1669 cp -pr $$d/$$file $(distdir)/$$file; \
1670 fi; \
1671 done; \
1672 cp scripts/samhain.spec $(distdir)/samhain.spec; \
1673 rm -f $(distdir)/scripts/*.spec
1674
1675#
1676# as distdir, but don't copy spec file from scripts
1677#
1678distdirrpm: distfilecheck
1679 -rm -rf $(distdir)
1680 mkdir $(distdir)
1681 -chmod 777 $(distdir)
1682 @if test -f ./samhain.spec; then \
1683 :; \
1684 else \
1685 echo "Error: ./samhain.spec not found, please run configure"; \
1686 exit 1; \
1687 fi
1688 @cp -p samhain.spec $(distdir)/samhain.spec; \
1689 for file in $(DISTFILES); do \
1690 d=$(top_srcdir); \
1691 if test -f $$d/$$file || test -d $$d/$$file; then \
1692 if test x"$$file" = "xsamhain.spec"; then \
1693 :; \
1694 else \
1695 cp -pr $$d/$$file $(distdir)/$$file; \
1696 fi; \
1697 fi; \
1698 done; \
1699 rm -f $(distdir)/scripts/*.spec
1700
1701
1702distfilecheck: $(top_srcdir)/config.h.in $(top_srcdir)/depend.sum
1703 @for file in $(DISTFILES); do \
1704 d=$(top_srcdir); \
1705 if test -f $$d/$$file || test -d $$d/$$file; then \
1706 : \
1707 else \
1708 echo "File not found: $$d/$$file"; \
1709 fi; \
1710 done
1711 @for file in $(SOURCES); do \
1712 if test -f $$file; then \
1713 : \
1714 else \
1715 echo "File not found: $$file"; \
1716 fi; \
1717 done
1718
1719
1720# DO NOT DELETE THIS LINE
1721
1722
1723samhain.o: $(srcsrc)/samhain.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_getopt.h $(srcinc)/sh_readconf.h $(srcinc)/sh_hash.h $(srcinc)/sh_restrict.h $(srcinc)/sh_nmail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_mem.h $(srcinc)/sh_forward.h $(srcinc)/sh_tools.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h sh_MK.h $(srcinc)/sh_schedule.h
1724sh_unix.o: $(srcsrc)/sh_unix.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_hash.h $(srcinc)/sh_tools.h $(srcinc)/sh_restrict.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_tiger.h $(srcinc)/sh_prelink.h $(srcinc)/sh_pthread.h $(srcinc)/sh_static.h $(srcinc)/sh_prelude.h $(srcinc)/zAVLTree.h $(srcinc)/sh_ignore.h
1725sh_utils.o: $(srcsrc)/sh_utils.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_entropy.h $(srcinc)/sh_pthread.h
1726sh_error.o: $(srcsrc)/sh_error.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_database.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_nmail.h $(srcinc)/sh_forward.h $(srcinc)/sh_prelude.h $(srcinc)/sh_pthread.h $(srcinc)/sh_tools.h $(srcinc)/sh_extern.h
1727sh_files.o: $(srcsrc)/sh_files.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/sh_inotify.h $(srcinc)/zAVLTree.h $(srcinc)/CuTest.h
1728sh_getopt.o: $(srcsrc)/sh_getopt.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_getopt.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_utils.h $(srcinc)/sh_mail.h $(srcinc)/sh_forward.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h
1729sh_readconf.o: $(srcsrc)/sh_readconf.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_calls.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_forward.h $(srcinc)/sh_gpg.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/sh_database.h $(srcinc)/sh_mail.h $(srcinc)/sh_modules.h $(srcinc)/sh_nmail.h $(srcinc)/sh_prelink.h $(srcinc)/sh_prelude.h $(srcinc)/sh_tiger.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_restrict.h
1730sh_tiger0.o: $(srcsrc)/sh_tiger0.c Makefile config_xor.h $(srcinc)/sh_tiger.h $(srcinc)/sh_unix.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_pthread.h $(srcinc)/sh_string.h
1731sh_tiger1.o: $(srcsrc)/sh_tiger1.c Makefile config_xor.h
1732sh_tiger2.o: $(srcsrc)/sh_tiger2.c Makefile config_xor.h
1733sh_tiger1_64.o: $(srcsrc)/sh_tiger1_64.c Makefile config_xor.h
1734sh_tiger2_64.o: $(srcsrc)/sh_tiger2_64.c Makefile config_xor.h
1735sh_hash.o: $(srcsrc)/sh_hash.c Makefile config_xor.h $(srcinc)/sh_hash.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h $(srcinc)/sh_pthread.h $(srcinc)/sh_forward.h $(srcinc)/sh_hash.h
1736sh_mail.o: $(srcsrc)/sh_mail.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mail.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_pthread.h $(srcinc)/sh_filter.h $(srcinc)/sh_mail_int.h $(srcinc)/sh_nmail.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_static.h $(srcinc)/sh_tools.h
1737sh_mem.o: $(srcsrc)/sh_mem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_pthread.h
1738sh_entropy.o: $(srcsrc)/sh_entropy.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_calls.h $(srcinc)/sh_pthread.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/CuTest.h
1739sh_forward.o: $(srcsrc)/sh_forward.c Makefile config_xor.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_forward.h $(srcinc)/sh_srp.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_entropy.h $(srcinc)/sh_html.h $(srcinc)/sh_nmail.h $(srcinc)/sh_socket.h $(srcinc)/sh_static.h $(srcinc)/rijndael-api-fst.h $(srcinc)/sh_readconf.h $(srcinc)/zAVLTree.h $(srcinc)/sh_extern.h
1740sh_modules.o: $(srcsrc)/sh_modules.c Makefile config_xor.h $(srcinc)/sh_modules.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utmp.h $(srcinc)/sh_mounts.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_kern.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_processcheck.h $(srcinc)/sh_portcheck.h $(srcinc)/sh_logmon.h $(srcinc)/sh_registry.h $(srcinc)/sh_fInotify.h
1741sh_utmp.o: $(srcsrc)/sh_utmp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_utmp.h $(srcinc)/sh_pthread.h $(srcinc)/sh_inotify.h
1742sh_kern.o: $(srcsrc)/sh_kern.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_kern.h sh_ks_xor.h $(srcinc)/sh_unix.h $(srcinc)/sh_hash.h
1743sh_suidchk.o: $(srcsrc)/sh_suidchk.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_hash.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_schedule.h $(srcinc)/sh_calls.h
1744sh_srp.o: $(srcsrc)/sh_srp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mem.h $(srcinc)/sh_utils.h $(srcinc)/sh_srp.h $(srcinc)/bignum.h $(srcinc)/CuTest.h
1745sh_fifo.o: $(srcsrc)/sh_fifo.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_fifo.h
1746sh_tools.o: $(srcsrc)/sh_tools.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_ipvx.h $(srcinc)/rijndael-api-fst.h $(srcinc)/rijndael-api-fst.h
1747sh_html.o: $(srcsrc)/sh_html.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_forward.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_html.h $(srcinc)/zAVLTree.h
1748sh_gpg.o: $(srcsrc)/sh_gpg.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h
1749sh_cat.o: $(srcsrc)/sh_cat.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_cat.h
1750sh_calls.o: $(srcsrc)/sh_calls.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_calls.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_sub.h $(srcinc)/sh_utils.h
1751sh_extern.o: $(srcsrc)/sh_extern.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_extern.h $(srcinc)/sh_calls.h $(srcinc)/sh_filter.h $(srcinc)/sh_static.h
1752sh_database.o: $(srcsrc)/sh_database.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h
1753sh_err_log.o: $(srcsrc)/sh_err_log.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_tiger.h
1754sh_err_console.o: $(srcsrc)/sh_err_console.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h
1755sh_err_syslog.o: $(srcsrc)/sh_err_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h
1756sh_schedule.o: $(srcsrc)/sh_schedule.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_schedule.h
1757bignum.o: $(srcsrc)/bignum.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/bignum.h
1758mkhdr.o: $(srcsrc)/mkhdr.c Makefile config.h
1759samhain_setpwd.o: $(srcsrc)/samhain_setpwd.c Makefile config_xor.h
1760samhain_stealth.o: $(srcsrc)/samhain_stealth.c Makefile config_xor.h
1761encode.o: $(srcsrc)/encode.c Makefile
1762sstrip.o: $(srcsrc)/sstrip.c Makefile config.h
1763trustfile.o: $(srcsrc)/trustfile.c Makefile config_xor.h $(srcinc)/sh_calls.h $(srcinc)/slib.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h
1764exepack.o: $(srcsrc)/exepack.c Makefile config.h $(srcinc)/minilzo.h $(srcinc)/exepack.data
1765exepack_fill.o: $(srcsrc)/exepack_fill.c Makefile config.h config.h $(srcinc)/minilzo.h
1766exepack_mkdata.o: $(srcsrc)/exepack_mkdata.c Makefile config.h $(srcinc)/minilzo.h
1767minilzo.o: $(srcsrc)/minilzo.c Makefile $(srcinc)/minilzo.h
1768slib.o: $(srcsrc)/slib.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_calls.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_string.h $(srcinc)/sh_mem.h
1769rijndael-alg-fst.o: $(srcsrc)/rijndael-alg-fst.c Makefile config_xor.h $(srcinc)/rijndael-alg-fst.h $(srcinc)/rijndael-boxes-fst.h
1770rijndael-api-fst.o: $(srcsrc)/rijndael-api-fst.c Makefile config_xor.h $(srcinc)/rijndael-api-fst.h
1771zAVLTree.o: $(srcsrc)/zAVLTree.c Makefile $(srcinc)/zAVLTree.h
1772sh_socket.o: $(srcsrc)/sh_socket.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_socket.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_calls.h $(srcinc)/sh_utils.h $(srcinc)/zAVLTree.h $(srcinc)/sh_html.h $(srcinc)/sh_tools.h
1773sh_ignore.o: $(srcsrc)/sh_ignore.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/CuTest.h
1774yulectl.o: $(srcsrc)/yulectl.c Makefile config_xor.h
1775sh_mounts.o: $(srcsrc)/sh_mounts.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_mounts.h
1776sh_userfiles.o: $(srcsrc)/sh_userfiles.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_modules.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_utils.h $(srcinc)/sh_schedule.h $(srcinc)/sh_error.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h
1777sh_prelude.o: $(srcsrc)/sh_prelude.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_error_min.h $(srcinc)/sh_prelude.h $(srcinc)/sh_static.h
1778kern_head.o: $(srcsrc)/kern_head.c Makefile config.h $(srcinc)/kern_head.h $(srcinc)/kern_head.h
1779sh_prelink.o: $(srcsrc)/sh_prelink.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_extern.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h
1780sh_static.o: $(srcsrc)/sh_static.c Makefile config_xor.h $(srcinc)/sh_pthread.h
1781sh_async.o: $(srcsrc)/sh_async.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_calls.h $(srcinc)/sh_error.h
1782sh_processcheck.o: $(srcsrc)/sh_processcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_modules.h $(srcinc)/sh_processcheck.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_calls.h $(srcinc)/sh_pthread.h $(srcinc)/CuTest.h
1783sh_portcheck.o: $(srcsrc)/sh_portcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_mem.h $(srcinc)/sh_calls.h $(srcinc)/sh_utils.h $(srcinc)/sh_modules.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_ipvx.h $(srcinc)/CuTest.h
1784sh_pthread.o: $(srcsrc)/sh_pthread.c Makefile config_xor.h $(srcinc)/sh_pthread.h $(srcinc)/sh_calls.h $(srcinc)/sh_modules.h
1785sh_string.o: $(srcsrc)/sh_string.c Makefile config_xor.h $(srcinc)/sh_string.h $(srcinc)/sh_mem.h $(srcinc)/CuTest.h
1786dnmalloc.o: $(srcsrc)/dnmalloc.c Makefile config.h
1787t-test1.o: $(srcsrc)/t-test1.c Makefile config.h $(srcinc)/malloc.h
1788sh_port2proc.o: $(srcsrc)/sh_port2proc.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error_min.h $(srcinc)/sh_pthread.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_ipvx.h
1789sh_log_parse_syslog.o: $(srcsrc)/sh_log_parse_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h
1790sh_log_parse_pacct.o: $(srcsrc)/sh_log_parse_pacct.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h
1791sh_log_parse_apache.o: $(srcsrc)/sh_log_parse_apache.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h
1792sh_log_evalrule.o: $(srcsrc)/sh_log_evalrule.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h $(srcinc)/sh_log_correlate.h $(srcinc)/sh_log_mark.h $(srcinc)/sh_log_repeat.h $(srcinc)/zAVLTree.h
1793sh_log_check.o: $(srcsrc)/sh_log_check.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_string.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h $(srcinc)/sh_log_correlate.h $(srcinc)/sh_log_mark.h $(srcinc)/sh_log_repeat.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h
1794sh_log_parse_samba.o: $(srcsrc)/sh_log_parse_samba.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_string.h
1795sh_nmail.o: $(srcsrc)/sh_nmail.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_mem.h $(srcinc)/sh_mail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_string.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_filter.h $(srcinc)/sh_mail_int.h $(srcinc)/zAVLTree.h
1796sh_filter.o: $(srcsrc)/sh_filter.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_filter.h
1797sh_inotify.o: $(srcsrc)/sh_inotify.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_calls.h $(srcinc)/sh_inotify.h $(srcinc)/sh_mem.h $(srcinc)/sh_utils.h $(srcinc)/slib.h $(srcinc)/zAVLTree.h $(srcinc)/sh_calls.h $(srcinc)/sh_inotify.h $(srcinc)/CuTest.h
1798sh_log_correlate.o: $(srcsrc)/sh_log_correlate.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h
1799sh_log_mark.o: $(srcsrc)/sh_log_mark.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_mem.h $(srcinc)/sh_string.h $(srcinc)/sh_error_min.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h $(srcinc)/zAVLTree.h
1800sh_log_repeat.o: $(srcsrc)/sh_log_repeat.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h
1801sh_log_parse_generic.o: $(srcsrc)/sh_log_parse_generic.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_log_check.h $(srcinc)/sh_string.h
1802sh_login_track.o: $(srcsrc)/sh_login_track.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_string.h $(srcinc)/sh_tools.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_error_min.h $(srcinc)/CuTest.h $(srcinc)/CuTest.h
1803sh_audit.o: $(srcsrc)/sh_audit.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_utils.h
1804sh_registry.o: $(srcsrc)/sh_registry.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_modules.h $(srcinc)/sh_hash.h $(srcinc)/sh_tiger.h
1805sh_ipvx.o: $(srcsrc)/sh_ipvx.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_ipvx.h
1806sh_restrict.o: $(srcsrc)/sh_restrict.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error_min.h $(srcinc)/sh_string.h $(srcinc)/sh_utils.h $(srcinc)/sh_restrict.h $(srcinc)/CuTest.h
1807sh_filetype.o: $(srcsrc)/sh_filetype.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error_min.h $(srcinc)/sh_utils.h
1808sh_sub.o: $(srcsrc)/sh_sub.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h
1809sh_fInotify.o: $(srcsrc)/sh_fInotify.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_modules.h $(srcinc)/sh_pthread.h $(srcinc)/sh_inotify.h $(srcinc)/sh_unix.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h
Note: See TracBrowser for help on using the repository browser.