source: trunk/Makefile.in@ 305

Last change on this file since 305 was 302, checked in by katerina, 14 years ago

Fix for ticket #224 (make install doesn't create user-defined tmp directory).

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