1 | # $Id: Makefile.am,v 1.50 2010/11/30 09:01:56 sbajic Exp $ |
---|
2 | # |
---|
3 | # autoconf (GNU Autoconf) 2.59 |
---|
4 | # ltmain.sh (GNU libtool) 1.5.6 |
---|
5 | # automake (GNU automake) 1.9.2 |
---|
6 | |
---|
7 | includedir=@includedir@/dspam |
---|
8 | |
---|
9 | SUBDIRS = . tools $(storage_drv_subdirs) |
---|
10 | DIST_SUBDIRS = . \ |
---|
11 | tools.mysql_drv tools.pgsql_drv tools.sqlite_drv tools.hash_drv tools |
---|
12 | |
---|
13 | pkgconfigdir = $(libdir)/pkgconfig |
---|
14 | pkgconfig_DATA = dspam.pc |
---|
15 | etcdir = $(sysconfdir) |
---|
16 | etc_SCRIPTS = dspam_conf |
---|
17 | libversion = 7:0:0 |
---|
18 | |
---|
19 | # Defaults from dspam.conf |
---|
20 | |
---|
21 | EXTRA_DIST = example.c dspam.pc.in dspam-uninstalled.pc.in dspam.conf.in |
---|
22 | |
---|
23 | CLEANFILES = dspam.conf |
---|
24 | |
---|
25 | MAINTAINERCLEANFILES = Makefile.in aclocal.m4 auto-config.h.in \ |
---|
26 | config.guess config.sub configure depcomp install-sh \ |
---|
27 | ltmain.sh missing mkinstalldirs |
---|
28 | |
---|
29 | DEFS = @DEFS@ -DLOGDIR=\"$(logdir)\" \ |
---|
30 | -DCONFDIR=\"$(sysconfdir)\"\ |
---|
31 | -DCONFIG_DEFAULT=\"$(sysconfdir)/dspam.conf\"\ |
---|
32 | -D_THREAD_SAFE -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D_GNU_SOURCE |
---|
33 | |
---|
34 | lib_LTLIBRARIES = libdspam.la |
---|
35 | pkglib_LTLIBRARIES = |
---|
36 | |
---|
37 | if DYNAMIC_DRIVER |
---|
38 | if BUILD_HASH_DRV |
---|
39 | pkglib_LTLIBRARIES += libhash_drv.la |
---|
40 | endif |
---|
41 | if BUILD_MYSQL_DRV |
---|
42 | pkglib_LTLIBRARIES += libmysql_drv.la |
---|
43 | endif |
---|
44 | if BUILD_PGSQL_DRV |
---|
45 | pkglib_LTLIBRARIES += libpgsql_drv.la |
---|
46 | endif |
---|
47 | if BUILD_SQLITE_DRV |
---|
48 | pkglib_LTLIBRARIES += libsqlite_drv.la |
---|
49 | endif |
---|
50 | if BUILD_SQLITE3_DRV |
---|
51 | pkglib_LTLIBRARIES += libsqlite3_drv.la |
---|
52 | endif |
---|
53 | endif |
---|
54 | |
---|
55 | bin_PROGRAMS = dspam dspamc |
---|
56 | |
---|
57 | # installed for libdspam |
---|
58 | include_HEADERS = buffer.h config_shared.h decode.h error.h diction.h \ |
---|
59 | libdspam.h libdspam_objects.h nodetree.h tokenizer.h \ |
---|
60 | storage_driver.h heap.h config.h pref.h read_config.h |
---|
61 | |
---|
62 | if BUILD_EXT_LOOKUP |
---|
63 | include_HEADERS += external_lookup.h |
---|
64 | endif |
---|
65 | |
---|
66 | # libdspam.a contans objects common for dspam and tools/* binaries |
---|
67 | libdspam_la_SOURCES = \ |
---|
68 | config.h libdspam_objects.h \ |
---|
69 | libdspam.c libdspam.h \ |
---|
70 | heap.c heap.h \ |
---|
71 | diction.c diction.h \ |
---|
72 | base64.c base64.h \ |
---|
73 | buffer.c buffer.h \ |
---|
74 | util.c util.h \ |
---|
75 | nodetree.c nodetree.h \ |
---|
76 | error.c error.h \ |
---|
77 | decode.c decode.h \ |
---|
78 | pref.c pref.h \ |
---|
79 | config_shared.c config_shared.h \ |
---|
80 | bnr.c bnr.h \ |
---|
81 | hash.c hash.h \ |
---|
82 | list.c list.h \ |
---|
83 | tokenizer.c tokenizer.h \ |
---|
84 | storage_driver.h |
---|
85 | |
---|
86 | if BUILD_EXT_LOOKUP |
---|
87 | libdspam_la_SOURCES += external_lookup.c external_lookup.h |
---|
88 | endif |
---|
89 | |
---|
90 | if DYNAMIC_DRIVER |
---|
91 | libdspam_la_SOURCES += storage_driver.c |
---|
92 | endif |
---|
93 | |
---|
94 | EXTRA_libdspam_la_SOURCES = \ |
---|
95 | mysql_drv.c mysql_drv.h \ |
---|
96 | pgsql_drv.c pgsql_drv.h \ |
---|
97 | sqlite_drv.c sqlite_drv.h \ |
---|
98 | sqlite3_drv.c sqlite3_drv.h |
---|
99 | |
---|
100 | #if STATIC_DRIVER |
---|
101 | #if BUILD_HASH_DRV |
---|
102 | #libdspam_la_SOURCES += libhash_drv.c libhash_drv.h |
---|
103 | #endif |
---|
104 | #if BUILD_MYSQL_DRV |
---|
105 | #libdspam_la_SOURCES += libmysql_drv.c libmysql_drv.h |
---|
106 | #endif |
---|
107 | #if BUILD_PGSQL_DRV |
---|
108 | #libdspam_la_SOURCES += libpgsql_drv.c libpgsql_drv.h |
---|
109 | #endif |
---|
110 | #if BUILD_SQLITE_DRV |
---|
111 | #libdspam_la_SOURCES += libsqlite_drv.c libsqlite_drv.h |
---|
112 | #endif |
---|
113 | #if BUILD_SQLITE3_DRV |
---|
114 | #libdspam_la_SOURCES += libsqlite3_drv.c libsqlite3_drv.h |
---|
115 | #endif |
---|
116 | #endif |
---|
117 | |
---|
118 | libdspam_la_LIBADD = $(adapter_objects) |
---|
119 | libdspam_la_LIBADD += -lm $(NETLIBS) $(DLLIBS) |
---|
120 | libdspam_la_DEPENDENCIES = $(adapter_objects) |
---|
121 | if BUILD_EXT_LOOKUP |
---|
122 | libdspam_la_LIBADD += $(external_lookup_libs) |
---|
123 | endif |
---|
124 | if STATIC_DRIVER |
---|
125 | libdspam_la_LIBADD += $(active_driver).lo |
---|
126 | libdspam_la_DEPENDENCIES += $(active_driver).lo |
---|
127 | endif |
---|
128 | |
---|
129 | # current:revision:age |
---|
130 | libdspam_la_LDFLAGS = -rpath '$(libdir)' -version-info $(libversion) |
---|
131 | |
---|
132 | if DYNAMIC_DRIVER |
---|
133 | |
---|
134 | libmysql_drv_la_SOURCES = \ |
---|
135 | mysql_drv.c mysql_drv.h |
---|
136 | libmysql_drv_la_LIBADD = $(libmysql_drv_libs) -L. -ldspam |
---|
137 | libmysql_drv_la_CPPFLAGS = $(libmysql_drv_cppflags) |
---|
138 | libmysql_drv_la_LDFLAGS = $(libmysql_drv_ldflags) |
---|
139 | libmysql_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion) |
---|
140 | libmysql_drv_la_DEPENDENCIES = libdspam.la |
---|
141 | |
---|
142 | libpgsql_drv_la_SOURCES = \ |
---|
143 | pgsql_drv.c pgsql_drv.h |
---|
144 | libpgsql_drv_la_LIBADD = $(libpgsql_drv_libs) -L. -ldspam |
---|
145 | libpgsql_drv_la_CPPFLAGS = $(libpgsql_drv_cppflags) |
---|
146 | libpgsql_drv_la_LDFLAGS = $(libpgsql_drv_ldflags) |
---|
147 | libpgsql_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion) |
---|
148 | libpgsql_drv_la_DEPENDENCIES = libdspam.la |
---|
149 | |
---|
150 | libsqlite_drv_la_SOURCES = \ |
---|
151 | sqlite_drv.c sqlite_drv.h |
---|
152 | libsqlite_drv_la_LIBADD = $(libsqlite_drv_libs) -L. -ldspam |
---|
153 | libsqlite_drv_la_CPPFLAGS = $(libsqlite_drv_cppflags) |
---|
154 | libsqlite_drv_la_LDFLAGS = $(libsqlite_drv_ldflags) |
---|
155 | libsqlite_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion) |
---|
156 | libsqlite_drv_la_DEPENDENCIES = libdspam.la |
---|
157 | |
---|
158 | libsqlite3_drv_la_SOURCES = \ |
---|
159 | sqlite3_drv.c sqlite3_drv.h |
---|
160 | libsqlite3_drv_la_LIBADD = $(libsqlite3_drv_libs) -L. -ldspam |
---|
161 | libsqlite3_drv_la_CPPFLAGS = $(libsqlite3_drv_cppflags) |
---|
162 | libsqlite3_drv_la_LDFLAGS = $(libsqlite3_drv_ldflags) |
---|
163 | libsqlite3_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion) |
---|
164 | libsqlite3_drv_la_DEPENDENCIES = libdspam.la |
---|
165 | |
---|
166 | libhash_drv_la_SOURCES = \ |
---|
167 | hash_drv.c hash_drv.h |
---|
168 | libhash_drv_la_LIBADD = $(libhash_drv_libs) -L. -ldspam |
---|
169 | libhash_drv_la_CPPFLAGS = $(libhash_drv_cppflags) |
---|
170 | libhash_drv_la_LDFLAGS = $(libhash_drv_ldflags) |
---|
171 | libhash_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion) |
---|
172 | libhash_drv_la_DEPENDENCIES = libdspam.la |
---|
173 | |
---|
174 | endif |
---|
175 | |
---|
176 | dspam_SOURCES = \ |
---|
177 | config.h libdspam.h language.h \ |
---|
178 | dspam.c dspam.h \ |
---|
179 | buffer.h storage_driver.h \ |
---|
180 | read_config.c read_config.h \ |
---|
181 | config_api.c config_api.h \ |
---|
182 | daemon.c daemon.h \ |
---|
183 | client.c client.h \ |
---|
184 | agent_shared.c agent_shared.h |
---|
185 | |
---|
186 | dspam_LDADD = -lm libdspam.la |
---|
187 | dspam_DEPENDENCIES = libdspam.la |
---|
188 | |
---|
189 | dspamc_SOURCES = \ |
---|
190 | config.h language.h \ |
---|
191 | dspamc.c dspamc.h \ |
---|
192 | buffer.h error.h \ |
---|
193 | read_config.c read_config.h \ |
---|
194 | client.c client.h \ |
---|
195 | agent_shared.c agent_shared.h |
---|
196 | |
---|
197 | dspamc_LDADD = -lm buffer.o config_shared.o error.o pref.o nodetree.o util.o $(NETLIBS) $(DLLIBS) |
---|
198 | dspamc_LDFLAGS = |
---|
199 | dspamc_DEPENDENCIES = buffer.o config_shared.o error.o pref.o nodetree.o util.o |
---|
200 | |
---|
201 | # Failing of chgrp is expected and normal case when someone do |
---|
202 | # make install DESTDIR=... |
---|
203 | # from user other than root (from user not included in the `mail' group |
---|
204 | # is exactly), and only after this and after checking what was installed |
---|
205 | # changes ownership. |
---|
206 | # |
---|
207 | # Caveat: creating the $(dspam_home) in the install-exec-hook is not the |
---|
208 | # right way, but for some (unknown to me) reason `installdirs-local' |
---|
209 | # target have no chances to be executed under automake-1.7.3 (at least). |
---|
210 | # |
---|
211 | # Solaris' ln seems to have a problem with -sf and existing symlinks. |
---|
212 | install-exec-hook: |
---|
213 | -if test ! -d $(DESTDIR)$(sysconfdir); then \ |
---|
214 | mkdir -p $(DESTDIR)$(sysconfdir); \ |
---|
215 | chmod 755 $(DESTDIR)$(sysconfdir); \ |
---|
216 | fi |
---|
217 | -if test ! -f $(DESTDIR)$(sysconfdir)/dspam.conf; then \ |
---|
218 | cp dspam.conf $(DESTDIR)$(sysconfdir)/dspam.conf; \ |
---|
219 | chmod 640 $(DESTDIR)$(sysconfdir)/dspam.conf; \ |
---|
220 | chown "$(dspam_owner)" $(DESTDIR)$(sysconfdir)/dspam.conf; \ |
---|
221 | chgrp "$(dspam_group)" $(DESTDIR)$(sysconfdir)/dspam.conf; \ |
---|
222 | fi |
---|
223 | -if test x"$(dspam_owner)" != xnone; then \ |
---|
224 | chown "$(dspam_owner)" $(DESTDIR)$(bindir)/dspam; \ |
---|
225 | fi |
---|
226 | -if test x"$(dspam_group)" != xnone; then \ |
---|
227 | chgrp "$(dspam_group)" $(DESTDIR)$(bindir)/dspam; \ |
---|
228 | fi |
---|
229 | -if test x"$(dspam_mode)" != xnone; then \ |
---|
230 | chmod "$(dspam_mode)" $(DESTDIR)$(bindir)/dspam; \ |
---|
231 | fi |
---|
232 | -if test ! -d $(DESTDIR)$(dspam_home); then \ |
---|
233 | $(mkinstalldirs) $(DESTDIR)$(dspam_home); \ |
---|
234 | if test x"$(dspam_home_owner)" != xnone; then \ |
---|
235 | chown "$(dspam_home_owner)" $(DESTDIR)$(dspam_home); \ |
---|
236 | fi; \ |
---|
237 | if test x"$(dspam_home_group)" != xnone; then \ |
---|
238 | chgrp "$(dspam_home_group)" $(DESTDIR)$(dspam_home); \ |
---|
239 | fi; \ |
---|
240 | if test x"$(dspam_home_mode)" != xnone; then \ |
---|
241 | chmod "$(dspam_home_mode)" $(DESTDIR)$(dspam_home); \ |
---|
242 | fi; \ |
---|
243 | fi |
---|
244 | -if test ! -d $(DESTDIR)$(logdir); then \ |
---|
245 | $(mkinstalldirs) $(DESTDIR)$(logdir); \ |
---|
246 | if test x"$(dspam_home_owner)" != xnone; then \ |
---|
247 | chown "$(dspam_home_owner)" $(DESTDIR)$(logdir); \ |
---|
248 | fi; \ |
---|
249 | if test x"$(dspam_home_group)" != xnone; then \ |
---|
250 | chgrp "$(dspam_home_group)" $(DESTDIR)$(logdir); \ |
---|
251 | fi; \ |
---|
252 | if test x"$(dspam_home_mode)" != xnone; then \ |
---|
253 | chmod "$(dspam_home_mode)" $(DESTDIR)$(logdir); \ |
---|
254 | fi; \ |
---|
255 | fi |
---|
256 | |
---|
257 | ACLOCAL_AMFLAGS = -I m4 |
---|
258 | |
---|
259 | sed_substitute_variables = \ |
---|
260 | dspam_transformed=`echo dspam | sed '$(transform)'`; \ |
---|
261 | sed -e 's,@dspam_home\@,$(dspam_home),g' \ |
---|
262 | -e 's,@delivery_agent\@,$(delivery_agent),g' \ |
---|
263 | -e 's,@storage_driver\@,lib$(active_driver).so,g' \ |
---|
264 | -e 's,@libdir\@,$(libdir),g' |
---|
265 | |
---|
266 | dspam_conf: dspam.conf.in Makefile |
---|
267 | ${sed_substitute_variables} < $(srcdir)/dspam.conf.in > dspam.conf |
---|
268 | |
---|