source: trunk/Makefile.in@ 413

Last change on this file since 413 was 412, checked in by katerina, 12 years ago

Enhancements for ticket #312 (logrotate) and #313 (--enable-suid).

File size: 78.6 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 ! -f /etc/logrotate.d/@install_name@; then \
616 cp $(srcdir)/scripts/logrotate /etc/logrotate.d/@install_name@; \
617 else \
618 echo "/etc/logrotate.d/@install_name@ exists, not overwriting"; \
619 fi; \
620 fi
621 @echo "./samhain-install.sh --destdir=$(DESTDIR) --express --verbose install-data"; \
622 ./samhain-install.sh --destdir=$(DESTDIR) --express --verbose install-data || \
623 echo " ERROR: Failed to install the configuration file to $(DESTDIR)$(configfile). You need to install the configuration file manually."
624 @if test x"$(VFLAG)" = "x-DSH_WITH_SERVER"; then \
625 echo;\
626 echo " -----------------------------------------------------";\
627 echo " The server will run as user @myident@ if started with";\
628 echo " root privileges, otherwise as the user of the parent ";\
629 echo " process (use --enable-identity=USER to change).";\
630 echo;\
631 echo " You may want to use: make install-user";\
632 echo;\
633 echo " - to add the user @myident@ (if not existing already)";\
634 echo " - to chown the data directory $(mydatadir)";\
635 echo " - to chown the log file directory $(mylogdir)";\
636 echo " - to chown the configuration file $(configfile)";\
637 echo " -----------------------------------------------------";\
638 else \
639 if test "x@need_user_install@" = x1; then \
640 echo;\
641 echo " -----------------------------------------------------";\
642 echo " You may want to use: make install-user";\
643 echo;\
644 echo " - to add the user @myident@ (if not existing already)";\
645 echo " -----------------------------------------------------";\
646 fi; \
647 fi
648
649uninstall-data:
650 @echo "./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-data"; \
651 ./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-data
652
653#
654# -- man files
655#
656
657install-man:
658 $(mkinstalldirs) $(DESTDIR)$(mandir)/man8
659 $(mkinstalldirs) $(DESTDIR)$(mandir)/man5
660 @if test -f $(top_srcdir)/man/samhain.8 ; then \
661 echo " $(INSTALL_MAN) $(top_srcdir)/man/samhain.8 $(DESTDIR)$(mandir)/man8/@install_name@.8"; \
662 $(INSTALL_MAN) $(top_srcdir)/man/samhain.8 $(DESTDIR)$(mandir)/man8/@install_name@.8; \
663 fi
664 @if test -f $(top_srcdir)/man/samhainrc.5 ; then \
665 echo " $(INSTALL_MAN) $(top_srcdir)/man/samhainrc.5 $(DESTDIR)$(mandir)/man5/@install_name@rc.5"; \
666 $(INSTALL_MAN) $(top_srcdir)/man/samhainrc.5 $(DESTDIR)$(mandir)/man5/@install_name@rc.5; \
667 fi
668
669uninstall-man:
670 @echo "./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-man";\
671 ./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-man
672
673
674#----------------------------------------------------------
675#
676# BUILD rules
677#
678#----------------------------------------------------------
679
680run: run-light
681
682run-light: all
683 @echo "Building $(PACKAGE)-$(VERSION).run"; \
684 STAGE=$(PACKAGE)-$(VERSION); \
685 mkdir $$STAGE; \
686 if test x"$$?" != x0; then \
687 echo "ERROR ... mkdir $$STAGE failed"; \
688 exit 1; \
689 fi; \
690 $(MAKE) DESTDIR=$$STAGE install-light; \
691 rm -f $$STAGE/@sbindir@/@install_name@_stealth; \
692 echo "#! /bin/sh" > $$STAGE/setup.sh; \
693 if test x$(mytmpdir) != x; then \
694 echo "./mkinstalldirs @mytmpdir@ || exit 1" >> $$STAGE/setup.sh; \
695 fi; \
696 echo "./mkinstalldirs @sbindir@ || exit 1" >> $$STAGE/setup.sh; \
697 echo "./mkinstalldirs @sysconfdir@ || exit 1" >> $$STAGE/setup.sh; \
698 echo "./mkinstalldirs @mylockdir@ || exit 1" >> $$STAGE/setup.sh; \
699 echo "./mkinstalldirs @mylogdir@ || exit 1" >> $$STAGE/setup.sh; \
700 echo "./mkinstalldirs @mydataroot@ || exit 1" >> $$STAGE/setup.sh; \
701 echo "chmod 700 @mydataroot@ || exit 1" >> $$STAGE/setup.sh; \
702 if test -f $$STAGE/lib/modules; then \
703 RVER=`uname -r`; \
704 echo "chown root:root lib/modules/$$RVER/*" >> $$STAGE/setup.sh; \
705 if test -d /lib/modules/$$RVER; then \
706 echo "./mkinstalldirs /lib/modules/$$RVER" >> $$STAGE/setup.sh; \
707 echo "cp -p lib/modules/$$RVER/* /lib/modules/$$RVER/" >> $$STAGE/setup.sh; \
708 elif test -d /lib/modules/misc; then \
709 echo "./mkinstalldirs /lib/modules/misc" >> $$STAGE/setup.sh; \
710 echo "cp -p lib/modules/misc/* /lib/modules/misc/" >> $$STAGE/setup.sh; \
711 elif test -d /lib/modules; then \
712 echo "./mkinstalldirs /lib/modules/misc" >> $$STAGE/setup.sh; \
713 echo "cp -p lib/modules/misc/* /lib/modules/misc/" >> $$STAGE/setup.sh; \
714 fi; \
715 echo "/sbin/depmod -a" >> $$STAGE/setup.sh; \
716 fi; \
717 temp=`echo $(sbindir) | sed s,^/,,`; \
718 echo "chown root $$temp/*" >> $$STAGE/setup.sh; \
719 echo "cp -p $$temp/* $(sbindir) || exit 1" >> $$STAGE/setup.sh; \
720 temp=`echo $(sysconfdir) | sed s,^/,,`; \
721 echo "chown root $$temp/*" >> $$STAGE/setup.sh; \
722 configfile=`echo @myconffile@ | sed 's%^REQ_FROM_SERVER%%'`; \
723 echo "test -f $$configfile || cp -p $$temp/* $$configfile" >> $$STAGE/setup.sh; \
724 echo "./samhain-install.sh --express --verbose install-boot || echo 'Cannot install init script'" >> $$STAGE/setup.sh; \
725 cp $(top_srcdir)/mkinstalldirs $$STAGE/; \
726 cp $(top_srcdir)/install-sh $$STAGE/; \
727 cp ./samhain-install.sh $$STAGE/; \
728 cp -r init/ $$STAGE/; \
729 chmod +x $$STAGE/setup.sh; \
730 chmod +x $$STAGE/samhain-install.sh; \
731 chmod +x $$STAGE/mkinstalldirs; \
732 chmod +x $$STAGE/install-sh; \
733 $(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 && \
734 rm -r $(PACKAGE)-$(VERSION)
735
736emerge-prepare: dist
737 @echo "Building $(PACKAGE)-$(VERSION)"; \
738 test -f /etc/make.globals && . /etc/make.globals; \
739 test -f /etc/make.conf && . /etc/make.conf; \
740 echo "$(INSTALL_MAN) $(PACKAGE)-$(VERSION).tar.gz $${DISTDIR}/@install_name@-$(VERSION).tar.gz"; \
741 $(INSTALL_MAN) $(PACKAGE)-$(VERSION).tar.gz $${DISTDIR}/@install_name@-$(VERSION).tar.gz; \
742 if test "x$${PORTDIR_OVERLAY}" = "x"; then \
743 COPY_TO="$${PORTDIR}"; \
744 else \
745 COPY_TO="$${PORTDIR_OVERLAY}"; \
746 fi; \
747 $(mkinstalldirs) $${COPY_TO}/app-admin/@install_name@; \
748 echo "$(INSTALL_MAN) scripts/samhain.ebuild $${COPY_TO}/app-admin/@install_name@/@install_name@-$(VERSION).ebuild";\
749 $(INSTALL_MAN) scripts/samhain.ebuild $${COPY_TO}/app-admin/@install_name@/@install_name@-$(VERSION).ebuild; \
750 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);\
751 ebuild $${COPY_TO}/app-admin/@install_name@/@install_name@-$(VERSION).ebuild digest;
752
753emerge-prepare-light: dist
754 @echo "Building $(PACKAGE)-$(VERSION)"; \
755 test -f /etc/make.globals && . /etc/make.globals; \
756 test -f /etc/make.conf && . /etc/make.conf; \
757 echo "$(INSTALL_MAN) $(PACKAGE)-$(VERSION).tar.gz $${DISTDIR}/@install_name@-$(VERSION).tar.gz"; \
758 $(INSTALL_MAN) $(PACKAGE)-$(VERSION).tar.gz $${DISTDIR}/@install_name@-$(VERSION).tar.gz; \
759 if test "x$${PORTDIR_OVERLAY}" = "x"; then \
760 COPY_TO="$${PORTDIR}"; \
761 else \
762 COPY_TO="$${PORTDIR_OVERLAY}"; \
763 fi; \
764 $(mkinstalldirs) $${COPY_TO}/app-admin/@install_name@; \
765 echo "$(INSTALL_MAN) scripts/samhain.ebuild-light $${COPY_TO}/app-admin/@install_name@/@install_name@-$(VERSION).ebuild";\
766 $(INSTALL_MAN) scripts/samhain.ebuild-light $${COPY_TO}/app-admin/@install_name@/@install_name@-$(VERSION).ebuild; \
767 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);\
768 ebuild $${COPY_TO}/app-admin/@install_name@/@install_name@-$(VERSION).ebuild digest;
769
770
771tbz2: emerge-prepare
772 @emerge --buildpkgonly @install_name@; \
773 test -f /etc/make.globals && . /etc/make.globals; \
774 test -f /etc/make.conf && . /etc/make.conf; \
775 echo; \
776 echo "@install_name@-$(VERSION).tbz2 should be in $${PKGDIR}/All"; \
777 if test -f $${PKGDIR}/All/@install_name@-$(VERSION).tbz2; then \
778 echo "Package $${PKGDIR}/All/@install_name@-$(VERSION).tbz2 built."; \
779 mv $${PKGDIR}/All/@install_name@-$(VERSION).tbz2 $(PACKAGE)-$(VERSION).tbz2; \
780 rm -f $${PKGDIR}/app-admin/@install_name@-$(VERSION).tbz2; \
781 rm -rf $${PORTAGE_TMPDIR}/portage/@install_name@-$(VERSION); \
782 else \
783 echo "Error ... cannot find package."; \
784 exit 1; \
785 fi; \
786 echo
787
788tbz2-light: emerge-prepare-light
789 @emerge --buildpkgonly @install_name@; \
790 test -f /etc/make.globals && . /etc/make.globals; \
791 test -f /etc/make.conf && . /etc/make.conf; \
792 echo; \
793 if test -f $${PKGDIR}/All/@install_name@-$(VERSION).tbz2; then \
794 echo "Package $${PKGDIR}/All/@install_name@-$(VERSION).tbz2 built."; \
795 mv $${PKGDIR}/All/@install_name@-$(VERSION).tbz2 $(PACKAGE)-$(VERSION).tbz2; \
796 rm -f $${PKGDIR}/app-admin/@install_name@-$(VERSION).tbz2; \
797 rm -rf $${PORTAGE_TMPDIR}/portage/@install_name@-$(VERSION); \
798 else \
799 echo "Error ... cannot find package."; \
800 exit 1; \
801 fi; \
802 echo
803
804emerge:
805 emerge $(PACKAGE);
806
807deb-light:
808 @echo "creating subdirectory debian"; \
809 mkdir -p debian; \
810 cp rules.deb-light debian/rules; \
811 chmod +x debian/rules; \
812 echo $(sbindir) | sed s,^/,, > debian/dirs; \
813 if test x$(mytmpdir) != x; then \
814 echo $(mytmpdir) | sed s,^/,, >> debian/dirs; \
815 fi; \
816 echo $(sysconfdir) | sed s,^/,, >> debian/dirs; \
817 echo etc/init.d >> debian/dirs; \
818 echo $(mydatadir) | sed s,^/,, >> debian/dirs; \
819 echo $(mylogdir) | sed s,^/,, >> debian/dirs; \
820 echo $(mylockdir) | sed s,^/,, >> debian/dirs; \
821 if test "x@sh_lkm@" != x; then \
822 RVER=`uname -r`; \
823 if test -d /lib/modules/$$RVER; then \
824 echo "lib/modules/$$RVER" >> debian/dirs; \
825 elif test -d /lib/modules/misc; then \
826 echo "lib/modules/misc" >> debian/dirs; \
827 elif test -d /lib/modules; then \
828 echo "lib/modules/misc" >> debian/dirs; \
829 fi; \
830 fi; \
831 $(MAKE) deb-run
832
833deb:
834 @echo "creating subdirectory debian"; \
835 mkdir -p debian; \
836 cp rules.deb debian/rules; \
837 chmod +x debian/rules; \
838 echo $(sbindir) | sed s,^/,, > debian/dirs; \
839 if test x$(mytmpdir) != x; then \
840 echo $(mytmpdir) | sed s,^/,, >> debian/dirs; \
841 fi; \
842 echo $(sysconfdir) | sed s,^/,, >> debian/dirs; \
843 echo etc/init.d >> debian/dirs; \
844 echo $(mydatadir) | sed s,^/,, >> debian/dirs; \
845 echo $(mylogdir) | sed s,^/,, >> debian/dirs; \
846 echo $(mylockdir) | sed s,^/,, >> debian/dirs; \
847 echo $(mandir)/man5 | sed s,^/,, >> debian/dirs; \
848 echo $(mandir)/man8 | sed s,^/,, >> debian/dirs; \
849 echo usr/share/doc/$(PACKAGE) >> debian/dirs; \
850 if test "x@sh_lkm@" != x; then \
851 RVER=`uname -r`; \
852 if test -d /lib/modules/$$RVER; then \
853 echo "lib/modules/$$RVER" >> debian/dirs; \
854 elif test -d /lib/modules/misc; then \
855 echo "lib/modules/misc" >> debian/dirs; \
856 elif test -d /lib/modules; then \
857 echo "lib/modules/misc" >> debian/dirs; \
858 fi; \
859 fi; \
860 echo $(top_srcdir)/README > debian/docs; \
861 echo $(top_srcdir)/test/testtiger.txt >> debian/docs; \
862 echo $(srcsrc)/simple-bignum.tar.bz2 >> debian/docs; \
863 echo $(top_srcdir)/scripts/head.html >> debian/docs; \
864 echo $(top_srcdir)/scripts/foot.html >> debian/docs; \
865 echo $(top_srcdir)/samhain.jpg >> debian/docs; \
866 echo $(top_srcdir)/docs/BUGS >> debian/docs; \
867 echo $(top_srcdir)/docs/HOWTO-client+server.html >> debian/docs; \
868 echo $(top_srcdir)/docs/HOWTO-samhain+GnuPG.html >> debian/docs; \
869 echo $(top_srcdir)/docs/MANUAL-2_3.html.tar >> debian/docs; \
870 echo $(top_srcdir)/docs/MANUAL-2_3.pdf >> debian/docs; \
871 echo $(top_srcdir)/docs/README.gcc_bug >> debian/docs; \
872 echo $(top_srcdir)/docs/README.LZO >> debian/docs; \
873 echo $(top_srcdir)/docs/README.sstrip >> debian/docs; \
874 echo $(top_srcdir)/docs/README.UPGRADE >> debian/docs; \
875 echo $(top_srcdir)/docs/README.win2K >> debian/docs; \
876 echo $(top_srcdir)/docs/TODO >> debian/docs; \
877 $(MAKE) deb-run
878
879deb-run:
880 @maintainer=`gpg --list-secret-keys | grep 'uid ' | cut -d" " -f 5- | sed 's/^ *//' | sed q1`;\
881 if test "x$$maintainer" = x; then \
882 maintainer="$(DEFAULT_MAINTAINER)"; \
883 fi; \
884 echo "$(PACKAGE) ($(VERSION)-$(BUILD_NUM)) stable; urgency=low" > debian/changelog; \
885 echo >> debian/changelog; \
886 echo " * Initial release." >> debian/changelog; \
887 echo >> debian/changelog; \
888 echo " -- $$maintainer `date -R`" >> debian/changelog; \
889 echo >> debian/changelog; \
890 echo "Local variables:" >> debian/changelog; \
891 echo "mode: debian-changelog" >> debian/changelog; \
892 echo "End:" >> debian/changelog; \
893 cp $(top_srcdir)/COPYING debian/copyright; \
894 touch debian/README.debian; \
895 echo "Document: @install_name@-manual" > debian/@install_name@.doc-base; \
896 echo "Title: @install_name@ Manual" >> debian/@install_name@.doc-base; \
897 echo "Author: Rainer Wichmann" >> debian/@install_name@.doc-base; \
898 echo "Abstract: This manual describes what @install_name@ is" >> debian/@install_name@.doc-base; \
899 echo " and how it can be used to check the file integrity of your" >> debian/@install_name@.doc-base; \
900 echo " server." >> debian/@install_name@.doc-base; \
901 echo "Section: System/Security" >> debian/@install_name@.doc-base; \
902 echo >> debian/@install_name@.doc-base; \
903 echo >> debian/@install_name@.doc-base; \
904 echo "Format: Postscript" >> debian/@install_name@.doc-base; \
905 echo "Files: /usr/share/doc/@install_name@/manual.pdf.gz" >> debian/@install_name@.doc-base; \
906 echo >> debian/@install_name@.doc-base; \
907 echo "Format: HTML" >> debian/@install_name@.doc-base; \
908 echo "Index: /usr/share/doc/@install_name@/manual.html/index.html" >> debian/@install_name@.doc-base; \
909 echo "Files: /usr/share/doc/@install_name@/manual.html/*.html" >> debian/@install_name@.doc-base; \
910 if test -f /usr/lib/lsb/install_initd; then \
911 cp init/samhain.startLSB debian/@install_name@.init; \
912 else \
913 cp init/samhain.startLinux debian/@install_name@.init; \
914 fi; \
915 echo "Source: samhain" > debian/control; \
916 echo "Section: admin" >> debian/control; \
917 echo "Priority: optional" >> debian/control; \
918 echo "Maintainer: $$maintainer" >> debian/control; \
919 echo "Standards-Version: 3.2.1" >> debian/control; \
920 echo >> debian/control; \
921 echo "Package: @install_name@" >> debian/control; \
922 echo "Architecture: any" >> debian/control; \
923 echo "Depends: libc6" >> debian/control; \
924 echo "Description: File integrity checker" >> debian/control; \
925 echo " A file integrity checker" >> debian/control; \
926 echo "running debuild -us -uc"; \
927 debuild -us -uc -b; \
928 DEBFILE=`find ../ -follow -maxdepth 1 -cnewer ./debian/control 2>/dev/null | grep '@install_name@_$(VERSION)' | grep '\.deb'`; \
929 if test x"$$DEBFILE" = x; then \
930 echo "Error ... cannot find package file"; \
931 exit 1; \
932 else \
933 echo "Package $$DEBFILE built."; \
934 cp $$DEBFILE ./$(PACKAGE)-$(VERSION)-$(BUILD_NUM).deb; \
935 ln -s ./$(PACKAGE)-$(VERSION)-$(BUILD_NUM).deb ./$(PACKAGE)-$(VERSION).deb; \
936 fi; \
937 echo
938
939#
940# Check samhain.spec
941#
942rpmspec-full:
943 @grep 'install-light' samhain.spec >/dev/null 2>&1; \
944 if test x"$$?" = "x0"; then \
945 echo "Your samhain.spec is from rpm-light. Please run"; \
946 echo " .config.status to re-create the original samhain.spec"; \
947 exit 1; \
948 fi
949
950# when editing the spec file, make an additional blank after 'make'
951# to avoid that it matches on a second processing
952#
953rpmspec-light: samhain.spec
954 @echo "Stripping docs from samhain.spec"; \
955 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 s,%attr.*,, > samhain.spec-light; \
956 mv samhain.spec-light samhain.spec
957
958rpm-light: rpmspec-light distrpm
959 rpmbuild -ta ./$(PACKAGE)-$(VERSION).tar.gz;
960 @RPMTOP=`cat ~/.rpmmacros 2>/dev/null | grep '%_topdir' | awk '{ print $$2}'`; \
961 if test x"$$RPMTOP" = x; then RPMTOP=/usr/src; fi; \
962 echo "Searching the RPM package below $$RPMTOP ..."; \
963 RPMFILE=`find $$RPMTOP -follow -maxdepth 4 -cnewer ./samhain.spec 2>/dev/null | grep '@install_name@-$(VERSION)' | grep '\.rpm' | grep -v '\.src\.'`; \
964 echo; \
965 if test x"$$RPMFILE" = x; then \
966 echo "Error ... cannot find package file"; \
967 exit 1; \
968 else \
969 echo "Package $$RPMFILE built."; \
970 echo "Copying it to ./$(PACKAGE)-$(VERSION).rpm"; \
971 cp $$RPMFILE ./$(PACKAGE)-$(VERSION).rpm; \
972 fi; \
973 echo
974
975rpm: rpmspec-full distrpm
976 rpmbuild -ta ./$(PACKAGE)-$(VERSION).tar.gz;
977 @RPMTOP=`cat ~/.rpmmacros 2>/dev/null | grep '%_topdir' | awk '{ print $$2}'`; \
978 if test x"$$RPMTOP" = x; then RPMTOP=/usr/src; fi; \
979 echo "Searching the RPM package below $$RPMTOP ..."; \
980 RPMFILE=`find $$RPMTOP -follow -maxdepth 4 -cnewer ./samhain.spec 2>/dev/null | grep '@install_name@-$(VERSION)' | grep '\.rpm' | grep -v '\.src\.'`; \
981 echo; \
982 if test x"$$RPMFILE" = x; then \
983 echo "Error ... cannot find package file"; \
984 exit 1; \
985 else \
986 echo "Package $$RPMFILE built."; \
987 echo "Copying it to ./$(PACKAGE)-$(VERSION).rpm"; \
988 cp $$RPMFILE ./$(PACKAGE)-$(VERSION).rpm; \
989 fi; \
990 echo
991
992srpm-dist: rpmspec-full samhain.spec
993 @cat samhain.spec | \
994 sed s%\-\-with\-base=.*\,[0123456789]*%% | \
995 sed s%\'\'%% > samhain.spec.m; \
996 mv samhain.spec.m samhain.spec
997 $(MAKE) distrpm
998 rpmbuild -ts ./$(PACKAGE)-$(VERSION).tar.gz
999
1000
1001srpm: rpmspec-full distrpm
1002 rpmbuild -ts ./$(PACKAGE)-$(VERSION).tar.gz
1003
1004solaris-pkg-light: all
1005 @STAGE=/tmp/samhain-pkg-staging; \
1006 mkdir $$STAGE; \
1007 if test x"$$?" != x0; then \
1008 echo "ERROR ... mkdir $$STAGE failed"; \
1009 exit 1; \
1010 fi; \
1011 $(MAKE) DESTDIR=$$STAGE install-light;
1012 $(MAKE) solaris-pkg-finish
1013
1014solaris-pkg: all
1015 @STAGE=/tmp/samhain-pkg-staging; \
1016 mkdir $$STAGE; \
1017 if test x"$$?" != x0; then \
1018 echo "ERROR ... mkdir $$STAGE failed"; \
1019 exit 1; \
1020 fi; \
1021 $(MAKE) DESTDIR=$$STAGE install;
1022 $(MAKE) solaris-pkg-finish
1023
1024solaris-pkg-finish:
1025 @STAGE=/tmp/samhain-pkg-staging; \
1026 $(mkinstalldirs) $$STAGE/etc/init.d; \
1027 $(INSTALL_SHELL) init/samhain.startSolaris $$STAGE/etc/init.d/@install_name@; \
1028 (echo 'i pkginfo'; pkgproto $$STAGE=/ ) >prototype; \
1029 user=`id | sed s,uid=[0123456789]*\(,, | sed s,\).*,,`; \
1030 group=`id | sed s,.*gid=[0123456789]*\(,, | sed s,\).*,,`; \
1031 cat prototype | grep -v 'none / ' | \
1032 sed s,$$user\ $$group,root\ sys,g > prototype.1; \
1033 rm -f prototype.2; \
1034 while read line; do \
1035 echo "$${line}" | egrep '^d none' >/dev/null 2>&1; \
1036 if [ $$? = 0 ]; then \
1037 dir=`echo "$${line}" | awk '{ print $$3 }'`; \
1038 if [ -d "$$dir" ]; then \
1039 echo "d none $${dir} ? ? ?" >> prototype.2; \
1040 else \
1041 echo "$${line}" >> prototype.2; \
1042 fi; \
1043 else \
1044 echo "$${line}" >> prototype.2; \
1045 fi; \
1046 done < prototype.1; \
1047 rm -f prototype && rm prototype.1 && mv prototype.2 prototype; \
1048 echo "d none /etc/rc0.d ? ? ?" >> prototype; \
1049 echo "d none /etc/rc1.d ? ? ?" >> prototype; \
1050 echo "d none /etc/rc3.d ? ? ?" >> prototype; \
1051 echo "l none /etc/rc3.d/S99@install_name@=/etc/init.d/@install_name@" >> prototype; \
1052 echo "l none /etc/rc0.d/K10@install_name@=/etc/init.d/@install_name@" >> prototype; \
1053 echo "l none /etc/rc1.d/K10@install_name@=/etc/init.d/@install_name@" >> prototype; \
1054 ARCH=`uname -p`; \
1055 PSTAMP=`date '+%c%y%m%d%H%M%S'`; \
1056 echo "PKG=@install_name@" > pkginfo; \
1057 echo "NAME=file integrity check" >> pkginfo; \
1058 echo "VERSION=$(VERSION)" >> pkginfo; \
1059 echo "CATEGORY=system" >> pkginfo; \
1060 echo "CLASSES=none" >> pkginfo; \
1061 echo "VENDOR=http://la-samhna.de/samhain" >> pkginfo; \
1062 echo "EMAIL=support@la-samhna.de" >> pkginfo; \
1063 echo "ARCH=$$ARCH" >> pkginfo; \
1064 echo "PSTAMP=$$PSTAMP" >> pkginfo; \
1065 pkgmk -o; \
1066 pkgtrans -s /var/spool/pkg /tmp/samhain-pkg-staging/@install_name@.pkg @install_name@; \
1067 if test -f /tmp/samhain-pkg-staging/@install_name@.pkg; then \
1068 echo; \
1069 cp /tmp/samhain-pkg-staging/@install_name@.pkg $(PACKAGE)-$(VERSION).pkg; \
1070 echo "Package $(PACKAGE)-$(VERSION).pkg is ready for installation"; \
1071 echo "to install, use: pkgadd -n -d $(PACKAGE)-$(VERSION).pkg all"; \
1072 echo; \
1073 rm -rf /var/spool/pkg/@install_name@ /tmp/samhain-pkg-staging; \
1074 else \
1075 echo; \
1076 echo "**************************************************************"; \
1077 echo "Error ... cannot find /tmp/samhain-pkg-staging/@install_name@.pkg."; \
1078 echo "Keeping /var/spool/pkg/@install_name@ /tmp/samhain-pkg-staging"; \
1079 if test -d /var/spool/pkg; then \
1080 echo "**************************************************************"; \
1081 else \
1082 echo "************** /var/spool/pkg is missing *********************"; \
1083 fi; \
1084 echo; \
1085 exit 1; \
1086 fi
1087
1088depot-prep: all
1089 STAGE=/tmp/samhain-pkg-staging; \
1090 mkdir $$STAGE; \
1091 if test x"$$?" != x0; then \
1092 echo "ERROR ... mkdir $$STAGE failed"; \
1093 exit 1; \
1094 fi; \
1095 $(MAKE) DESTDIR=$$STAGE install; \
1096 $(MAKE) DESTDIR=$$STAGE install-boot; \
1097 cp hp_ux.psf $$STAGE; \
1098 mkdir $$STAGE/sc; \
1099 echo "#!/sbin/sh" > $$STAGE/sc/configure; \
1100 echo "PATH=\$$SW_PATH; export PATH" >> $$STAGE/sc/configure; \
1101 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; \
1102 chmod +x $$STAGE/sc/configure; \
1103 echo "#!/sbin/sh" > $$STAGE/sc/unconfigure; \
1104 echo "PATH=\$$SW_PATH; export PATH" >> $$STAGE/sc/unconfigure; \
1105 echo "rm -f /sbin/rc2.d/S900@install_name@; rm -f /sbin/rc1.d/K100@install_name@" >> $$STAGE/sc/unconfigure; \
1106 chmod +x $$STAGE/sc/unconfigure; \
1107 echo "#!/sbin/sh" > $$STAGE/sc/preremove; \
1108 echo "PATH=\$$SW_PATH; export PATH" >> $$STAGE/sc/preremove; \
1109 echo "/sbin/init.d/@install_name@ stop" >> $$STAGE/sc/preremove; \
1110 echo "exit 0" >> $$STAGE/sc/preremove; \
1111 chmod +x $$STAGE/sc/preremove;
1112
1113depot: depot-prep
1114 (cd /tmp/samhain-pkg-staging && /usr/sbin/swpackage -v -s ./hp_ux.psf -x media_type=tape @ $(PACKAGE)-$(VERSION).depot)
1115 cp /tmp/samhain-pkg-staging/$(PACKAGE)-$(VERSION).depot .
1116 rm -rf /tmp/samhain-pkg-staging
1117
1118depot-light: depot
1119
1120#---------------------------------------------------------------
1121
1122
1123trustfile: $(srcsrc)/trustfile.c config.h
1124 $(COMPILE) $(VFLAG) -DSH_IDENT=\"@myident@\" -DTRUST_MAIN -DSL_ALWAYS_TRUSTED=@mytrust@ -o trustfile $(srcsrc)/trustfile.c
1125
1126sh_MK.h: config.h
1127 @echo "creating sh_MK.h"; \
1128 echo "#ifndef SH_MK_H" > sh_MK.h; \
1129 echo "#define SH_MK_H" >> sh_MK.h; \
1130 $(top_srcdir)/c_bits.sh @my_key_1@ MKB >> sh_MK.h; \
1131 $(top_srcdir)/c_bits.sh @my_key_2@ MKA >> sh_MK.h; \
1132 $(top_srcdir)/c_bits.sh @my_key_3@ MKC >> sh_MK.h; \
1133 $(top_srcdir)/c_bits.sh @my_key_4@ MKD >> sh_MK.h; \
1134 echo "#endif" >> sh_MK.h
1135
1136
1137sstrip: $(srcsrc)/sstrip.c Makefile
1138 $(BUILD_CC) -I. -o sstrip $(srcsrc)/sstrip.c
1139
1140encode: $(srcsrc)/encode.c Makefile
1141 $(BUILD_CC) -I. -o encode $(srcsrc)/encode.c
1142
1143config_xor.h: config.h encode
1144 @echo 'encode $(XOR_CODE) config.h'; \
1145 sleep 1; \
1146 ./encode $(XOR_CODE) config.h; \
1147 mv x_config.h config_xor.h
1148
1149#.c.o:
1150# @echo "./encode $(XOR_CODE) $< --> x_`echo $< |sed 's%.*/%%'`"; \
1151# ./encode $(XOR_CODE) $<; \
1152# echo "$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $< |sed 's%.*/%%'`"; \
1153# $(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $< |sed 's%.*/%%'`; \
1154# rm x_`echo $< |sed 's%.*/%%'`
1155
1156$(OBJECTS): encode internal.h
1157 @echo "./encode $(XOR_CODE) $(srcsrc)/`echo $@ |sed 's%\.o$$%%'`.c --> x_`echo $@ |sed 's%\.o$$%%'`.c"; \
1158 ./encode $(XOR_CODE) $(srcsrc)/`echo $@ |sed 's%\.o$$%%'`.c; \
1159 echo "$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $@ |sed 's%\.o$$%%'`.c"; \
1160 $(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $@ |sed 's%\.o$$%%'`.c && \
1161 rm x_`echo $@ |sed 's%\.o$$%%'`.c
1162
1163sh_tiger_i.o: $(srcsrc)/$(TIGER_SRC) Makefile config_xor.h
1164 @echo "$(COMPILE) $(VFLAG) -o sh_tiger_i.o -c $(srcsrc)/$(TIGER_SRC)";\
1165 $(COMPILE) $(VFLAG) -o sh_tiger_i.o -c $(srcsrc)/$(TIGER_SRC);
1166
1167samhain_setpwd: encode config_xor.h $(srcsrc)/samhain_setpwd.c
1168 @echo '$(COMPILE) -o samhain_setpwd $(srcsrc)/samhain_setpwd.c'; \
1169 ./encode $(XOR_CODE) $(srcsrc)/samhain_setpwd.c; \
1170 $(COMPILE) -o samhain_setpwd x_samhain_setpwd.c; \
1171 rm x_samhain_setpwd.c
1172
1173samhain_stealth: encode config_xor.h $(srcsrc)/samhain_stealth.c
1174 @echo '$(COMPILE) -o samhain_stealth $(srcsrc)/samhain_stealth.c'; \
1175 ./encode $(XOR_CODE) $(srcsrc)/samhain_stealth.c; \
1176 $(COMPILE) -o samhain_stealth x_samhain_stealth.c; \
1177 rm x_samhain_stealth.c
1178
1179yulectl: encode config_xor.h $(srcsrc)/yulectl.c
1180 @echo '$(COMPILE) -o yulectl $(srcsrc)/yulectl.c $(LIBS_SOCK)'; \
1181 ./encode $(XOR_CODE) $(srcsrc)/yulectl.c; \
1182 $(COMPILE) -o yulectl x_yulectl.c $(LIBS_SOCK); \
1183 rm x_yulectl.c
1184
1185$(SAMHAIN): internal.h $(OBJECTS) sh_tiger_i.o
1186 @-rm -f $(SAMHAIN)
1187 @echo "$(LINK) sh_tiger_i.o $(OBJECTS) $(LIBS_TRY)"; \
1188 $(LINK) sh_tiger_i.o $(OBJECTS) $(LIBS_TRY)
1189
1190
1191CUTEST_SOURCES = $(srcsrc)/cutest_sh_tools.c \
1192 $(srcsrc)/cutest_sh_utils.c \
1193 $(srcsrc)/cutest_sh_unix.c \
1194 $(srcsrc)/cutest_slib.c \
1195 $(srcsrc)/cutest_zAVLTree.c \
1196 $(srcsrc)/cutest_sh_hash.c \
1197 $(srcsrc)/cutest_sh_tiger0.c
1198
1199CUTEST_OBJECTS = cutest_sh_tools.o \
1200 cutest_sh_utils.o \
1201 cutest_sh_unix.o \
1202 cutest_slib.o \
1203 cutest_zAVLTree.o \
1204 cutest_sh_hash.o \
1205 cutest_sh_tiger0.o
1206
1207$(CUTEST_OBJECTS): $(CUTEST_SOURCES) config_xor.h internal.h
1208 @echo "./encode $(XOR_CODE) $(srcsrc)/`echo $@ |sed 's%\.o$$%%'`.c --> x_`echo $@ |sed 's%\.o$$%%'`.c"; \
1209 ./encode $(XOR_CODE) $(srcsrc)/`echo $@ |sed 's%\.o$$%%'`.c; \
1210 echo "$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $@ |sed 's%\.o$$%%'`.c"; \
1211 $(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $@ |sed 's%\.o$$%%'`.c; \
1212 rm x_`echo $@ |sed 's%\.o$$%%'`.c
1213
1214
1215cutest: $(SOURCES) $(CUTEST_SOURCES)
1216 @$(MAKE) CUTEST='-DSH_CUTEST=1' intcutest
1217
1218$(srcsrc)/CuTestMain.c: $(SOURCES) $(CUTEST_SOURCES) $(srcsrc)/make-tests.sh
1219 cd $(srcsrc)/ && ./make-tests.sh >CuTestMain.c;
1220
1221intcutest: internal.h $(OBJECTS) $(CUTEST_OBJECTS) sh_tiger_i.o $(srcsrc)/CuTestMain.c
1222 @$(COMPILE) -o CuTestMain.o -c $(srcsrc)/CuTestMain.c; \
1223 $(COMPILE) -o CuTest.o -c $(srcsrc)/CuTest.c; \
1224 rm -f samhain.o; \
1225 ./encode $(XOR_CODE) $(srcsrc)/samhain.c; \
1226 $(COMPILE) $(VFLAG) -o samhain.o -c x_samhain.c; \
1227 rm x_samhain.c; \
1228 $(LINK) sh_tiger_i.o $(CUTEST_OBJECTS) CuTestMain.o CuTest.o $(OBJECTS) $(LIBS_TRY); \
1229 test -f ./intcutest && mv ./intcutest ./cutest; \
1230 ./cutest
1231
1232runcutest:
1233 gdb ./cutest
1234
1235samhain_hide.o: $(srcsrc)/samhain_hide.c samhain_erase.o
1236 gcc @lkm_inc@ -I. -Wall -O2 -c $(srcsrc)/samhain_hide.c
1237
1238samhain_erase.o: $(srcsrc)/samhain_erase.c
1239 gcc @lkm_inc@ -I. -Wall -O2 -c $(srcsrc)/samhain_erase.c
1240
1241# -- NEW --
1242samhain_hide.ko: $(srcsrc)/samhain_hide.c
1243 @test -d m_comp || mkdir m_comp; \
1244 echo "KVERSION := \$$(shell uname -r)" > m_comp/Makefile;\
1245 echo "KSOURCE ?= /lib/modules/\$$(KVERSION)/build" >> m_comp/Makefile;\
1246 echo "obj-m := samhain_hide.o" >> m_comp/Makefile;\
1247 echo ".PHONY: modules install clean modules_add" >> m_comp/Makefile;\
1248 echo "install : modules_add" >> m_comp/Makefile;\
1249 echo "modules modules_install clean:" >> m_comp/Makefile;\
1250 echo "T\$$(MAKE) -C \$$(KSOURCE) \$$@ SUBDIRS=\$$(CURDIR) KBUILD_VERBOSE=2" | tr T '\t' >> m_comp/Makefile;\
1251 cp config.h m_comp/; \
1252 cp $(srcsrc)/samhain_hide.c m_comp/; \
1253 cd m_comp && $(MAKE) modules
1254 @if test -f m_comp/samhain_hide.ko; then \
1255 cp -p m_comp/samhain_hide.ko samhain_hide.ko; \
1256 rm -rf m_comp/; \
1257 else \
1258 echo "Kernel module samhain_hide.ko not build"; \
1259 exit 1; \
1260 fi
1261
1262# -- NEW --
1263samhain_kmem.ko: $(srcsrc)/samhain_kmem.c
1264 @test -d m_comp || mkdir m_comp; \
1265 echo "KVERSION := \$$(shell uname -r)" > m_comp/Makefile;\
1266 echo "KSOURCE ?= /lib/modules/\$$(KVERSION)/build" >> m_comp/Makefile;\
1267 echo "obj-m := @install_name@_kmem.o" >> m_comp/Makefile;\
1268 echo ".PHONY: modules install clean modules_add" >> m_comp/Makefile;\
1269 echo "install : modules_add" >> m_comp/Makefile;\
1270 echo "modules modules_install clean:" >> m_comp/Makefile;\
1271 echo "T\$$(MAKE) -C \$$(KSOURCE) \$$@ SUBDIRS=\$$(CURDIR) KBUILD_VERBOSE=2" | tr T '\t' >> m_comp/Makefile;\
1272 cp config.h m_comp/; \
1273 cp $(srcsrc)/samhain_kmem.c m_comp/@install_name@_kmem.c; \
1274 cd m_comp && $(MAKE) modules
1275 @if test -f m_comp/@install_name@_kmem.ko; then \
1276 cp -p m_comp/@install_name@_kmem.ko samhain_kmem.ko; \
1277 rm -rf m_comp/; \
1278 else \
1279 echo "Kernel module samhain_kmem.ko not build"; \
1280 exit 1; \
1281 fi
1282
1283
1284# -- NEW --
1285lkm: @sh_lkm@
1286
1287
1288
1289# For kernel syscall monitoring
1290kern_head: Makefile $(top_srcdir)/include/kern_head.h $(srcsrc)/kern_head.c
1291 @echo "$(BUILD_CC) -I. -I./include -DSYSTEMMAP=\"@systemmap@\" -o kern_head $(srcsrc)/kern_head.c $(LIBS_KVM)"; \
1292 $(BUILD_CC) -I. -I./include -DSYSTEMMAP=\"@systemmap@\" -o kern_head $(srcsrc)/kern_head.c $(LIBS_KVM)
1293
1294sh_ks.h: kern_head
1295 @sleep 1; \
1296 ./kern_head > sh_ks.h
1297
1298sh_ks_xor.h: encode sh_ks.h
1299 @echo 'encode $(XOR_CODE) sh_ks.h'; \
1300 sleep 1; \
1301 ./encode $(XOR_CODE) sh_ks.h; \
1302 mv x_sh_ks.h sh_ks_xor.h
1303
1304# For bignum
1305internal.h: mkhdr
1306 @sleep 1; \
1307 ./mkhdr
1308
1309bignum.o: internal.h
1310
1311
1312# If your compiler can't handle long identifiers (> 6 chars), move the `#' to
1313# the other line.
1314
1315mkhdr: $(srcsrc)/mkhdr.c config.h
1316 @echo "$(BUILD_CC) -I. -o mkhdr $(srcsrc)/mkhdr.c"; \
1317 sleep 1; \
1318 $(BUILD_CC) -I. -o mkhdr $(srcsrc)/mkhdr.c
1319
1320# $(COMPILE) -DBIG_SHORT_NAMES -o mkhdr $(srcdir)/mkhdr.c
1321
1322#----------------------------------------------------------
1323#
1324# EXE PACKER rules
1325#
1326#----------------------------------------------------------
1327
1328minilzo.o: $(srcsrc)/minilzo.c $(srcinc)/lzoconf.h $(srcinc)/minilzo.h config.h
1329 @echo "$(COMPILE) -DMINILZO_HAVE_CONFIG_H -o minilzo.o -c $(srcsrc)/minilzo.c"; \
1330 $(COMPILE) -DMINILZO_HAVE_CONFIG_H -o minilzo.o -c $(srcsrc)/minilzo.c
1331
1332exepack_mkdata: $(srcsrc)/exepack_mkdata.c $(srcinc)/lzoconf.h $(srcinc)/minilzo.h minilzo.o
1333 @echo "$(COMPILE) -o exepack_mkdata.o -c $(srcsrc)/exepack_mkdata.c"; \
1334 $(COMPILE) -o exepack_mkdata.o -c $(srcsrc)/exepack_mkdata.c; \
1335 echo "$(LINK) exepack_mkdata.o minilzo.o"; \
1336 $(LINK) exepack_mkdata.o minilzo.o
1337
1338#
1339# prepare the data to be packed
1340#
1341exepack.data: $(SAMHAIN) exepack_mkdata sstrip
1342 @echo "cp ./$(SAMHAIN) ./samhain.pk.data"; \
1343 cp ./$(SAMHAIN) ./samhain.pk.data; \
1344 echo "strip ./samhain.pk.data"; \
1345 strip ./samhain.pk.data > /dev/null 2>&1 || echo "... is already stripped"; \
1346 echo "./sstrip ./samhain.pk.data"; \
1347 ./sstrip ./samhain.pk.data > /dev/null 2>&1 || echo "sstrip returned false"; \
1348 echo "./exepack_mkdata ./samhain.pk.data ./exepack.data 0"; \
1349 ./exepack_mkdata ./samhain.pk.data ./exepack.data 0; \
1350 echo "rm -f ./samhain.pk.data"; \
1351 rm -f ./samhain.pk.data;
1352
1353exepack: $(srcsrc)/exepack.c minilzo.o exepack.data
1354 @echo "$(COMPILE) -o exepack.o -c $(srcsrc)/exepack.c"; \
1355 $(COMPILE) -o exepack.o -c $(srcsrc)/exepack.c; \
1356 echo "$(LINK) exepack.o minilzo.o"; \
1357 $(LINK) exepack.o minilzo.o;
1358
1359#
1360# this program fills the data section with the binary
1361#
1362exepack_fill: $(srcsrc)/exepack_fill.c minilzo.o exepack
1363 @echo "$(COMPILE) -o exepack_fill.o -c $(srcsrc)/exepack_fill.c"; \
1364 $(COMPILE) -o exepack_fill.o -c $(srcsrc)/exepack_fill.c; \
1365 echo "$(LINK) exepack_fill.o minilzo.o"; \
1366 $(LINK) exepack_fill.o minilzo.o
1367
1368samhain.pk: $(SAMHAIN) exepack exepack_fill sstrip
1369 @echo "cp ./$(SAMHAIN) ./samhain.pk.data"; \
1370 cp ./$(SAMHAIN) ./samhain.pk.data; \
1371 echo "strip ./samhain.pk.data"; \
1372 strip ./samhain.pk.data > /dev/null 2>&1 || echo "... is already stripped"; \
1373 echo "./sstrip ./samhain.pk.data"; \
1374 ./sstrip ./samhain.pk.data > /dev/null 2>&1 || echo "sstrip returned false"; \
1375 test -f exepack.out && rm exepack.out; \
1376 echo "./exepack_fill exepack samhain.pk.data exepack.out"; \
1377 ./exepack_fill exepack samhain.pk.data exepack.out; \
1378 chmod +x exepack.out; \
1379 echo "strip exepack.out"; \
1380 strip exepack.out > /dev/null 2>&1 || echo "... is already stripped"; \
1381 ./sstrip exepack.out > /dev/null 2>&1 || echo "sstrip returned false"; \
1382 echo "mv exepack.out samhain.pk"; \
1383 rm -f samhain.pk; mv exepack.out samhain.pk
1384
1385samhain-packed: $(SAMHAIN) samhain_setpwd
1386 @echo "samhain_setpwd samhain new $(CLIENTPASSWD)"; \
1387 samhain_setpwd samhain new $(CLIENTPASSWD); \
1388 echo "rm -f samhain; mv samhain.new samhain"; \
1389 rm -f samhain; mv samhain.new samhain; \
1390 $(MAKE) samhain.pk; \
1391 echo "rm -f samhain; mv samhain.pk samhain"; \
1392 rm -f samhain; mv samhain.pk samhain
1393
1394#----------------------------------------------------------
1395#
1396# DEPLOY rules
1397#
1398#----------------------------------------------------------
1399
1400uninstall-deploy:
1401 rm -rf $(mydatadir)/profiles/source
1402 rm -rf $(mydatadir)/profiles/archpkg
1403 rm -rf $(mydatadir)/profiles/libexec
1404 rm -rf $(mydatadir)/profiles/tmp
1405 rm -rf $(mydatadir)/profiles/private
1406 @if test -f $(sbindir)/deploy.sh; then \
1407 old_deploy=`grep 'VERSION2' $(sbindir)/deploy.sh >/dev/null 2>&1 || echo old`; \
1408 if test x"$$old_deploy" = xold; then \
1409 echo "rm -f $(sbindir)/deploy2.sh"; \
1410 rm -f $(sbindir)/deploy2.sh; \
1411 else \
1412 echo "rm -f $(sbindir)/deploy.sh"; \
1413 rm -f $(sbindir)/deploy.sh; \
1414 fi; \
1415 fi
1416
1417EXECFILES= comCHECKSRC comDOWNLOAD comBUILD comCLEAN comINSTALL \
1418 funcDIALOG funcEXE funcPRINT funcSETUP funcBUILD funcINSTALL \
1419 funcDB comUNINSTALL \
1420 preinstall postinstall initscript
1421
1422# $(mydatadir)/profiles/
1423# |
1424# |
1425# |-- source -------------> (tarballs)
1426# |
1427# |-- configs ------------> (default configs)
1428# |
1429# |-- archpkg
1430# | |
1431# | |-- architecture -> (package, setup script)
1432# |
1433# |-- hosts
1434# | |
1435# | |-- hostname -----> (config)
1436# |
1437# |-- libexec ------------> (scripts)
1438# |
1439# |-- private ------------> (gpg key)
1440# |
1441# |-- tmp
1442#
1443install-deploy: deploy.sh samhain_stealth
1444 @echo "Creating directory tree under $(mydatadir)/profiles/"; \
1445 $(mkinstalldirs) $(sbindir); \
1446 $(mkinstalldirs) $(mydatadir)/profiles/source; \
1447 $(mkinstalldirs) $(mydatadir)/profiles/configs; \
1448 $(mkinstalldirs) $(mydatadir)/profiles/archpkg/debian_i386; \
1449 $(mkinstalldirs) $(mydatadir)/profiles/archpkg/gentoo_i386; \
1450 $(mkinstalldirs) $(mydatadir)/profiles/archpkg/redhat_i386; \
1451 $(mkinstalldirs) $(mydatadir)/profiles/archpkg/linux_i386; \
1452 $(mkinstalldirs) $(mydatadir)/profiles/archpkg/freebsd_i386;\
1453 $(mkinstalldirs) $(mydatadir)/profiles/archpkg/solaris; \
1454 $(mkinstalldirs) $(mydatadir)/profiles/archpkg/aix; \
1455 $(mkinstalldirs) $(mydatadir)/profiles/hosts; \
1456 $(mkinstalldirs) $(mydatadir)/profiles/libexec; \
1457 $(mkinstalldirs) $(mydatadir)/profiles/private; \
1458 $(mkinstalldirs) $(mydatadir)/profiles/tmp; \
1459 if test -f $(srcdir)/../$(PACKAGE)-$(VERSION).tar.gz.asc; then \
1460 if test -f $(srcdir)/../$(PACKAGE)-$(VERSION).tar.gz; then \
1461 echo "Installing source tarball"; \
1462 $(INSTALL_DATA) $(srcdir)/../$(PACKAGE)-$(VERSION).tar.gz.asc \
1463 $(mydatadir)/profiles/source/$(PACKAGE)-$(VERSION).tar.gz.asc; \
1464 $(INSTALL_DATA) $(srcdir)/../$(PACKAGE)-$(VERSION).tar.gz \
1465 $(mydatadir)/profiles/source/$(PACKAGE)-$(VERSION).tar.gz; \
1466 fi; \
1467 fi; \
1468 echo "Installing default configs"; \
1469 test -f $(mydatadir)/profiles/configs/freebsd_i386.samhainrc || \
1470 $(INSTALL_DATA) $(srcdir)/samhainrc.freebsd \
1471 $(mydatadir)/profiles/configs/freebsd_i386.samhainrc; \
1472 test -f $(mydatadir)/profiles/configs/debian_i386.samhainrc || \
1473 $(INSTALL_DATA) $(srcdir)/samhainrc.linux \
1474 $(mydatadir)/profiles/configs/debian_i386.samhainrc; \
1475 test -f $(mydatadir)/profiles/configs/gentoo_i386.samhainrc || \
1476 $(INSTALL_DATA) $(srcdir)/samhainrc.linux \
1477 $(mydatadir)/profiles/configs/gentoo_i386.samhainrc; \
1478 test -f $(mydatadir)/profiles/configs/redhat_i386.samhainrc || \
1479 $(INSTALL_DATA) $(srcdir)/samhainrc.linux \
1480 $(mydatadir)/profiles/configs/redhat_i386.samhainrc; \
1481 test -f $(mydatadir)/profiles/configs/linux_i386.samhainrc || \
1482 $(INSTALL_DATA) $(srcdir)/samhainrc.linux \
1483 $(mydatadir)/profiles/configs/linux_i386.samhainrc; \
1484 test -f $(mydatadir)/profiles/configs/solaris.samhainrc || \
1485 $(INSTALL_DATA) $(srcdir)/samhainrc.solaris \
1486 $(mydatadir)/profiles/configs/solaris.samhainrc; \
1487 test -f $(mydatadir)/profiles/configs/aix.samhainrc || \
1488 $(INSTALL_DATA) $(srcdir)/samhainrc.aix5.2.0 \
1489 $(mydatadir)/profiles/configs/aix.samhainrc; \
1490 if test -f $(mydatadir)/profiles/configs/generic.configure; then \
1491 :; \
1492 else \
1493 SH_FQDN_SYSTEM=`uname -n`; \
1494 SH_FQDN_DOMAIN=`grep -i domain /etc/resolv.conf |grep -v "\#" |awk '{print $$2}' |head -1`; \
1495 if test -n "$${SH_FQDN_SYSTEM}" -a -n "$${SH_FQDN_DOMAIN}"; then \
1496 sh_thishost="$${SH_FQDN_SYSTEM}.$${SH_FQDN_DOMAIN}"; \
1497 else \
1498 sh_thishost="FQDN_MISSING"; \
1499 fi; \
1500 outfile=$(mydatadir)/profiles/configs/generic.configure; \
1501 echo "'--enable-network=client'" > $$outfile; \
1502 echo "'--with-logserver=$${sh_thishost}'" >> $$outfile; \
1503 echo "'--with-data-file=REQ_FROM_SERVER/var/lib/samhain/samhain_file'" >> $$outfile; \
1504 echo "'--with-config-file=REQ_FROM_SERVER/etc/samhainrc'" >> $$outfile; \
1505 echo "'--enable-base=@mykeybase@'" >> $$outfile; \
1506 fi; \
1507 $(INSTALL_SHELL) $(srcdir)/mkinstalldirs \
1508 $(mydatadir)/profiles/libexec; \
1509 $(INSTALL_SHELL) $(srcdir)/install-sh \
1510 $(mydatadir)/profiles/libexec; \
1511 for ff in $(EXECFILES); do \
1512 test -f $(srcdir)/dsys/$$ff && $(INSTALL_SHELL) $(srcdir)/dsys/$$ff \
1513 $(mydatadir)/profiles/libexec; \
1514 done; \
1515 $(INSTALL_SHELL) samhain_stealth $(mydatadir)/profiles/libexec; \
1516 test -f $(srcdir)/dsys/0F571F6C.asc && $(INSTALL_DATA) $(srcdir)/dsys/0F571F6C.asc \
1517 $(mydatadir)/profiles/private; \
1518 convert +compress $(srcdir)/stealth_template.jpg stealth_template.ps >/dev/null || \
1519 { 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 "*"; }; \
1520 if test -f stealth_template.ps; then \
1521 if test -f $(mydatadir)/profiles/private/stealth_template.ps; then \
1522 :; \
1523 else \
1524 $(INSTALL_DATA) stealth_template.ps $(mydatadir)/profiles/private; \
1525 fi; \
1526 fi; \
1527 if test -f $(sbindir)/deploy.sh; then \
1528 old_deploy=`grep 'VERSION2' $(sbindir)/deploy.sh >/dev/null 2>&1 || echo old`; \
1529 if test x"$$old_deploy" = xold; then \
1530 echo "*"; echo "* Version 1 of deploy.sh found"; echo "*"; \
1531 echo "* Installing $(sbindir)/deploy2.sh"; echo "*"; \
1532 $(INSTALL_SHELL) deploy.sh $(sbindir)/deploy2.sh; \
1533 else \
1534 echo "Installing $(sbindir)/deploy.sh"; \
1535 $(INSTALL_SHELL) deploy.sh $(sbindir)/deploy.sh; \
1536 fi; \
1537 else \
1538 echo "Installing $(sbindir)/deploy.sh"; \
1539 $(INSTALL_SHELL) deploy.sh $(sbindir)/deploy.sh; \
1540 fi
1541
1542
1543#----------------------------------------------------------
1544#
1545# DISTRIBUTION rules
1546#
1547#----------------------------------------------------------
1548
1549distdir = $(PACKAGE)-$(VERSION)
1550top_distdir = $(distdir)
1551
1552# This target untars the dist file and tries a VPATH configuration. Then
1553# it guarantees that the distribution is self-contained by making another
1554# tarfile.
1555
1556#
1557# 1) make distribution tarfile
1558# 2) unpack the tarfile into distdir
1559# 3) create build and install directories
1560# 4) do the build in the build dir, with sources from distdir
1561# 5) check (there are no subdirs, thus does nothing)
1562# 6) install
1563# 7) installcheck (equal to check, does nothing)
1564#
1565distcheck: dist
1566 -rm -rf $(distdir)
1567 GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
1568 mkdir $(distdir)/=build
1569 mkdir $(distdir)/=inst
1570 dc_install_base=`cd $(distdir)/=inst && pwd`; \
1571 cd $(distdir)/=build \
1572 && ../configure --srcdir=.. --prefix=$$dc_install_base \
1573 && $(MAKE) \
1574 && $(MAKE) install
1575 -rm -rf $(distdir)
1576 -rm -f $(distdir).tar.gz.asc
1577 @gpg -a --detach-sign $(distdir).tar.gz; \
1578 $(TAR) chof $(distdir).tar $(distdir).tar.gz $(distdir).tar.gz.asc; \
1579 rm -f $(distdir).tar.gz; \
1580 rm -f $(distdir).tar.gz.asc; \
1581 gzip --best $(distdir).tar
1582 mv $(distdir).tar.gz $(PACKAGE)_signed-$(VERSION).tar.gz
1583 @echo "========================"; \
1584 echo "$(PACKAGE)_signed-$(VERSION).tar.gz is ready for distribution"; \
1585 echo "========================"
1586
1587#
1588# create a tarfile for the distibution
1589#
1590distrpm: distdirrpm
1591 -chmod -R a+r $(distdir)
1592 -rm -rf $(distdir).tar.gz
1593 -rm -rf $(distdir).tar
1594 $(TAR) chof $(distdir).tar $(distdir)
1595 gzip -c --best $(distdir).tar > $(distdir).tar.gz
1596 -rm -rf $(distdir)
1597
1598dist: distdir
1599 -chmod -R a+r $(distdir)
1600 -rm -rf $(distdir).tar.gz
1601 -rm -rf $(distdir).tar
1602 $(TAR) chof $(distdir).tar $(distdir)
1603 gzip -c --best $(distdir).tar > $(distdir).tar.gz
1604 -rm -rf $(distdir)
1605
1606#
1607# create a tarfile for the distibution
1608#
1609dist-sign: distdir
1610 -rm -f $(distdir)/scripts/samhain.ebuild
1611 -rm -f $(distdir)/scripts/samhain.ebuild-light
1612 -chmod -R a+r $(distdir)
1613 -rm -rf $(distdir).tar.gz
1614 -rm -rf $(distdir).tar
1615 $(TAR) chof $(distdir).tar $(distdir)
1616 gzip --best $(distdir).tar
1617 -rm -rf $(distdir)
1618 -rm -f $(distdir).tar.gz.asc
1619 gpg -a --detach-sign $(distdir).tar.gz
1620 $(TAR) chof $(distdir).tar $(distdir).tar.gz $(distdir).tar.gz.asc
1621 -rm -f $(distdir).tar.gz
1622 -rm -f $(distdir).tar.gz.asc
1623 gzip --best $(distdir).tar
1624 mv $(distdir).tar.gz $(PACKAGE)_signed-$(VERSION).tar.gz
1625
1626
1627#
1628# same as dist
1629#
1630dist-all: distdir
1631 -chmod -R a+r $(distdir)
1632 GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
1633 -rm -rf $(distdir)
1634
1635#
1636# create distribution directory and copy files into it
1637#
1638INITFILES=samhain.startIRIX samhain.startFreeBSD samhain.startSolaris \
1639samhain.startLSB samhain.startGentoo samhain.startLinux samhain.startHPUX \
1640samhain.startIRIX samhain.startMACOSX
1641
1642SCRIPTFILES=redhat_i386.client.spec check_samhain.pl samhainadmin.pl logrotate \
1643yuleadmin.pl samhain.ebuild samhain.ebuild-light samhain.spec
1644
1645distdir: distfilecheck
1646 -rm -f $(top_srcdir)/init/*~
1647 -rm -f $(top_srcdir)/sql_init/*~
1648 -rm -f $(top_srcdir)/dsys/*~
1649 -rm -f $(top_srcdir)/docs/*~
1650 -rm -f $(top_srcdir)/include/*~
1651 -rm -f $(top_srcdir)/src/*~
1652 -rm -f $(top_srcdir)/test/*~
1653 -rm -f $(top_srcdir)/scripts/*~
1654 (cd $(top_srcdir)/init && rm -f $(INITFILES))
1655 (cd $(top_srcdir)/scripts && rm -f $(SCRIPTFILES))
1656 -rm -rf $(distdir)
1657 mkdir $(distdir)
1658 -chmod 777 $(distdir)
1659 @for file in $(DISTFILES); do \
1660 d=$(top_srcdir); \
1661 if test -f $$d/$$file || test -d $$d/$$file; then \
1662 cp -pr $$d/$$file $(distdir)/$$file; \
1663 fi; \
1664 done; \
1665 cp scripts/samhain.spec $(distdir)/samhain.spec; \
1666 rm -f $(distdir)/scripts/*.spec
1667
1668#
1669# as distdir, but don't copy spec file from scripts
1670#
1671distdirrpm: distfilecheck
1672 -rm -rf $(distdir)
1673 mkdir $(distdir)
1674 -chmod 777 $(distdir)
1675 @if test -f ./samhain.spec; then \
1676 :; \
1677 else \
1678 echo "Error: ./samhain.spec not found, please run configure"; \
1679 exit 1; \
1680 fi
1681 @cp -p samhain.spec $(distdir)/samhain.spec; \
1682 for file in $(DISTFILES); do \
1683 d=$(top_srcdir); \
1684 if test -f $$d/$$file || test -d $$d/$$file; then \
1685 if test x"$$file" = "xsamhain.spec"; then \
1686 :; \
1687 else \
1688 cp -pr $$d/$$file $(distdir)/$$file; \
1689 fi; \
1690 fi; \
1691 done; \
1692 rm -f $(distdir)/scripts/*.spec
1693
1694
1695distfilecheck: $(top_srcdir)/config.h.in $(top_srcdir)/depend.sum
1696 @for file in $(DISTFILES); do \
1697 d=$(top_srcdir); \
1698 if test -f $$d/$$file || test -d $$d/$$file; then \
1699 : \
1700 else \
1701 echo "File not found: $$d/$$file"; \
1702 fi; \
1703 done
1704 @for file in $(SOURCES); do \
1705 if test -f $$file; then \
1706 : \
1707 else \
1708 echo "File not found: $$file"; \
1709 fi; \
1710 done
1711
1712
1713# DO NOT DELETE THIS LINE
1714
1715
1716samhain.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
1717sh_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
1718sh_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
1719sh_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
1720sh_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
1721sh_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
1722sh_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
1723sh_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
1724sh_tiger1.o: $(srcsrc)/sh_tiger1.c Makefile config_xor.h
1725sh_tiger2.o: $(srcsrc)/sh_tiger2.c Makefile config_xor.h
1726sh_tiger1_64.o: $(srcsrc)/sh_tiger1_64.c Makefile config_xor.h
1727sh_tiger2_64.o: $(srcsrc)/sh_tiger2_64.c Makefile config_xor.h
1728sh_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
1729sh_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
1730sh_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
1731sh_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
1732sh_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
1733sh_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
1734sh_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
1735sh_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
1736sh_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
1737sh_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
1738sh_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
1739sh_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
1740sh_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
1741sh_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
1742sh_cat.o: $(srcsrc)/sh_cat.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_cat.h
1743sh_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
1744sh_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
1745sh_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
1746sh_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
1747sh_err_console.o: $(srcsrc)/sh_err_console.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h
1748sh_err_syslog.o: $(srcsrc)/sh_err_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h
1749sh_schedule.o: $(srcsrc)/sh_schedule.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_schedule.h
1750bignum.o: $(srcsrc)/bignum.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/bignum.h
1751mkhdr.o: $(srcsrc)/mkhdr.c Makefile config.h
1752samhain_setpwd.o: $(srcsrc)/samhain_setpwd.c Makefile config_xor.h
1753samhain_stealth.o: $(srcsrc)/samhain_stealth.c Makefile config_xor.h
1754encode.o: $(srcsrc)/encode.c Makefile
1755sstrip.o: $(srcsrc)/sstrip.c Makefile config.h
1756trustfile.o: $(srcsrc)/trustfile.c Makefile config_xor.h $(srcinc)/sh_calls.h $(srcinc)/slib.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h
1757exepack.o: $(srcsrc)/exepack.c Makefile config.h $(srcinc)/minilzo.h $(srcinc)/exepack.data
1758exepack_fill.o: $(srcsrc)/exepack_fill.c Makefile config.h config.h $(srcinc)/minilzo.h
1759exepack_mkdata.o: $(srcsrc)/exepack_mkdata.c Makefile config.h $(srcinc)/minilzo.h
1760minilzo.o: $(srcsrc)/minilzo.c Makefile $(srcinc)/minilzo.h
1761slib.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
1762rijndael-alg-fst.o: $(srcsrc)/rijndael-alg-fst.c Makefile config_xor.h $(srcinc)/rijndael-alg-fst.h $(srcinc)/rijndael-boxes-fst.h
1763rijndael-api-fst.o: $(srcsrc)/rijndael-api-fst.c Makefile config_xor.h $(srcinc)/rijndael-api-fst.h
1764zAVLTree.o: $(srcsrc)/zAVLTree.c Makefile $(srcinc)/zAVLTree.h
1765sh_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
1766sh_ignore.o: $(srcsrc)/sh_ignore.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/CuTest.h
1767yulectl.o: $(srcsrc)/yulectl.c Makefile config_xor.h
1768sh_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
1769sh_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
1770sh_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
1771kern_head.o: $(srcsrc)/kern_head.c Makefile config.h $(srcinc)/kern_head.h $(srcinc)/kern_head.h
1772sh_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
1773sh_static.o: $(srcsrc)/sh_static.c Makefile config_xor.h $(srcinc)/sh_pthread.h
1774sh_async.o: $(srcsrc)/sh_async.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_calls.h $(srcinc)/sh_error.h
1775sh_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
1776sh_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
1777sh_pthread.o: $(srcsrc)/sh_pthread.c Makefile config_xor.h $(srcinc)/sh_pthread.h $(srcinc)/sh_calls.h $(srcinc)/sh_modules.h
1778sh_string.o: $(srcsrc)/sh_string.c Makefile config_xor.h $(srcinc)/sh_string.h $(srcinc)/sh_mem.h $(srcinc)/CuTest.h
1779dnmalloc.o: $(srcsrc)/dnmalloc.c Makefile config.h
1780t-test1.o: $(srcsrc)/t-test1.c Makefile config.h $(srcinc)/malloc.h
1781sh_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
1782sh_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
1783sh_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
1784sh_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
1785sh_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
1786sh_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
1787sh_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
1788sh_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
1789sh_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
1790sh_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
1791sh_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
1792sh_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
1793sh_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
1794sh_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
1795sh_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
1796sh_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
1797sh_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
1798sh_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
1799sh_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
1800sh_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
1801sh_sub.o: $(srcsrc)/sh_sub.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h
1802sh_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.