summaryrefslogtreecommitdiff
path: root/security/cyrus-saslauthd/Makefile
blob: 6df25a7369d56c6eb78e47919f29563a01ff94af (plain)
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
# $NetBSD: Makefile,v 1.4 2004/01/12 04:12:58 jlam Exp $

DISTNAME=	cyrus-sasl-2.1.17
PKGNAME=	${DISTNAME:S/sasl/saslauthd/}
CATEGORIES=	security
MASTER_SITES=	ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/ \
		ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/OLD-VERSIONS/sasl/

CONFLICTS+=	cyrus-sasl-[0-9]*

PKG_INSTALLATION_TYPES=	overwrite pkgviews

.include "../../mk/bsd.prefs.mk"

WRKSRC=			${WRKDIR}/${DISTNAME}/saslauthd
EXTRACT_ELEMENTS=	${DISTNAME}/saslauthd
EXTRACT_ELEMENTS+=	${DISTNAME}/include/hmac-md5.h

MAINTAINER=		jlam@NetBSD.org
HOMEPAGE=		http://asg.web.cmu.edu/sasl/
COMMENT=		Cyrus SASL plaintext authentication daemon

USE_BUILDLINK3=		yes
GNU_CONFIGURE=		yes
CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR}
PLIST_SRC=		${PKGDIR}/PLIST

BUILD_DEFS+=		USE_PAM USE_LDAP SASL_USE_GSSAPI

# /var/run/saslauthd matches the default value in configure.
SASLSOCKETDIR=		/var/run/saslauthd
FILES_SUBST+=		SASLSOCKETDIR=${SASLSOCKETDIR}
CONFIGURE_ARGS+=	--with-saslauthd="${SASLSOCKETDIR}"

.if defined(USE_PAM)
.  include "../../security/PAM/buildlink3.mk"
CONFIGURE_ARGS+=	--with-pam=${BUILDLINK_PREFIX.pam}
.endif

.if defined(USE_LDAP)
.  include "../../databases/openldap/buildlink3.mk"
.  include "../../security/openssl/buildlink3.mk"
CONFIGURE_ARGS+=	--with-ldap=${BUILDLINK_PREFIX.openldap}
CONFIGURE_ARGS+=	--with-openssl=${SSLBASE}
PLIST_SRC+=		${PKGDIR}/PLIST.ldap
.endif

.if defined(SASL_USE_GSSAPI) && !empty(SASL_USE_GSSAPI:M[yY][eE][sS])
CONFIGURE_ARGS+=	--enable-gssapi=/usr	# GSSAPI
.  if exists(/usr/include/krb5/krb5.h)
CPPFLAGS+=		-I/usr/include/krb5
.  endif
.endif

USE_PKGINSTALL=		yes
DEINSTALL_EXTRA_TMPL=	${PKGDIR}/DEINSTALL
RCD_SCRIPTS=		saslauthd
FILES_SUBST+=		ROOT_USER=${ROOT_USER}

post-configure:
	${LN} -sf saslauthd.h ${WRKSRC}/config.h

post-build:
	cd ${WRKSRC}; for f in LDAP_SASLAUTHD saslauthd.mdoc; do	\
		${SED}	-e "s|/usr/local/etc/|${PKG_SYSCONFDIR}/|g"	\
			$$f > $$f.new;					\
		${MV} -f $$f.new $$f;					\
	done

.if defined(USE_LDAP)
post-install:
	${INSTALL_DATA_DIR} ${PREFIX}/share/examples/cyrus-saslauthd
	${INSTALL_DATA} ${WRKSRC}/LDAP_SASLAUTHD \
		${PREFIX}/share/examples/cyrus-saslauthd
.endif

.include "../../mk/bsd.pkg.mk"