File: Makefile

package info (click to toggle)
junkfilter 20030115-4
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 300 kB
  • ctags: 16
  • sloc: makefile: 147; sh: 115
file content (166 lines) | stat: -rw-r--r-- 4,377 bytes parent folder | download | duplicates (3)
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
# junkfilter
# a junk email filter system for procmail
# Copyright 1997-2002 Gregory Sutter <gsutter@zer0.org>
#
# $Id: Makefile,v 1.8 2003/01/16 01:39:11 gsutter Exp $
#
# Please read the file "README" and the page
# http://junkfilter.zer0.org/ before using junkfilter.

# JFDIR is where junkfilter is installed on your system.
# JFUSERDIR is where the user lists are. 
JFDIR?=			/usr/local/etc/junkfilter
JFUSERDIR?=		${HOME}/.procmail/

# JFLISTSRC is where the default list files (bodychk, headers, etc) live.
# JFLISTINST is where the compiled versions are placed.
JFLISTSRC?=		${JFDIR}
JFLISTINST?=		${JFDIR}

# JFUSERSRC is where the user list files (bodychk-user, domains-user, etc.)
# reside, and JFUSERINST is where the compiled versions will be placed.
JFUSERSRC?=		${JFUSERDIR}
JFUSERINST?=		${JFUSERDIR}

CAT_REGEX='s/\012(.)/\|$$1/g; s/\015//g; s/\|{2,}/\|/g'
DOT_REGEX='s/\./\\./g'
#DOMAINS_REGEX='s/[	 ]+//g; y/[A-Z]/[a-z]/; s/\015//g; s/\./(.|=2E)/g'
DOMAINS_REGEX='s/[	 ]+//g; y/[A-Z]/[a-z]/; s/\015//g'

RE_FILES=bodychk addresses ip dialups headers white domains/[a-z]*
USER_RE_FILES=bodychk-user addresses-user ip-user dialups-user headers-user white-user domains-user
JF_FILES=jf-bodychk jf-addresses jf-ip jf-dialups jf-headers jf-white jf-domains
USER_JF_FILES=jf-bodychk-user jf-addresses-user jf-ip-user jf-dialups-user jf-headers-user jf-domains-user jf-white-user

all:	${JF_FILES} ${USER_JF_FILES}
	@echo "Done. $@ built."

lists:	${JF_FILES}
	@echo "Done. $@ built."

user-lists:	${USER_JF_FILES}
	@echo "Done. $@ built."

test:	${RE_FILES} ${USER_RE_FILES}
	@echo ${CAT_REGEX}
	@for i in ${RE_FILES} ${USER_RE_FILES}; do echo Testing $$i...; done

create:	${USER_RE_FILES}

jf-bodychk::${JFLISTSRC}/bodychk
	@cat ${JFLISTSRC}/bodychk |\
	egrep -v '^#' |\
	sort |\
	perl -p0e ${CAT_REGEX} > ${JFLISTINST}/jf-bodychk

jf-bodychk-user:${JFUSERSRC}/bodychk-user
	@cat ${JFUSERSRC}/bodychk-user |\
	egrep -v '^#' |\
	sort |\
	perl -p0e ${CAT_REGEX} > ${JFUSERINST}/jf-bodychk-user

bodychk-user:
	@touch ${JFUSERSRC}/$@

jf-addresses:${JFLISTSRC}/addresses
	@cat ${JFLISTSRC}/addresses |\
	egrep -v '^#' |\
	sort |\
	perl -p0e ${CAT_REGEX} > ${JFLISTINST}/jf-addresses

jf-addresses-user:${JFUSERSRC}/addresses-user
	@cat ${JFUSERSRC}/addresses-user |\
	egrep -v '^#' |\
	sort |\
	perl -p0e ${CAT_REGEX} > ${JFUSERINST}/jf-addresses-user

addresses-user:
	@touch ${JFUSERSRC}/$@

jf-ip:${JFLISTSRC}/ip
	@cat ${JFLISTSRC}/ip |\
	egrep -v '^#' |\
	sort |\
	perl -p0e ${CAT_REGEX} |\
	perl -p0e ${DOT_REGEX} > ${JFLISTINST}/jf-ip

jf-ip-user:${JFUSERSRC}/ip-user
	@cat ${JFUSERSRC}/ip-user |\
	egrep -v '^#' |\
	sort |\
	perl -p0e ${CAT_REGEX} |\
	perl -p0e ${DOT_REGEX} > ${JFUSERINST}/jf-ip-user

ip-user:
	@touch ${JFUSERSRC}/$@

jf-dialups:${JFLISTSRC}/dialups
	@cat ${JFLISTSRC}/dialups |\
	egrep -v '^#' |\
	sort |\
	perl -p0e ${CAT_REGEX} |\
	perl -p0e ${DOT_REGEX} > ${JFLISTINST}/jf-dialups

jf-dialups-user:${JFUSERSRC}/dialups-user
	@cat ${JFUSERSRC}/dialups-user |\
	egrep -v '^#' |\
	sort |\
	perl -p0e ${CAT_REGEX} |\
	perl -p0e ${DOT_REGEX} > ${JFUSERINST}/jf-dialups-user

dialups-user:
	@touch ${JFUSERSRC}/$@

jf-headers:${JFLISTSRC}/headers
	@cat ${JFLISTSRC}/headers |\
	egrep -v '^#' |\
	sort |\
	perl -p0e ${CAT_REGEX} > ${JFLISTINST}/jf-headers

jf-headers-user:${JFUSERSRC}/headers-user
	@cat ${JFUSERSRC}/headers-user |\
	egrep -v '^#' |\
	sort |\
	perl -p0e ${CAT_REGEX} > ${JFUSERINST}/jf-headers-user

headers-user:
	@touch ${JFUSERSRC}/$@

jf-white:${JFLISTSRC}/white
	@cat ${JFLISTSRC}/white |\
	egrep -v '^#' |\
	sort |\
	perl -p0e ${CAT_REGEX} > ${JFLISTINST}/jf-white

jf-white-user:${JFUSERSRC}/white-user
	@cat ${JFUSERSRC}/white-user |\
	egrep -v '^#' |\
	sort |\
	perl -p0e ${CAT_REGEX} > ${JFUSERINST}/jf-white-user

white-user:
	@touch ${JFUSERSRC}/$@

jf-domains:${JFLISTSRC}/domains/[a-z]* domains/[a-z]* 
	@cat ${JFLISTSRC}/domains/[a-z]* domains/[a-z]* |\
	egrep -v '^#' |\
	perl -pe ${DOMAINS_REGEX} |\
	egrep -v '^$$' |\
	sort | uniq |\
	perl -p0e ${CAT_REGEX} |\
	perl -p0e ${DOT_REGEX} > ${JFLISTINST}/jf-domains

jf-domains-user:${JFUSERSRC}/domains-user
	@cat ${JFUSERSRC}/domains-user |\
	egrep -v '^#' |\
	perl -pe ${DOMAINS_REGEX} |\
	egrep -v '^$$' |\
	sort | uniq |\
	perl -p0e ${CAT_REGEX} |\
	perl -p0e ${DOT_REGEX} > ${JFUSERINST}/jf-domains-user

domains-user:
	@touch ${JFUSERSRC}/$@

force: ;