File: Makefile.am

package info (click to toggle)
dspam 3.10.1+dfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,656 kB
  • sloc: ansic: 26,034; sh: 12,546; perl: 5,469; makefile: 690; sql: 379
file content (268 lines) | stat: -rw-r--r-- 8,352 bytes parent folder | download
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
# $Id: Makefile.am,v 1.50 2010/11/30 09:01:56 sbajic Exp $
#
# autoconf (GNU Autoconf) 2.59
# ltmain.sh (GNU libtool) 1.5.6
# automake (GNU automake) 1.9.2

includedir=@includedir@/dspam

SUBDIRS = . tools $(storage_drv_subdirs) 
DIST_SUBDIRS = . \
	tools.mysql_drv tools.pgsql_drv tools.sqlite_drv tools.hash_drv tools 

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = dspam.pc
etcdir = $(sysconfdir)
etc_SCRIPTS = dspam_conf
libversion = 7:0:0

# Defaults from dspam.conf

EXTRA_DIST = example.c dspam.pc.in dspam-uninstalled.pc.in dspam.conf.in 

CLEANFILES = dspam.conf

MAINTAINERCLEANFILES = Makefile.in aclocal.m4 auto-config.h.in \
	config.guess config.sub configure depcomp install-sh   \
	ltmain.sh missing mkinstalldirs

DEFS = @DEFS@ -DLOGDIR=\"$(logdir)\" \
       -DCONFDIR=\"$(sysconfdir)\"\
       -DCONFIG_DEFAULT=\"$(sysconfdir)/dspam.conf\"\
       -D_THREAD_SAFE -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D_GNU_SOURCE

lib_LTLIBRARIES = libdspam.la
pkglib_LTLIBRARIES =

if DYNAMIC_DRIVER
if BUILD_HASH_DRV
pkglib_LTLIBRARIES += libhash_drv.la
endif
if BUILD_MYSQL_DRV
pkglib_LTLIBRARIES += libmysql_drv.la
endif
if BUILD_PGSQL_DRV
pkglib_LTLIBRARIES += libpgsql_drv.la
endif
if BUILD_SQLITE_DRV
pkglib_LTLIBRARIES += libsqlite_drv.la
endif
if BUILD_SQLITE3_DRV
pkglib_LTLIBRARIES += libsqlite3_drv.la
endif
endif

bin_PROGRAMS = dspam dspamc

# installed for libdspam
include_HEADERS = buffer.h config_shared.h decode.h error.h diction.h \
	libdspam.h libdspam_objects.h nodetree.h tokenizer.h \
	storage_driver.h heap.h config.h pref.h read_config.h

if BUILD_EXT_LOOKUP
include_HEADERS += external_lookup.h
endif

# libdspam.a contans objects common for dspam and tools/* binaries
libdspam_la_SOURCES = \
	config.h libdspam_objects.h \
	libdspam.c libdspam.h \
	heap.c heap.h \
	diction.c diction.h \
	base64.c base64.h \
	buffer.c buffer.h \
	util.c util.h \
	nodetree.c nodetree.h \
	error.c error.h \
	decode.c decode.h \
	pref.c pref.h \
	config_shared.c config_shared.h \
	bnr.c bnr.h \
	hash.c hash.h \
	list.c list.h \
	tokenizer.c tokenizer.h \
	storage_driver.h

if BUILD_EXT_LOOKUP
libdspam_la_SOURCES += external_lookup.c external_lookup.h
endif

if DYNAMIC_DRIVER
libdspam_la_SOURCES += storage_driver.c
endif

EXTRA_libdspam_la_SOURCES = \
	mysql_drv.c mysql_drv.h \
	pgsql_drv.c pgsql_drv.h \
	sqlite_drv.c sqlite_drv.h \
	sqlite3_drv.c sqlite3_drv.h

#if STATIC_DRIVER
#if BUILD_HASH_DRV
#libdspam_la_SOURCES += libhash_drv.c libhash_drv.h
#endif
#if BUILD_MYSQL_DRV
#libdspam_la_SOURCES += libmysql_drv.c libmysql_drv.h
#endif
#if BUILD_PGSQL_DRV
#libdspam_la_SOURCES += libpgsql_drv.c libpgsql_drv.h
#endif
#if BUILD_SQLITE_DRV
#libdspam_la_SOURCES += libsqlite_drv.c libsqlite_drv.h
#endif
#if BUILD_SQLITE3_DRV
#libdspam_la_SOURCES += libsqlite3_drv.c libsqlite3_drv.h
#endif
#endif

libdspam_la_LIBADD = $(adapter_objects)
libdspam_la_LIBADD += -lm $(NETLIBS) $(DLLIBS)
libdspam_la_DEPENDENCIES = $(adapter_objects)
if BUILD_EXT_LOOKUP
libdspam_la_LIBADD += $(external_lookup_libs)
endif
if STATIC_DRIVER
libdspam_la_LIBADD += $(active_driver).lo
libdspam_la_DEPENDENCIES += $(active_driver).lo
endif

#   current:revision:age
libdspam_la_LDFLAGS = -rpath '$(libdir)' -version-info $(libversion)

if DYNAMIC_DRIVER

libmysql_drv_la_SOURCES = \
	mysql_drv.c mysql_drv.h 
libmysql_drv_la_LIBADD = $(libmysql_drv_libs) -L. -ldspam
libmysql_drv_la_CPPFLAGS = $(libmysql_drv_cppflags)
libmysql_drv_la_LDFLAGS = $(libmysql_drv_ldflags)
libmysql_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion) 
libmysql_drv_la_DEPENDENCIES = libdspam.la

libpgsql_drv_la_SOURCES = \
	pgsql_drv.c pgsql_drv.h 
libpgsql_drv_la_LIBADD = $(libpgsql_drv_libs) -L. -ldspam
libpgsql_drv_la_CPPFLAGS = $(libpgsql_drv_cppflags)
libpgsql_drv_la_LDFLAGS = $(libpgsql_drv_ldflags)
libpgsql_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion)
libpgsql_drv_la_DEPENDENCIES = libdspam.la

libsqlite_drv_la_SOURCES = \
	sqlite_drv.c sqlite_drv.h 
libsqlite_drv_la_LIBADD = $(libsqlite_drv_libs) -L. -ldspam
libsqlite_drv_la_CPPFLAGS = $(libsqlite_drv_cppflags)
libsqlite_drv_la_LDFLAGS = $(libsqlite_drv_ldflags)
libsqlite_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion)
libsqlite_drv_la_DEPENDENCIES = libdspam.la

libsqlite3_drv_la_SOURCES = \
	sqlite3_drv.c sqlite3_drv.h 
libsqlite3_drv_la_LIBADD = $(libsqlite3_drv_libs) -L. -ldspam
libsqlite3_drv_la_CPPFLAGS = $(libsqlite3_drv_cppflags)
libsqlite3_drv_la_LDFLAGS = $(libsqlite3_drv_ldflags)
libsqlite3_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion)
libsqlite3_drv_la_DEPENDENCIES = libdspam.la

libhash_drv_la_SOURCES = \
	hash_drv.c hash_drv.h
libhash_drv_la_LIBADD = $(libhash_drv_libs) -L. -ldspam
libhash_drv_la_CPPFLAGS = $(libhash_drv_cppflags)
libhash_drv_la_LDFLAGS = $(libhash_drv_ldflags)
libhash_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion)
libhash_drv_la_DEPENDENCIES = libdspam.la

endif

dspam_SOURCES = \
	config.h libdspam.h language.h \
	dspam.c dspam.h \
	buffer.h storage_driver.h \
	read_config.c read_config.h \
	config_api.c config_api.h \
	daemon.c daemon.h \
	client.c client.h \
	agent_shared.c agent_shared.h

dspam_LDADD = -lm libdspam.la
dspam_DEPENDENCIES = libdspam.la

dspamc_SOURCES = \
	config.h language.h \
	dspamc.c dspamc.h \
	buffer.h error.h \
	read_config.c read_config.h \
	client.c client.h \
	agent_shared.c agent_shared.h 

dspamc_LDADD = -lm buffer.o config_shared.o error.o pref.o nodetree.o util.o $(NETLIBS) $(DLLIBS)
dspamc_LDFLAGS = 
dspamc_DEPENDENCIES = buffer.o config_shared.o error.o pref.o nodetree.o util.o

# Failing of chgrp is expected and normal case when someone do
#   make install DESTDIR=...
# from user other than root (from user not included in the `mail' group
# is exactly), and only after this and after checking what was installed
# changes ownership.
#
# Caveat: creating the $(dspam_home) in the install-exec-hook is not the
# right way, but for some (unknown to me) reason `installdirs-local'
# target have no chances to be executed under automake-1.7.3 (at least).
#
# Solaris' ln seems to have a problem with -sf and existing symlinks.
install-exec-hook:
	-if test ! -d $(DESTDIR)$(sysconfdir); then \
		mkdir -p $(DESTDIR)$(sysconfdir); \
		chmod 755 $(DESTDIR)$(sysconfdir); \
	fi
	-if test ! -f $(DESTDIR)$(sysconfdir)/dspam.conf; then \
		cp dspam.conf $(DESTDIR)$(sysconfdir)/dspam.conf; \
		chmod 640 $(DESTDIR)$(sysconfdir)/dspam.conf; \
		chown "$(dspam_owner)" $(DESTDIR)$(sysconfdir)/dspam.conf; \
		chgrp "$(dspam_group)" $(DESTDIR)$(sysconfdir)/dspam.conf; \
	fi
	-if test x"$(dspam_owner)" != xnone; then \
                chown "$(dspam_owner)" $(DESTDIR)$(bindir)/dspam; \
        fi
	-if test x"$(dspam_group)" != xnone; then \
                chgrp "$(dspam_group)" $(DESTDIR)$(bindir)/dspam; \
        fi
	-if test x"$(dspam_mode)" != xnone; then \
                chmod "$(dspam_mode)" $(DESTDIR)$(bindir)/dspam; \
	fi
	-if test ! -d $(DESTDIR)$(dspam_home); then \
                $(mkinstalldirs) $(DESTDIR)$(dspam_home); \
		if test x"$(dspam_home_owner)" != xnone; then \
	        	chown "$(dspam_home_owner)" $(DESTDIR)$(dspam_home); \
	        fi; \
		if test x"$(dspam_home_group)" != xnone; then \
	                chgrp "$(dspam_home_group)" $(DESTDIR)$(dspam_home); \
	        fi; \
		if test x"$(dspam_home_mode)" != xnone; then \
	                chmod "$(dspam_home_mode)" $(DESTDIR)$(dspam_home); \
	        fi; \
	fi
	-if test ! -d $(DESTDIR)$(logdir); then \
		$(mkinstalldirs) $(DESTDIR)$(logdir); \
		if test x"$(dspam_home_owner)" != xnone; then \
			chown "$(dspam_home_owner)" $(DESTDIR)$(logdir); \
		fi; \
		if test x"$(dspam_home_group)" != xnone; then \
			chgrp "$(dspam_home_group)" $(DESTDIR)$(logdir); \
		fi; \
		if test x"$(dspam_home_mode)" != xnone; then \
			chmod "$(dspam_home_mode)" $(DESTDIR)$(logdir); \
		fi; \
	fi

ACLOCAL_AMFLAGS = -I m4

sed_substitute_variables = \
        dspam_transformed=`echo dspam | sed '$(transform)'`; \
        sed -e 's,@dspam_home\@,$(dspam_home),g' \
            -e 's,@delivery_agent\@,$(delivery_agent),g' \
            -e 's,@storage_driver\@,lib$(active_driver).so,g' \
            -e 's,@libdir\@,$(libdir),g'

dspam_conf: dspam.conf.in Makefile
	${sed_substitute_variables} < $(srcdir)/dspam.conf.in > dspam.conf