0
|
1 # make the Distributed Checksum Clearinghouse prototype home directory files |
|
2 |
|
3 # Copyright (c) 2008 by Rhyolite Software, LLC |
|
4 # |
|
5 # This agreement is not applicable to any entity which sells anti-spam |
|
6 # solutions to others or provides an anti-spam solution as part of a |
|
7 # security solution sold to other entities, or to a private network |
|
8 # which employs the DCC or uses data provided by operation of the DCC |
|
9 # but does not provide corresponding data to other users. |
|
10 # |
|
11 # Permission to use, copy, modify, and distribute this software without |
|
12 # changes for any purpose with or without fee is hereby granted, provided |
|
13 # that the above copyright notice and this permission notice appear in all |
|
14 # copies and any distributed versions or copies are either unchanged |
|
15 # or not called anything similar to "DCC" or "Distributed Checksum |
|
16 # Clearinghouse". |
|
17 # |
|
18 # Parties not eligible to receive a license under this agreement can |
|
19 # obtain a commercial license to use DCC by contacting Rhyolite Software |
|
20 # at sales@rhyolite.com. |
|
21 # |
|
22 # A commercial license would be for Distributed Checksum and Reputation |
|
23 # Clearinghouse software. That software includes additional features. This |
|
24 # free license for Distributed ChecksumClearinghouse Software does not in any |
|
25 # way grant permision to use Distributed Checksum and Reputation Clearinghouse |
|
26 # software |
|
27 # |
|
28 # THE SOFTWARE IS PROVIDED "AS IS" AND RHYOLITE SOFTWARE, LLC DISCLAIMS ALL |
|
29 # WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES |
|
30 # OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL RHYOLITE SOFTWARE, LLC |
|
31 # BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES |
|
32 # OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, |
|
33 # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, |
|
34 # ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS |
|
35 # SOFTWARE. |
|
36 |
|
37 # Rhyolite Software DCC 1.3.103-1.57 $Revision$ |
|
38 # @configure_input@ |
|
39 |
|
40 DEPTH =.. |
|
41 |
|
42 @MAKE_PROG@ |
|
43 @MAKE_INC2@ |
|
44 |
|
45 HINST =$(INSTALL) -c $(SET_DCCOWN) |
|
46 HD =@installroot@$(DCC_HOMEDIR) |
|
47 MAP =$(HD)/map@configsuffix@ |
|
48 MAPTXT =$(HD)/map.txt@configsuffix@ |
|
49 IDS =$(HD)/ids@configsuffix@ |
|
50 CDCC =$(DEPTH)/cdcc/cdcc |
|
51 |
|
52 # this should not be the ./configure name |
|
53 UPFILE =.updatedcc_pfile |
|
54 |
|
55 SIMPLE =flod grey_flod whitelist grey_whitelist whiteclnt whitecommon |
|
56 ALL =$(SIMPLE) ids map map.txt dcc_conf |
|
57 |
|
58 all: |
|
59 @: |
|
60 |
|
61 # /dev/random is overkill for the security needed here, but use it if it exists |
|
62 RND=(ps; dd if=/dev/random count=1 2>&1) | cksum | tr ' ' xy |
|
63 |
|
64 install: |
|
65 if test ! -d $(HD); then\ |
|
66 $(HINST) -m 755 -d $(HD); fi |
|
67 if test ! -d $(HD)/log; then\ |
|
68 $(HINST) -m 710 -d $(HD)/log; fi |
|
69 if test -z '@configsuffix@' -a -s $(HD)/dcc_conf; then\ |
|
70 sh make-dcc_conf -h $(HD) -s '@configsuffix@';\ |
|
71 else\ |
|
72 $(HINST) -m 644 dcc_conf $(HD)/dcc_conf@configsuffix@;\ |
|
73 fi |
|
74 for nm in $(SIMPLE); do\ |
|
75 if test -n '@configsuffix@' -o ! -f $(HD)/$$nm; then\ |
|
76 $(HINST) -m 644 $$nm $(HD)/$${nm}@configsuffix@; fi; done |
|
77 if test -s $(UPFILE); then\ |
|
78 $(HINST) -m 600 $(UPFILE) $(HD)/$(UPFILE);\ |
|
79 set +e; chown @DCCSUID@ $(HD)/$(UPFILE); fi |
|
80 if test -n '@configsuffix@' || test ! -f $(HD)/ids -a ! -f $(HD)/map\ |
|
81 -a ! -f $(HD)/map.txt; then\ |
|
82 umask 077; PASSWD=`$(RND)`;\ |
|
83 sed -e "s/secret1/$$PASSWD/" -e "s/secret2/`$(RND)`/" ids >$(IDS);\ |
|
84 rm -f $(MAP) || true; sed -e "s/secret1/$$PASSWD/" map.txt |\ |
|
85 $(CDCC) -qh$(HD) "new map $(MAP); load -";\ |
|
86 sh fix-map -c $(CDCC) -m $(MAP) -h $(HD);\ |
|
87 echo '# map.txt is merely the output of `cdcc info`' >$(MAPTXT);\ |
|
88 $(CDCC) -qh$(HD) "file $(MAP); info" >>$(MAPTXT);\ |
|
89 set +e; chown @DCCSUID@ $(MAPTXT) $(MAP) $(IDS);\ |
|
90 else\ |
|
91 sh fix-map -c $(CDCC) -m $(MAP) -h $(HD);\ |
|
92 fi |
|
93 if test -n '@configsuffix@'; then\ |
|
94 for nm in $(ALL); do\ |
|
95 if test ! -f $(HD)/$$nm; then\ |
|
96 cp -p $(HD)/$${nm}@configsuffix@ $(HD)/$${nm}; fi; done; fi |
|
97 |
|
98 deinstall: |
|
99 for NM in dcc_conf flod grey_flod whiteclnt whitecommon\ |
|
100 whitelist grey_whitelist; do\ |
|
101 if test ! -f $(HD)/$$NM; then continue; fi;\ |
|
102 if test `diff $$NM $(HD)/$$NM\ |
|
103 | sed -e '/^---$$/d' -e '/^[^<>]/d'\ |
|
104 -e '/^[<>][ ]*#/d' -e '/^[<>][ ]*$$/d'\ |
|
105 | wc -l` -eq 0; then rm $(HD)/$$NM; fi; done; |
|
106 -rm -f $(HD)/dcc_conf-new |
|
107 -if test -d $(HD); then\ |
|
108 find $(HD) -name '*.dcc[xw]' | @DCC_XARGS@ rm -f ;\ |
|
109 rmdir $(HD)/log;\ |
|
110 fi |