source: trunk/Makefile.in@ 291

Last change on this file since 291 was 290, checked in by katerina, 14 years ago

Fixes for tickets #215, #216, #217, #218, version bumped to 2.7.2

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