ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/mports/trunk/mail/sendmail/bsd.milter.mk
Revision: 16841
Committed: Sat Sep 6 20:01:22 2014 UTC (7 years, 8 months ago) by laffer1
File size: 2611 byte(s)
Log Message:
update milter handling.

File Contents

# Content
1 # makefile for use of: sendmail milter lib
2 # Date created: 08 Nov 2006
3 # Whom: dinoex
4 #
5 # $FreeBSD: ports/mail/sendmail/bsd.milter.mk,v 1.2 2007/02/02 20:17:17 dinoex Exp $
6 # $MidnightBSD: mports/mail/sendmail/bsd.milter.mk,v 1.2 2007/11/06 04:26:20 laffer1 Exp $
7 #
8 # a port shall includes this file after bsd.ports.pre.mk
9 # .include "${PORTSDIR}/${PKGCATEGORY}/sendmail/bsd.milter.mk"
10 #
11 # the user/port can now set this options in the makefiles.
12 #
13 # WITH_SENDMAIL_STATIC_MILTER= - Use static milter lib
14 #
15 # WITH_SENDMAIL_BASE=yes - Use milter in the base
16 # WITH_SENDMAIL_PORT=yes - Use milter from ports
17 #
18 # If unspecified, check for the lib exits in the base system,
19 # but give an installed port preference over it.
20 #
21 #
22 # Overrideable defaults:
23 #
24 # SENDMAIL_MILTER_PORT?= sendmail
25 #
26 # The makefile sets this variables:
27 # MILTERBASE - "/usr" or ${LOCALBASE}
28 # MILTERINC - path to the matching includes
29 # MILTERLIB - path to the libs
30 # MILTERRPATH - rpath for dynamic linker
31 #
32 # The makefile extend this variables:
33 # LIB_DEPENDS
34 # BUILD_DEPENDS
35 # CFLAGS
36 # LDFLAGS
37 #
38 # MAKE_ENV - extended with the variables above
39 # CONFIGURE_ENV - extended with LDFLAGS
40 # BUILD_DEPENDS - are added if needed
41 # RUN_DEPENDS - are added if needed
42
43 Milter_Include_MAINTAINER= ports@MidnightBSD.org
44
45 .if !defined(WITH_SENDMAIL_BASE) && \
46 !defined(WITH_SENDMAIL_PORT)
47 .if exists(${LOCALBASE}/lib/libmilter.a) || \
48 !exists(/usr/lib/libmilter.a)
49 WITH_SENDMAIL_PORT=yes
50 .else
51 WITH_SENDMAIL_BASE=yes
52 .endif
53 .endif
54
55 .if defined(WITH_SENDMAIL_PORT)
56
57 .if defined(WITH_SENDMAIL_STATIC_MILTER)
58 BUILD_DEPENDS+= ${LOCALBASE}/lib/libmilter.a:${PORTSDIR}/mail/${SENDMAIL_MILTER_PORT}
59 .else
60 BUILD_DEPENDS+= ${LOCALBASE}/lib/libmilter.so.${MILTER_SOVER}:${PORTSDIR}/mail/${SENDMAIL_MILTER_PORT}
61 RUN_DEPENDS+= ${LOCALBASE}/lib/libmilter.so.${MILTER_SOVER}:${PORTSDIR}/mail/${SENDMAIL_MILTER_PORT}
62 .endif
63
64 SENDMAIL_MILTER_PORT?= sendmail
65 MILTER_SOVER?= 6
66 MILTERBASE?= ${LOCALBASE}
67 MILTERINC= -I${MILTERBASE}/include
68 MILTERRPATH= ${MILTERBASE}/lib
69 MILTERLIB= -L${MILTERBASE}/lib -Wl,-rpath,${MILTERRPATH}
70
71 .if !defined(WITHOUT_MILTER_CFLAGS)
72 .if defined(CFLAGS)
73 CFLAGS+=${MILTERINC}
74 .else
75 CFLAGS=${MILTERINC}
76 .endif
77 .endif
78
79 .if defined(WITHOUT_MILTER)
80 pre-everything::
81 @${ECHO_MSG}
82 @${ECHO_MSG} You must unset variable SENDMAIL_WITHOUT_MILTER,
83 @${ECHO_MSG} and rebuild sendmail in the ports
84 @${FALSE}
85 .endif
86
87 .endif
88
89 .if defined(WITH_SENDMAIL_BASE)
90 MILTERBASE?= /usr
91 MILTERRPATH= ${DESTDIR}/usr/lib:${LOCALBASE}/lib
92 MILTERLIB= -Wl,-rpath,${MILTERRPATH}
93 .endif
94
95 .if !defined(WITHOUT_MILTER_LDFLAGS)
96 LDFLAGS+=${MILTERLIB}
97 .endif
98
99 # eof