source: trunk/Makefile.in@ 298

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

Fix for minor issue with IPv6 in port check.

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