source: branches/samhain_3_1/Makefile.in@ 543

Last change on this file since 543 was 461, checked in by katerina, 10 years ago

Fix for ticket #361 (searching RPM package after build).

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