source: trunk/Makefile.in @ 125

Last change on this file since 125 was 125, checked in by rainer, 12 years ago

Fix for ticket #80 ('make deb' fails with --with-config-file).

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