source: trunk/Makefile.in @ 215

Last change on this file since 215 was 215, checked in by katerina, 13 years ago

Consolidate filtering code (ticket #142) and match on regular expressions (ticket #143).

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