source: npl/mailserver/dspam/dspam-3.10.2/src/Makefile.am @ c5c522c

gcc484ntopperl-5.22
Last change on this file since c5c522c was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 8.2 KB
RevLine 
[c5c522c]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
7includedir=@includedir@/dspam
8
9SUBDIRS = . tools $(storage_drv_subdirs)
10DIST_SUBDIRS = . \
11        tools.mysql_drv tools.pgsql_drv tools.sqlite_drv tools.hash_drv tools
12
13pkgconfigdir = $(libdir)/pkgconfig
14pkgconfig_DATA = dspam.pc
15etcdir = $(sysconfdir)
16etc_SCRIPTS = dspam_conf
17libversion = 7:0:0
18
19# Defaults from dspam.conf
20
21EXTRA_DIST = example.c dspam.pc.in dspam-uninstalled.pc.in dspam.conf.in
22
23CLEANFILES = dspam.conf
24
25MAINTAINERCLEANFILES = Makefile.in aclocal.m4 auto-config.h.in \
26        config.guess config.sub configure depcomp install-sh   \
27        ltmain.sh missing mkinstalldirs
28
29DEFS = @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
34lib_LTLIBRARIES = libdspam.la
35pkglib_LTLIBRARIES =
36
37if DYNAMIC_DRIVER
38if BUILD_HASH_DRV
39pkglib_LTLIBRARIES += libhash_drv.la
40endif
41if BUILD_MYSQL_DRV
42pkglib_LTLIBRARIES += libmysql_drv.la
43endif
44if BUILD_PGSQL_DRV
45pkglib_LTLIBRARIES += libpgsql_drv.la
46endif
47if BUILD_SQLITE_DRV
48pkglib_LTLIBRARIES += libsqlite_drv.la
49endif
50if BUILD_SQLITE3_DRV
51pkglib_LTLIBRARIES += libsqlite3_drv.la
52endif
53endif
54
55bin_PROGRAMS = dspam dspamc
56
57# installed for libdspam
58include_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
62if BUILD_EXT_LOOKUP
63include_HEADERS += external_lookup.h
64endif
65
66# libdspam.a contans objects common for dspam and tools/* binaries
67libdspam_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
86if BUILD_EXT_LOOKUP
87libdspam_la_SOURCES += external_lookup.c external_lookup.h
88endif
89
90if DYNAMIC_DRIVER
91libdspam_la_SOURCES += storage_driver.c
92endif
93
94EXTRA_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
118libdspam_la_LIBADD = $(adapter_objects)
119libdspam_la_LIBADD += -lm $(NETLIBS) $(DLLIBS)
120libdspam_la_DEPENDENCIES = $(adapter_objects)
121if BUILD_EXT_LOOKUP
122libdspam_la_LIBADD += $(external_lookup_libs)
123endif
124if STATIC_DRIVER
125libdspam_la_LIBADD += $(active_driver).lo
126libdspam_la_DEPENDENCIES += $(active_driver).lo
127endif
128
129#   current:revision:age
130libdspam_la_LDFLAGS = -rpath '$(libdir)' -version-info $(libversion)
131
132if DYNAMIC_DRIVER
133
134libmysql_drv_la_SOURCES = \
135        mysql_drv.c mysql_drv.h
136libmysql_drv_la_LIBADD = $(libmysql_drv_libs) -L. -ldspam
137libmysql_drv_la_CPPFLAGS = $(libmysql_drv_cppflags)
138libmysql_drv_la_LDFLAGS = $(libmysql_drv_ldflags)
139libmysql_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion)
140libmysql_drv_la_DEPENDENCIES = libdspam.la
141
142libpgsql_drv_la_SOURCES = \
143        pgsql_drv.c pgsql_drv.h
144libpgsql_drv_la_LIBADD = $(libpgsql_drv_libs) -L. -ldspam
145libpgsql_drv_la_CPPFLAGS = $(libpgsql_drv_cppflags)
146libpgsql_drv_la_LDFLAGS = $(libpgsql_drv_ldflags)
147libpgsql_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion)
148libpgsql_drv_la_DEPENDENCIES = libdspam.la
149
150libsqlite_drv_la_SOURCES = \
151        sqlite_drv.c sqlite_drv.h
152libsqlite_drv_la_LIBADD = $(libsqlite_drv_libs) -L. -ldspam
153libsqlite_drv_la_CPPFLAGS = $(libsqlite_drv_cppflags)
154libsqlite_drv_la_LDFLAGS = $(libsqlite_drv_ldflags)
155libsqlite_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion)
156libsqlite_drv_la_DEPENDENCIES = libdspam.la
157
158libsqlite3_drv_la_SOURCES = \
159        sqlite3_drv.c sqlite3_drv.h
160libsqlite3_drv_la_LIBADD = $(libsqlite3_drv_libs) -L. -ldspam
161libsqlite3_drv_la_CPPFLAGS = $(libsqlite3_drv_cppflags)
162libsqlite3_drv_la_LDFLAGS = $(libsqlite3_drv_ldflags)
163libsqlite3_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion)
164libsqlite3_drv_la_DEPENDENCIES = libdspam.la
165
166libhash_drv_la_SOURCES = \
167        hash_drv.c hash_drv.h
168libhash_drv_la_LIBADD = $(libhash_drv_libs) -L. -ldspam
169libhash_drv_la_CPPFLAGS = $(libhash_drv_cppflags)
170libhash_drv_la_LDFLAGS = $(libhash_drv_ldflags)
171libhash_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion)
172libhash_drv_la_DEPENDENCIES = libdspam.la
173
174endif
175
176dspam_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
186dspam_LDADD = -lm libdspam.la
187dspam_DEPENDENCIES = libdspam.la
188
189dspamc_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
197dspamc_LDADD = -lm buffer.o config_shared.o error.o pref.o nodetree.o util.o $(NETLIBS) $(DLLIBS)
198dspamc_LDFLAGS =
199dspamc_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.
212install-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
257ACLOCAL_AMFLAGS = -I m4
258
259sed_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
266dspam_conf: dspam.conf.in Makefile
267        ${sed_substitute_variables} < $(srcdir)/dspam.conf.in > dspam.conf
268
Note: See TracBrowser for help on using the repository browser.