source: trunk/Makefile.in@ 273

Last change on this file since 273 was 272, checked in by katerina, 15 years ago

Fixes tickets #190, #191, #192, #193, and #194.

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