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