-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.in
1703 lines (1512 loc) · 76.8 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
# Copyright Rainer Wichmann (2006)
#
# License Information:
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# --- boiler-plate stuff ---
#
SHELL = /bin/sh
srcdir = @srcdir@
srcsrc = @srcdir@/src
srcinc = @srcdir@/include
top_srcdir = @top_srcdir@
# Don't use VPATH - it's a portability mess
#
# VPATH = $(top_srcdir)/src
prefix = @prefix@
exec_prefix = @exec_prefix@
sbindir = @sbindir@
sysconfdir = @sysconfdir@
localstatedir = @localstatedir@
mandir = @mandir@
datarootdir = @datarootdir@
mytmpdir = @mytmpdir@
configfile = @myconffile@
mydatafile = @mydatafile@
mylockfile = @mylockfile@
mylogfile = @mylogfile@
mydatadir = @mydataroot@
mylogdir = @mylogdir@
mylockdir = @mylockdir@
selectconfig = @selectconfig@
top_builddir = .
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL@ -s -m 700
INSTALL_SHELL = @INSTALL@ -m 700
INSTALL_DATA = @INSTALL@ -m 600
INSTALL_MAN = @INSTALL@ -m 644
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_NAME = @install_name@
INSTALL_DSYS = @INSTALL@ -m 755
PACKAGE = @PACKAGE@
VERSION = @VERSION@
BUILD_NUM = 1
DEFAULT_MAINTAINER = Nobody Nowhere <[email protected]>
VFLAG = @mytclient@
SETPWD = @setpwd_prg@
STEGIN = @stegin_prg@
SAMHAIN = @sh_main_prg@
YULECTL = @yulectl_prg@
SADMIN = @samhainadmin_prg@
XOR_CODE = @xor_code@
TIGER_SRC = @tiger_src@
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CC = @CC@
BUILD_CC = @BUILD_CC@
# DBGDEF = -pg -DSH_PROFILE=1
DBGDEF = @mydebugdef@
DEFS = $(DBGDEF) @DEFS@ -I. -I$(top_srcdir)/include
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS_TRY = @LIBS@
LIBS_SOCK = @sh_libsocket@
LIBS_KVM = @sh_libkvm@
CFLAGS = @CFLAGS@
CUTEST =
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(CUTEST)
LINK = $(CC) $(DBGDEF) -O $(LDFLAGS) -o $@
DESTDIR =
TAR = tar
GZIP = --best
# For creating a packed client
#
CLIENTPASSWD =
.SUFFIXES: # Delete the default suffixes
#
# --- Files -------
#
HEADERS = samhain.h sh_unix.h sh_utils.h sh_error.h sh_error_min.h sh_files.h \
sh_getopt.h sh_readconf.h sh_tiger.h sh_hash.h \
sh_mail.h sh_mail_int.h sh_nmail.h sh_filter.h \
sh_mem.h sh_entropy.h sh_xfer.h sh_modules.h sh_utmp.h \
sh_suidchk.h sh_srp.h sh_fifo.h sh_html.h sh_tools.h \
sh_gpg.h sh_cat.h sh_calls.h sh_extern.h sh_database.h sh_trace.h \
sh_schedule.h bignum.h trustfile.h slib.h zAVLTree.h \
lzoconf.h minilzo.h rijndael-alg-fst.h rijndael-api-fst.h \
rijndael-boxes-fst.h sh_socket.h sh_ignore.h sh_prelude.h \
sh_mounts.h sh_userfiles.h sh_static.h sh_prelink.h \
sh_processcheck.h sh_portcheck.h sh_pthread.h sh_string.h \
sh_log_check.h sh_log_evalrule.h sh_log_correlate.h \
sh_log_mark.h sh_log_repeat.h sh_inotify.h sh_registry.h sh_ipvx.h \
sh_restrict.h sh_sub.h sh_fInotify.h sh_checksum.h \
sh_dbIO.h sh_dbIO_int.h sh_guid.h sh_dbCheck.h sh_dbCreate.h \
sh_sem.h
SOURCES = $(srcsrc)/samhain.c $(srcsrc)/sh_unix.c \
$(srcsrc)/sh_utils.c $(srcsrc)/sh_error.c \
$(srcsrc)/sh_files.c $(srcsrc)/sh_getopt.c \
$(srcsrc)/sh_readconf.c $(srcsrc)/sh_tiger0.c \
$(srcsrc)/sh_tiger1.c $(srcsrc)/sh_tiger2.c \
$(srcsrc)/sh_tiger1_64.c $(srcsrc)/sh_tiger2_64.c \
$(srcsrc)/sh_hash.c $(srcsrc)/sh_mail.c $(srcsrc)/sh_nmail.c \
$(srcsrc)/sh_mem.c $(srcsrc)/sh_entropy.c \
$(srcsrc)/sh_xfer_client.c $(srcsrc)/sh_xfer_server.c \
$(srcsrc)/sh_xfer_syslog.c $(srcsrc)/sh_modules.c \
$(srcsrc)/sh_utmp.c $(srcsrc)/sh_login_track.c \
$(srcsrc)/sh_suidchk.c $(srcsrc)/sh_srp.c \
$(srcsrc)/sh_fifo.c $(srcsrc)/sh_tools.c \
$(srcsrc)/sh_html.c $(srcsrc)/sh_gpg.c \
$(srcsrc)/sh_cat.c $(srcsrc)/sh_calls.c \
$(srcsrc)/sh_extern.c $(srcsrc)/sh_database.c \
$(srcsrc)/sh_err_log.c $(srcsrc)/sh_err_console.c \
$(srcsrc)/sh_err_syslog.c $(srcsrc)/sh_schedule.c \
$(srcsrc)/bignum.c $(srcsrc)/mkhdr.c \
$(srcsrc)/samhain_setpwd.c $(srcsrc)/samhain_stealth.c \
$(srcsrc)/encode.c $(srcsrc)/sstrip.c \
$(srcsrc)/trustfile.c $(srcsrc)/exepack.c \
$(srcsrc)/exepack_fill.c $(srcsrc)/exepack_mkdata.c \
$(srcsrc)/minilzo.c $(srcsrc)/slib.c \
$(srcsrc)/rijndael-alg-fst.c $(srcsrc)/rijndael-api-fst.c \
$(srcsrc)/zAVLTree.c $(srcsrc)/bignum.c \
$(srcsrc)/sh_socket.c $(srcsrc)/sh_ignore.c \
$(srcsrc)/yulectl.c $(srcsrc)/sh_mounts.c \
$(srcsrc)/sh_userfiles.c $(srcsrc)/sh_prelude.c \
$(srcsrc)/sh_prelink.c $(srcsrc)/sh_static.c \
$(srcsrc)/sh_portcheck.c $(srcsrc)/sh_port2proc.c\
$(srcsrc)/sh_processcheck.c $(srcsrc)/sh_filter.c \
$(srcsrc)/sh_pthread.c $(srcsrc)/sh_string.c \
$(srcsrc)/sh_log_parse_syslog.c $(srcsrc)/sh_log_parse_pacct.c \
$(srcsrc)/sh_log_parse_samba.c $(srcsrc)/sh_log_parse_generic.c \
$(srcsrc)/sh_log_parse_apache.c $(srcsrc)/sh_log_evalrule.c \
$(srcsrc)/sh_log_correlate.c $(srcsrc)/sh_log_mark.c \
$(srcsrc)/sh_log_check.c $(srcsrc)/dnmalloc.c \
$(srcsrc)/sh_inotify.c $(srcsrc)/sh_log_repeat.c \
$(srcsrc)/sh_audit.c $(srcsrc)/sh_registry.c \
$(srcsrc)/sh_ipvx.c $(srcsrc)/sh_restrict.c \
$(srcsrc)/sh_filetype.c $(srcsrc)/sh_sub.c $(srcsrc)/sh_fInotify.c \
$(srcsrc)/sh_checksum.c $(srcsrc)/sh_guid.c $(srcsrc)/sh_sem.c \
$(srcsrc)/sh_dbIO.c $(srcsrc)/sh_dbCheck.c $(srcsrc)/sh_dbCreate.c \
$(srcsrc)/t-test1.c
OBJECTS = sh_files.o sh_tiger0.o sh_tiger2.o sh_tiger2_64.o \
samhain.o sh_unix.o sh_utils.o sh_error.o \
sh_getopt.o sh_readconf.o sh_filter.o \
sh_hash.o sh_mail.o sh_nmail.o sh_mem.o sh_login_track.o \
sh_entropy.o sh_modules.o sh_utmp.o \
sh_xfer_client.o sh_xfer_server.o sh_xfer_syslog.o \
sh_suidchk.o sh_srp.o sh_fifo.o sh_tools.o sh_html.o sh_gpg.o \
sh_cat.o sh_calls.o sh_extern.o sh_database.o sh_err_log.o \
sh_err_console.o sh_err_syslog.o sh_schedule.o bignum.o \
trustfile.o rijndael-alg-fst.o rijndael-api-fst.o slib.o \
zAVLTree.o sh_socket.o sh_ignore.o sh_prelude.o \
sh_mounts.o sh_userfiles.o sh_prelink.o sh_static.o \
sh_processcheck.o sh_portcheck.o sh_port2proc.o \
sh_log_parse_syslog.o sh_log_parse_pacct.o sh_log_parse_apache.o \
sh_log_parse_samba.o sh_log_evalrule.o sh_log_check.o \
sh_log_parse_generic.o \
sh_log_correlate.o sh_log_mark.o sh_log_repeat.o \
sh_pthread.o sh_string.o sh_inotify.o dnmalloc.o \
sh_audit.o sh_registry.o sh_ipvx.o sh_restrict.o \
sh_filetype.o sh_sub.o sh_fInotify.o sh_checksum.o \
sh_guid.o sh_sem.o sh_dbIO.o sh_dbCheck.o sh_dbCreate.o
TESTSUITE = test.sh testcompile.sh testhash.sh testtiger.txt \
testtimesrv.sh \
testext.sh testrc_1ext.in test_ext.c.in testrun_1d.sh \
testrun_1.sh testrun_1a.sh testrun_1b.sh testrun_1c.sh testrc_1 \
testrun_2.sh testrun_2a.sh testrun_2b.sh testrc_2.in \
testrun_2c.sh testrun_2d.sh
DIST_COMMON = README COPYING LICENSE samhain.jpg \
samhainrc.linux samhainrc.solaris samhainrc.freebsd samhainrc.aix5.2.0 \
samhainrc.netbsd yulerc.template \
Install.sh
DIST_NEEDED = Makefile.in deploy.sh.in samhain-install.sh.in \
samhain.spec.in rules.deb.in rules.deb-light.in samhain.spec hp_ux.psf.in \
stealth_template.jpg \
config.guess config.h.in stamp-h.in config.sub configure \
configure.ac acconfig.h aclocal.m4 install-sh missing mkinstalldirs \
c_random.sh c_bits.sh depend.sum depend.dep stamp-hdep
DISTFILES = $(DIST_COMMON) $(DIST_NEEDED) \
src include man scripts init docs sql_init test dsys
PROGRAMS = $(SETPWD) $(STEGIN) $(SAMHAIN) $(YULECTL) $(SADMIN)
#----------------------------------------------------------
#
# the first target is the default one
#
#----------------------------------------------------------
all: $(top_srcdir)/depend.sum $(SETPWD) $(STEGIN) $(SAMHAIN) $(YULECTL) sstrip
#----------------------------------------------------------
#
# rules for automatic updating of configuration information
# after changing the configuration files
#
#----------------------------------------------------------
$(top_srcdir)/configure: $(top_srcdir)/configure.ac $(top_srcdir)/aclocal.m4
cd $(srcdir) && autoconf
# autoheader might not change config.h.in, so touch a stamp file.
$(top_srcdir)/config.h.in: $(top_srcdir)/stamp-h.in
touch $(top_srcdir)/config.h.in
$(top_srcdir)/stamp-h.in: $(top_srcdir)/configure.ac $(top_srcdir)/aclocal.m4
cd $(top_srcdir) && autoheader
echo timestamp > $(top_srcdir)/stamp-h.in
config.h: stamp-h
@sleep 1; \
touch config.h
stamp-h: $(top_srcdir)/config.h.in config.status
./config.status
Makefile: $(top_srcdir)/Makefile.in config.status
./config.status
samhain-install.sh: $(top_srcdir)/samhain-install.sh.in config.status
./config.status
config.status: $(top_srcdir)/configure
./config.status --recheck
#----------------------------------------------------------
#
# rules for automatic dependency tracking
#
#----------------------------------------------------------
depend-gen: $(srcsrc)/depend-gen.c
@echo "$(BUILD_CC) -I. -o depend-gen $(srcsrc)/depend-gen.c"; \
$(BUILD_CC) -I. -o depend-gen $(srcsrc)/depend-gen.c 2>/dev/null || \
echo "failed to compile ... hope depend.dep is ok"
# redo if sources change
#
$(top_srcdir)/depend.dep: depend-gen $(SOURCES)
@echo "update depend.dep ..."; \
test -f $(srcdir)/depend.dep || echo > $(srcdir)/depend.dep; \
if test -f depend-gen; then \
failfiles=""; \
for ff in $(SOURCES); do \
./depend-gen -i '$$(srcinc)/' -o $(top_srcdir)/depend.dep $$ff || \
failfiles="$${failfiles} $$ff"; \
done; \
if test x"$${failfiles}" != x; then \
echo "--------------------------------------------------------";\
echo " depend-gen failed to update depend.dep. You can safely"; \
echo " ignore this error, unless you have modified the source"; \
echo " files and changed their dependencies."; \
echo "--------------------------------------------------------";\
else \
echo $(srcsrc) > $(top_srcdir)/stamp-dep; \
fi; \
else \
echo "depend-gen not found ... depend.dep not modified"; \
fi
# only updated if depencies change
#
$(top_srcdir)/depend.sum: $(top_srcdir)/depend.dep
@if test -f depend-gen; then \
nsum=`./depend-gen -c $(top_srcdir)/depend.dep|awk '{print $$1}'`; \
osum=`cat $(top_srcdir)/depend.sum 2>/dev/null`; \
if test "x$$osum" != "x$$nsum"; then \
echo "update $(top_srcdir)/depend.sum ..."; \
echo $$nsum > $(top_srcdir)/depend.sum; \
echo timestamp > $(top_srcdir)/stamp-hdep; \
fi; \
fi;
$(top_srcdir)/stamp-hdep:
touch $(top_srcdir)/stamp-hdep && touch $(top_srcdir)/Makefile.in
$(top_srcdir)/Makefile.in: $(top_srcdir)/stamp-hdep
@echo "update Makefile.in ..."; \
echo "cp Makefile.in Makefile.in.bak"; \
cp $(top_srcdir)/Makefile.in $(top_srcdir)/Makefile.in.bak; \
if test -f depend-gen; then \
failfiles=""; \
for ff in $(SOURCES); do \
./depend-gen -i '$$(srcinc)/' -o $(top_srcdir)/Makefile.in $$ff || \
failfiles="$${failfiles} $$ff"; \
done; \
if test x"$${failfiles}" != x; then \
echo "--------------------------------------------------------";\
echo " depend-gen failed to update Makefile.in. You can safely"; \
echo " ignore this error, unless you have modified the source"; \
echo " files and changed their dependencies."; \
echo "--------------------------------------------------------";\
else \
echo $(srcsrc) > $(top_srcdir)/stamp-dep; \
fi; \
fi
# do it manually
#
depend: depend-gen
@echo "update Makefile.in ..."; \
for ff in $(SOURCES); do \
./depend-gen -i '$$(srcinc)/' -o $(top_srcdir)/Makefile.in $$ff; \
echo $(srcsrc) > $(top_srcdir)/stamp-dep; \
done
#----------------------------------------------------------
#
# CLEAN rules
#
#----------------------------------------------------------
# everything created by make
#
CLEANFILES = encode config_xor.h depend-gen \
internal.h sh_MK.h trustfile sstrip samhain mkhdr encode cutest \
yule samhain_setpwd samhain_stealth samhainrc yulectl
clean:
-rm -f core *.o
@-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
# everything created by (./configure && make)
#
DISTCLEANFILES = Makefile samhain.spec sh_gpg_checksum.h sh_gpg_fp.h \
init/samhain.startLinux init/samhain.startGentoo \
init/samhain.startLSB init/samhain.startFreeBSD \
init/samhain.startSolaris init/samhain.startHPUX \
init/samhain.startIRIX init/samhain.startMACOSX \
deploy.sh sh_MK.h samhain-install.sh sh_gpg_chksum.h sh_gpg_fp.h \
rules.deb rules.deb-light src/CuTestMain.c \
scripts/samhainadmin.pl scripts/check_samhain.pl \
scripts/samhain.ebuild scripts/samhain.ebuild-light \
scripts/yuleadmin.pl scripts/logrotate \
scripts/redhat_i386.client.spec scripts/samhain.spec hp_ux.psf
TESTCLEANFILES = samhain.build samhain.new yule.html \
test_ext test_ext.c test_ext.res testhash.tmp \
testrc1.signed testrc_1ext testrc_2 testrc_2.signed \
test_dnmalloc
distclean: clean
-rm -f config.status config.log configure.lineno config.h config.cache
@-test -z "$(TESTCLEANFILES)" || rm -f $(TESTCLEANFILES)
@-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
#----------------------------------------------------------
#
# TEST rules
#
#----------------------------------------------------------
test14: test
@cd test && TOP_SRCDIR=$(top_srcdir) && \
export TOP_SRCDIR && ./test.sh 14 `hostname -f`
test13: test
@cd test && TOP_SRCDIR=$(top_srcdir) && \
export TOP_SRCDIR && ./test.sh 13 `hostname -f`
test12: test
@cd test && TOP_SRCDIR=$(top_srcdir) && \
export TOP_SRCDIR && ./test.sh 12 `hostname -f`
test11: test
@cd test && TOP_SRCDIR=$(top_srcdir) && \
export TOP_SRCDIR && ./test.sh 11 `hostname -f`
test10: test
@cd test && TOP_SRCDIR=$(top_srcdir) && \
export TOP_SRCDIR && ./test.sh 10 `hostname -f`
test7: test
@cd test && TOP_SRCDIR=$(top_srcdir) && \
export TOP_SRCDIR && ./test.sh 7
test6: test
@cd test && TOP_SRCDIR=$(top_srcdir) && \
export TOP_SRCDIR && ./test.sh 6
test5: test
@cd test && TOP_SRCDIR=$(top_srcdir) && \
export TOP_SRCDIR && ./test.sh 5
test4: test
@cd test && TOP_SRCDIR=$(top_srcdir) && \
export TOP_SRCDIR && ./test.sh 4
test3: test
@cd test && TOP_SRCDIR=$(top_srcdir) && \
export TOP_SRCDIR && ./test.sh 3
test2: test
@cd test && TOP_SRCDIR=$(top_srcdir) && \
export TOP_SRCDIR && ./test.sh 2
test1: test
@cd test && TOP_SRCDIR=$(top_srcdir) && \
export TOP_SRCDIR && ./test.sh 1
test:
@if test -f test; then \
:; \
else \
cp -pr $(top_srcdir)/test .; \
cat $(top_srcdir)/test/test.sh | \
sed 's%XXXSRCXXX%$(top_srcdir)%' > test/test.sh; \
chmod +x test/test.sh; \
fi
test_dnmalloc: $(srcsrc)/t-test1.c dnmalloc.o
$(COMPILE) $(VFLAG) -o t-test1.o -c $(srcsrc)/t-test1.c; \
$(LINK) t-test1.o dnmalloc.o $(LIBS_TRY)
#----------------------------------------------------------
#
# INSTALL rules
#
#----------------------------------------------------------
install: install-program install-man install-data
@echo; \
echo " You can use 'samhain-install.sh uninstall' for uninstalling"; \
echo " i.e. you might consider saving that script for future use";\
echo; \
echo " Use 'make install-boot' if you want @install_name@ to start on system boot"; \
echo
install-light: install-program install-data
@echo; \
echo " You can use 'samhain-install.sh uninstall' for uninstalling"; \
echo " i.e. you might consider saving that script for future use";\
echo; \
echo " Use 'make install-boot' if you want @install_name@ to start on system boot"; \
echo
purge: uninstall-program uninstall-man
@echo "./samhain-install.sh --destdir=$(DESTDIR) --force --verbose uninstall-data"; \
./samhain-install.sh --destdir=$(DESTDIR) --force --verbose uninstall-data
remove: uninstall
uninstall: uninstall-program uninstall-man uninstall-data
@echo; \
echo " Use 'make purge' if you also want to uninstall the configuration file"; \
echo " Use 'make uninstall-boot' to uninstall the runlevel scripts"; \
echo
#
# --- boot ---
#
install-boot: samhain-install.sh
./samhain-install.sh --destdir=$(DESTDIR) --express --verbose install-boot
uninstall-boot: samhain-install.sh
./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-boot
#
# --- program ---
#
install-program: $(PROGRAMS) sstrip
@$(mkinstalldirs) $(DESTDIR)$(sbindir)
@if test x$(mytmpdir) != x; then \
$(mkinstalldirs) $(DESTDIR)$(mytmpdir); \
fi
@list='$(PROGRAMS)'; for p in $$list; do \
if test -f $$p; then \
target=$(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'|sed 's%.*/%%'`; \
extension=`echo $$target|sed 's%.*\.%%'`; \
if test x$$extension = x; then \
echo " $(INSTALL_PROGRAM) $$p $$target"; \
$(INSTALL_PROGRAM) $$p $$target; \
chmod 0700 $$target; \
echo " ./sstrip $$target"; \
./sstrip $$target; \
else \
echo " $(INSTALL_SHELL) $$p $$target"; \
$(INSTALL_SHELL) $$p $$target; \
chmod 0700 $$target; \
fi; \
else :; fi; \
done
uninstall-program:
@echo "./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-program";\
./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-program
#
# -- data files
#
install-user:
@if test "x@need_user_install@" = x1; then \
echo "./samhain-install.sh --destdir=$(DESTDIR) --express --verbose install-user @myident@"; \
./samhain-install.sh --destdir=$(DESTDIR) --express --verbose install-user @myident@; \
fi
@if test x"$(VFLAG)" = "x-DSH_WITH_SERVER"; then \
echo " chown root $(DESTDIR)$(mydatadir)"; \
chown root $(DESTDIR)$(mydatadir); \
echo " chmod 755 $(DESTDIR)$(mydatadir)"; \
chmod 755 $(DESTDIR)$(mydatadir); \
echo " chown @myident@ $(DESTDIR)$(configfile)"; \
chown @myident@ $(DESTDIR)$(configfile); \
if test x"$(mylogdir)" = "x/var/log"; then \
if test x"@myident@" = xroot; then \
:; \
else \
echo; \
echo " ----------------------------------------------------------------"; \
echo " Directory $(mylogdir) (log file) looks like a system directory."; \
echo " You may run into problems (need write access for user @myident@)."; \
echo " ----------------------------------------------------------------"; \
echo; \
fi; \
else \
echo " chown @myident@ $(DESTDIR)$(mylogdir)"; \
chown @myident@ $(DESTDIR)$(mylogdir); \
fi; \
fi
install-data: trustfile
@$(mkinstalldirs) $(DESTDIR)$(sysconfdir)
@$(mkinstalldirs) $(DESTDIR)$(mylockdir)
@$(mkinstalldirs) $(DESTDIR)$(mylogdir)
@$(mkinstalldirs) $(DESTDIR)$(mydatadir); \
chmod 700 $(DESTDIR)$(mydatadir)
@if test -f samhainrc.$(selectconfig); then \
:; \
else \
if test -f $(srcdir)/samhainrc.$(selectconfig); then \
cp $(srcdir)/samhainrc.$(selectconfig) . ; \
fi; \
fi; \
if test -f yulerc; then \
:; \
else \
if test -f $(srcdir)/yulerc.template; then \
cp $(srcdir)/yulerc.template yulerc; \
fi; \
fi; \
if test -f stealth_template.jpg; then \
:; \
else \
if test -f $(srcdir)/stealth_template.jpg; then \
cp $(srcdir)/stealth_template.jpg . ; \
fi; \
fi
@if test -d /etc/logrotate.d; then \
if test ! -d $(DESTDIR)/etc/logrotate.d; then \
$(mkinstalldirs) $(DESTDIR)/etc/logrotate.d; \
fi; \
if test ! -f $(DESTDIR)/etc/logrotate.d/@install_name@; then \
if test -w $(DESTDIR)/etc/logrotate.d; then \
cp $(srcdir)/scripts/logrotate $(DESTDIR)/etc/logrotate.d/@install_name@; \
else \
echo "$(DESTDIR)/etc/logrotate.d not writable"; \
fi; \
else \
echo "$(DESTDIR)/etc/logrotate.d/@install_name@ exists, not overwriting"; \
fi; \
fi
@echo "./samhain-install.sh --destdir=$(DESTDIR) --express --verbose install-data"; \
./samhain-install.sh --destdir=$(DESTDIR) --express --verbose install-data || \
echo " ERROR: Failed to install the configuration file to $(DESTDIR)$(configfile). You need to install the configuration file manually."
@if test x"$(VFLAG)" = "x-DSH_WITH_SERVER"; then \
echo;\
echo " -----------------------------------------------------";\
echo " The server will run as user @myident@ if started with";\
echo " root privileges, otherwise as the user of the parent ";\
echo " process (use --enable-identity=USER to change).";\
echo;\
echo " You may want to use: make install-user";\
echo;\
echo " - to add the user @myident@ (if not existing already)";\
echo " - to chown the data directory $(mydatadir)";\
echo " - to chown the log file directory $(mylogdir)";\
echo " - to chown the configuration file $(configfile)";\
echo " -----------------------------------------------------";\
else \
if test "x@need_user_install@" = x1; then \
echo;\
echo " -----------------------------------------------------";\
echo " You may want to use: make install-user";\
echo;\
echo " - to add the user @myident@ (if not existing already)";\
echo " -----------------------------------------------------";\
fi; \
fi
uninstall-data:
@echo "./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-data"; \
./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-data
#
# -- man files
#
install-man:
$(mkinstalldirs) $(DESTDIR)$(mandir)/man8
$(mkinstalldirs) $(DESTDIR)$(mandir)/man5
@if test -f $(top_srcdir)/man/samhain.8 ; then \
echo " $(INSTALL_MAN) $(top_srcdir)/man/samhain.8 $(DESTDIR)$(mandir)/man8/@[email protected]"; \
$(INSTALL_MAN) $(top_srcdir)/man/samhain.8 $(DESTDIR)$(mandir)/man8/@[email protected]; \
fi
@if test -f $(top_srcdir)/man/samhainrc.5 ; then \
echo " $(INSTALL_MAN) $(top_srcdir)/man/samhainrc.5 $(DESTDIR)$(mandir)/man5/@[email protected]"; \
$(INSTALL_MAN) $(top_srcdir)/man/samhainrc.5 $(DESTDIR)$(mandir)/man5/@[email protected]; \
fi
uninstall-man:
@echo "./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-man";\
./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-man
#----------------------------------------------------------
#
# BUILD rules
#
#----------------------------------------------------------
run: run-light
run-light: all
@echo "Building $(PACKAGE)-$(VERSION).run"; \
STAGE=$(PACKAGE)-$(VERSION); \
mkdir $$STAGE; \
if test x"$$?" != x0; then \
echo "ERROR ... mkdir $$STAGE failed"; \
exit 1; \
fi; \
$(MAKE) DESTDIR=$$STAGE install-light; \
rm -f $$STAGE/@sbindir@/@install_name@_stealth; \
echo "#! /bin/sh" > $$STAGE/setup.sh; \
if test x$(mytmpdir) != x; then \
echo "./mkinstalldirs @mytmpdir@ || exit 1" >> $$STAGE/setup.sh; \
fi; \
echo "./mkinstalldirs @sbindir@ || exit 1" >> $$STAGE/setup.sh; \
echo "./mkinstalldirs @sysconfdir@ || exit 1" >> $$STAGE/setup.sh; \
echo "./mkinstalldirs @mylockdir@ || exit 1" >> $$STAGE/setup.sh; \
echo "./mkinstalldirs @mylogdir@ || exit 1" >> $$STAGE/setup.sh; \
echo "./mkinstalldirs @mydataroot@ || exit 1" >> $$STAGE/setup.sh; \
echo "chmod 700 @mydataroot@ || exit 1" >> $$STAGE/setup.sh; \
temp=`echo $(sbindir) | sed s,^/,,`; \
echo "chown root $$temp/*" >> $$STAGE/setup.sh; \
echo "cp -p $$temp/* $(sbindir) || exit 1" >> $$STAGE/setup.sh; \
temp=`echo $(sysconfdir) | sed s,^/,,`; \
echo "chown root $$temp/*" >> $$STAGE/setup.sh; \
configfile=`echo @myconffile@ | sed 's%^REQ_FROM_SERVER%%'`; \
echo "test -f $$configfile || cp -p $$temp/* $$configfile" >> $$STAGE/setup.sh; \
echo "./samhain-install.sh --express --verbose install-boot || echo 'Cannot install init script'" >> $$STAGE/setup.sh; \
cp $(top_srcdir)/mkinstalldirs $$STAGE/; \
cp $(top_srcdir)/install-sh $$STAGE/; \
cp ./samhain-install.sh $$STAGE/; \
cp -r init/ $$STAGE/; \
chmod +x $$STAGE/setup.sh; \
chmod +x $$STAGE/samhain-install.sh; \
chmod +x $$STAGE/mkinstalldirs; \
chmod +x $$STAGE/install-sh; \
$(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 && \
rm -r $(PACKAGE)-$(VERSION)
emerge-prepare: dist
@echo "Building $(PACKAGE)-$(VERSION)"; \
test -f /etc/make.globals && . /etc/make.globals; \
test -f /etc/make.conf && . /etc/make.conf; \
echo "$(INSTALL_MAN) $(PACKAGE)-$(VERSION).tar.gz $${DISTDIR}/@install_name@-$(VERSION).tar.gz"; \
$(INSTALL_MAN) $(PACKAGE)-$(VERSION).tar.gz $${DISTDIR}/@install_name@-$(VERSION).tar.gz; \
if test "x$${PORTDIR_OVERLAY}" = "x"; then \
COPY_TO="$${PORTDIR}"; \
else \
COPY_TO="$${PORTDIR_OVERLAY}"; \
fi; \
$(mkinstalldirs) $${COPY_TO}/app-admin/@install_name@; \
echo "$(INSTALL_MAN) scripts/samhain.ebuild $${COPY_TO}/app-admin/@install_name@/@install_name@-$(VERSION).ebuild";\
$(INSTALL_MAN) scripts/samhain.ebuild $${COPY_TO}/app-admin/@install_name@/@install_name@-$(VERSION).ebuild; \
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);\
ebuild $${COPY_TO}/app-admin/@install_name@/@install_name@-$(VERSION).ebuild digest;
emerge-prepare-light: dist
@echo "Building $(PACKAGE)-$(VERSION)"; \
test -f /etc/make.globals && . /etc/make.globals; \
test -f /etc/make.conf && . /etc/make.conf; \
echo "$(INSTALL_MAN) $(PACKAGE)-$(VERSION).tar.gz $${DISTDIR}/@install_name@-$(VERSION).tar.gz"; \
$(INSTALL_MAN) $(PACKAGE)-$(VERSION).tar.gz $${DISTDIR}/@install_name@-$(VERSION).tar.gz; \
if test "x$${PORTDIR_OVERLAY}" = "x"; then \
COPY_TO="$${PORTDIR}"; \
else \
COPY_TO="$${PORTDIR_OVERLAY}"; \
fi; \
$(mkinstalldirs) $${COPY_TO}/app-admin/@install_name@; \
echo "$(INSTALL_MAN) scripts/samhain.ebuild-light $${COPY_TO}/app-admin/@install_name@/@install_name@-$(VERSION).ebuild";\
$(INSTALL_MAN) scripts/samhain.ebuild-light $${COPY_TO}/app-admin/@install_name@/@install_name@-$(VERSION).ebuild; \
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);\
ebuild $${COPY_TO}/app-admin/@install_name@/@install_name@-$(VERSION).ebuild digest;
tbz2: emerge-prepare
@emerge --buildpkgonly @install_name@; \
test -f /etc/make.globals && . /etc/make.globals; \
test -f /etc/make.conf && . /etc/make.conf; \
echo; \
echo "@install_name@-$(VERSION).tbz2 should be in $${PKGDIR}/All"; \
if test -f $${PKGDIR}/All/@install_name@-$(VERSION).tbz2; then \
echo "Package $${PKGDIR}/All/@install_name@-$(VERSION).tbz2 built."; \
mv $${PKGDIR}/All/@install_name@-$(VERSION).tbz2 $(PACKAGE)-$(VERSION).tbz2; \
rm -f $${PKGDIR}/app-admin/@install_name@-$(VERSION).tbz2; \
rm -rf $${PORTAGE_TMPDIR}/portage/@install_name@-$(VERSION); \
else \
echo "Error ... cannot find package."; \
exit 1; \
fi; \
echo
tbz2-light: emerge-prepare-light
@emerge --buildpkgonly @install_name@; \
test -f /etc/make.globals && . /etc/make.globals; \
test -f /etc/make.conf && . /etc/make.conf; \
echo; \
if test -f $${PKGDIR}/All/@install_name@-$(VERSION).tbz2; then \
echo "Package $${PKGDIR}/All/@install_name@-$(VERSION).tbz2 built."; \
mv $${PKGDIR}/All/@install_name@-$(VERSION).tbz2 $(PACKAGE)-$(VERSION).tbz2; \
rm -f $${PKGDIR}/app-admin/@install_name@-$(VERSION).tbz2; \
rm -rf $${PORTAGE_TMPDIR}/portage/@install_name@-$(VERSION); \
else \
echo "Error ... cannot find package."; \
exit 1; \
fi; \
echo
emerge:
emerge $(PACKAGE);
deb-light:
@echo "creating subdirectory debian"; \
mkdir -p debian; \
cp rules.deb-light debian/rules; \
chmod +x debian/rules; \
echo $(sbindir) | sed s,^/,, > debian/dirs; \
if test x$(mytmpdir) != x; then \
echo $(mytmpdir) | sed s,^/,, >> debian/dirs; \
fi; \
echo $(sysconfdir) | sed s,^/,, >> debian/dirs; \
echo etc/init.d >> debian/dirs; \
echo $(mydatadir) | sed s,^/,, >> debian/dirs; \
echo $(mylogdir) | sed s,^/,, >> debian/dirs; \
echo $(mylockdir) | sed s,^/,, >> debian/dirs; \
$(MAKE) deb-run
deb:
@echo "creating subdirectory debian"; \
mkdir -p debian; \
cp rules.deb debian/rules; \
chmod +x debian/rules; \
echo $(sbindir) | sed s,^/,, > debian/dirs; \
if test x$(mytmpdir) != x; then \
echo $(mytmpdir) | sed s,^/,, >> debian/dirs; \
fi; \
echo $(sysconfdir) | sed s,^/,, >> debian/dirs; \
echo etc/init.d >> debian/dirs; \
echo $(mydatadir) | sed s,^/,, >> debian/dirs; \
echo $(mylogdir) | sed s,^/,, >> debian/dirs; \
echo $(mylockdir) | sed s,^/,, >> debian/dirs; \
echo $(mandir)/man5 | sed s,^/,, >> debian/dirs; \
echo $(mandir)/man8 | sed s,^/,, >> debian/dirs; \
echo usr/share/doc/$(PACKAGE) >> debian/dirs; \
echo $(top_srcdir)/README > debian/docs; \
echo $(top_srcdir)/test/testtiger.txt >> debian/docs; \
echo $(srcsrc)/simple-bignum.tar.bz2 >> debian/docs; \
echo $(top_srcdir)/scripts/head.html >> debian/docs; \
echo $(top_srcdir)/scripts/foot.html >> debian/docs; \
echo $(top_srcdir)/samhain.jpg >> debian/docs; \
echo $(top_srcdir)/docs/BUGS >> debian/docs; \
echo $(top_srcdir)/docs/HOWTO-client+server.html >> debian/docs; \
echo $(top_srcdir)/docs/HOWTO-samhain+GnuPG.html >> debian/docs; \
echo $(top_srcdir)/docs/MANUAL-2_4.html.tar >> debian/docs; \
echo $(top_srcdir)/docs/MANUAL-2_4.pdf >> debian/docs; \
echo $(top_srcdir)/docs/README.gcc_bug >> debian/docs; \
echo $(top_srcdir)/docs/README.LZO >> debian/docs; \
echo $(top_srcdir)/docs/README.sstrip >> debian/docs; \
echo $(top_srcdir)/docs/README.UPGRADE >> debian/docs; \
echo $(top_srcdir)/docs/README.win2K >> debian/docs; \
$(MAKE) deb-run
deb-run:
@maintainer=`gpg --list-secret-keys | grep 'uid ' | cut -d" " -f 5- | sed 's/^ *//' | sed q1`;\
if test "x$$maintainer" = x; then \
maintainer="$(DEFAULT_MAINTAINER)"; \
fi; \
echo "$(PACKAGE) ($(VERSION)-$(BUILD_NUM)) stable; urgency=low" > debian/changelog; \
echo >> debian/changelog; \
echo " * Initial release." >> debian/changelog; \
echo >> debian/changelog; \
echo " -- $$maintainer `date -R`" >> debian/changelog; \
echo >> debian/changelog; \
echo "Local variables:" >> debian/changelog; \
echo "mode: debian-changelog" >> debian/changelog; \
echo "End:" >> debian/changelog; \
cp $(top_srcdir)/COPYING debian/copyright; \
touch debian/README.debian; \
echo "Document: @install_name@-manual" > debian/@[email protected]; \
echo "Title: @install_name@ Manual" >> debian/@[email protected]; \
echo "Author: Rainer Wichmann" >> debian/@[email protected]; \
echo "Abstract: This manual describes what @install_name@ is" >> debian/@[email protected]; \
echo " and how it can be used to check the file integrity of your" >> debian/@[email protected]; \
echo " server." >> debian/@[email protected]; \
echo "Section: System/Security" >> debian/@[email protected]; \
echo >> debian/@[email protected]; \
echo >> debian/@[email protected]; \
echo "Format: Postscript" >> debian/@[email protected]; \
echo "Files: /usr/share/doc/@install_name@/manual.pdf.gz" >> debian/@[email protected]; \
echo >> debian/@[email protected]; \
echo "Format: HTML" >> debian/@[email protected]; \
echo "Index: /usr/share/doc/@install_name@/manual.html/index.html" >> debian/@[email protected]; \
echo "Files: /usr/share/doc/@install_name@/manual.html/*.html" >> debian/@[email protected]; \
if test -f /usr/lib/lsb/install_initd; then \
cp init/samhain.startLSB debian/@[email protected]; \
else \
cp init/samhain.startLinux debian/@[email protected]; \
fi; \
echo "Source: samhain" > debian/control; \
echo "Section: admin" >> debian/control; \
echo "Priority: optional" >> debian/control; \
echo "Maintainer: $$maintainer" >> debian/control; \
echo "Standards-Version: 3.2.1" >> debian/control; \
echo >> debian/control; \
echo "Package: @install_name@" >> debian/control; \
echo "Architecture: any" >> debian/control; \
echo "Depends: libc6" >> debian/control; \
echo "Description: File integrity checker" >> debian/control; \
echo " A file integrity checker" >> debian/control; \
echo "running debuild -us -uc"; \
debuild --preserve-envvar=PASSWORD -us -uc -b; \
DEBFILE=`find ../ -follow -maxdepth 1 -cnewer ./debian/control 2>/dev/null | grep '@install_name@_$(VERSION)' | grep '\.deb'`; \
if test x"$$DEBFILE" = x; then \
echo "Error ... cannot find package file"; \
exit 1; \
else \
echo "Package $$DEBFILE built."; \
cp $$DEBFILE ./$(PACKAGE)-$(VERSION)-$(BUILD_NUM).deb; \
ln -s ./$(PACKAGE)-$(VERSION)-$(BUILD_NUM).deb ./$(PACKAGE)-$(VERSION).deb; \
fi; \
echo
#
# Check samhain.spec
#
rpmspec-full:
@grep 'install-light' samhain.spec >/dev/null 2>&1; \
if test x"$$?" = "x0"; then \
echo "Your samhain.spec is from rpm-light. Please run"; \
echo " .config.status to re-create the original samhain.spec"; \
exit 1; \
fi
# when editing the spec file, make an additional blank after 'make'
# to avoid that it matches on a second processing
#
rpmspec-light: samhain.spec
@echo "Stripping docs from samhain.spec"; \
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 '/logrotate/! { s,%attr.*,, }' > samhain.spec-light; \
mv samhain.spec-light samhain.spec
rpm-light: rpmspec-light distrpm
rpmbuild -ta ./$(PACKAGE)-$(VERSION).tar.gz;
@RPMTOP=`cat ~/.rpmmacros 2>/dev/null | grep '%_topdir' | awk '{ print $$2}'`; \
if test x"$$RPMTOP" = x; then RPMTOP=/usr/src; fi; \
if ! test -d "$$RPMTOP"; then \
RPMTOP=`echo $$HOME/rpmbuild`; \
fi; \
echo "Searching the RPM package below $$RPMTOP ..."; \
RPMFILE=`find $$RPMTOP -follow -maxdepth 4 -cnewer ./samhain.spec 2>/dev/null | grep '@install_name@-$(VERSION)' | grep '\.rpm' | grep -v '\.src\.'`; \
echo; \
if test x"$$RPMFILE" = x; then \
echo "Error ... cannot find package file"; \
exit 1; \
else \
echo "Package $$RPMFILE built."; \
echo "Copying it to ./$(PACKAGE)-$(VERSION).rpm"; \
cp $$RPMFILE ./$(PACKAGE)-$(VERSION).rpm; \
fi; \
echo
rpm: rpmspec-full distrpm
rpmbuild -ta ./$(PACKAGE)-$(VERSION).tar.gz;
@RPMTOP=`cat ~/.rpmmacros 2>/dev/null | grep '%_topdir' | awk '{ print $$2}'`; \
if test x"$$RPMTOP" = x; then RPMTOP=/usr/src; fi; \
if ! test -d "$$RPMTOP"; then \
RPMTOP=`echo $$HOME/rpmbuild`; \
fi; \
echo "Searching the RPM package below $$RPMTOP ..."; \
RPMFILE=`find $$RPMTOP -follow -maxdepth 4 -cnewer ./samhain.spec 2>/dev/null | grep '@install_name@-$(VERSION)' | grep '\.rpm' | grep -v '\.src\.'`; \
echo; \
if test x"$$RPMFILE" = x; then \
echo "Error ... cannot find package file"; \
exit 1; \
else \
echo "Package $$RPMFILE built."; \
echo "Copying it to ./$(PACKAGE)-$(VERSION).rpm"; \
cp $$RPMFILE ./$(PACKAGE)-$(VERSION).rpm; \
fi; \
echo
srpm-dist: rpmspec-full samhain.spec
@cat samhain.spec | \
sed s%\-\-with\-base=.*\,[0123456789]*%% | \
sed s%\'\'%% > samhain.spec.m; \
mv samhain.spec.m samhain.spec
$(MAKE) distrpm
rpmbuild -ts ./$(PACKAGE)-$(VERSION).tar.gz
srpm: rpmspec-full distrpm
rpmbuild -ts ./$(PACKAGE)-$(VERSION).tar.gz
solaris-pkg-light: all
@STAGE=/tmp/samhain-pkg-staging; \
mkdir $$STAGE; \
if test x"$$?" != x0; then \
echo "ERROR ... mkdir $$STAGE failed"; \
exit 1; \
fi; \
$(MAKE) DESTDIR=$$STAGE install-light;
$(MAKE) solaris-pkg-finish
solaris-pkg: all
@STAGE=/tmp/samhain-pkg-staging; \
mkdir $$STAGE; \
if test x"$$?" != x0; then \
echo "ERROR ... mkdir $$STAGE failed"; \
exit 1; \
fi; \
$(MAKE) DESTDIR=$$STAGE install;
$(MAKE) solaris-pkg-finish
solaris-pkg-finish:
@STAGE=/tmp/samhain-pkg-staging; \
$(mkinstalldirs) $$STAGE/etc/init.d; \
$(INSTALL_SHELL) init/samhain.startSolaris $$STAGE/etc/init.d/@install_name@; \
(echo 'i pkginfo'; pkgproto $$STAGE=/ ) >prototype; \
user=`id | sed s,uid=[0123456789]*\(,, | sed s,\).*,,`; \
group=`id | sed s,.*gid=[0123456789]*\(,, | sed s,\).*,,`; \
cat prototype | grep -v 'none / ' | \
sed s,$$user\ $$group,root\ sys,g > prototype.1; \
rm -f prototype.2; \
while read line; do \