update Sun Jan 17 06:37:00 PST 2010
[pkgsrc.git] / wip / fdm / Makefile
1 # $NetBSD$
2
3 DISTNAME=       fdm-1.6
4 PKGREVISION=    1
5 CATEGORIES=     mail
6 MASTER_SITES=   ${MASTER_SITE_SOURCEFORGE:=fdm/}
7
8 MAINTAINER=     clamiax@gmail.com
9 HOMEPAGE=       http://fdm.sourceforge.net/
10 COMMENT=        Mail fetching, filtering and delivering program
11
12 PKG_DESTDIR_SUPPORT=    user-destdir
13 NO_CONFIGURE=           yes
14
15 # Makefile
16 SUBST_CLASSES+=         makefile
17 SUBST_STAGE.makefile=   pre-build
18 SUBST_MESSAGE.makefile= Fixing distribution Makefile...
19 SUBST_FILES.makefile=   ${MAKE_FILE}
20 SUBST_SED.makefile=     -e 's/ -I-//'
21 SUBST_SED.makefile+=    -e "s,/man/,/${PKGMANDIR}/,"
22 SUBST_SED.makefile+=    -e 's/-g bin -o root/-o ${BINOWN} -g ${BINGRP}/'
23
24 #
25 # Linux-dependant changes.
26 #
27 .include "../../mk/bsd.prefs.mk" # This defines ${OPSYS}
28 .if ${OPSYS} == "Linux"
29 SUBST_SED.makefile+=    -e 's|^SRCS=.*.c|& compat/strlcpy.c compat/strlcat.c compat/strtonum.c|'
30
31 CFLAGS+= -DNO_STRLCPY -DNO_STRLCAT -DNO_STRTONUM -D_GNU_SOURCE
32 CFLAGS+= -DNO_SETRESUID -DNO_SETRESGID -DNO_SETPROCTITLE -DNO_QUEUE_H -DNO_TREE_H
33 LDFLAGS+= -lresolv
34 .endif
35
36 #
37 # Paths
38 SUBST_CLASSES+=         paths
39 SUBST_STAGE.paths=      pre-build
40 SUBST_MESSAGE.paths=    Fixing common paths..
41 SUBST_FILES.paths=      fdm.h fdm.1 fdm.conf.5 MANUAL examples/f-terbeck.conf
42 SUBST_SED.paths=        -e "s,/etc,${PKG_SYSCONFDIR},"
43
44 ##
45 # Options
46 ##
47 PKG_OPTIONS_VAR=        PKG_OPTIONS.fdm
48 PKG_SUPPORTED_OPTIONS=  pcre courier-auth
49 PKG_SUGGESTED_OPTIONS=  pcre
50
51 # Options handling framework
52 .include "../../mk/bsd.options.mk"
53
54 # COURIER
55 .if !empty(PKG_OPTIONS:Mcourier-auth)
56 .include "../../security/courier-authlib/buildlink3.mk"
57 CFLAGS+= -DCOURIER
58 .endif
59
60 # PCRE
61 .if !empty(PKG_OPTIONS:Mpcre)
62 .include "../../devel/pcre/buildlink3.mk"
63 CFLAGS+= -DPCRE
64 LDFLAGS+= -lpcre
65 .endif
66
67 ##
68 # Installation directories and configuration files
69 ##
70 EGDIR=                  ${PREFIX}/share/examples/${PKGBASE}
71 INSTALLATION_DIRS=      bin share/examples ${PKGMANDIR}/man1 ${PKGMANDIR}/man5 ${EGDIR}
72 CONF_FILES=             ${EGDIR}/fdm.conf.sample ${PKG_SYSCONFDIR}/fdm.conf
73
74 # Sample configuration files
75 post-install:
76         ${INSTALL_DATA} ${FILESDIR}/fdm.conf ${DESTDIR}${EGDIR}/fdm.conf.sample
77         ${INSTALL_DATA} ${WRKSRC}/examples/* ${DESTDIR}${EGDIR}
78
79 .include "../../databases/tdb/buildlink3.mk"
80 .include "../../security/openssl/buildlink3.mk"
81 .include "../../mk/bsd.pkg.mk"