summaryrefslogtreecommitdiff
path: root/security/courier-authlib/Makefile
blob: f884cac66936b015835d61a69a64c755d7f2aa0f (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
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
# $NetBSD: Makefile,v 1.28 2008/02/18 20:26:33 jlam Exp $

.include "Makefile.common"

DISTNAME=	courier-authlib-0.60.2
PKGREVISION=	1
CATEGORIES=	security
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=courier/}
EXTRACT_SUFX=	.tar.bz2

MAINTAINER=	jlam@pkgsrc.org
COMMENT=	Courier Authentication Library
HOMEPAGE=	http://www.courier-mta.org/authlib/

CONFLICTS+=	courier-auth-[0-9]*
CONFLICTS+=	courier-authldap-[0-9]*
CONFLICTS+=	courier-authmysql-[0-9]*
CONFLICTS+=	courier-authpgsql-[0-9]*

#LICENSE=	gnu-gpl-v3

PKG_DESTDIR_SUPPORT=	user-destdir

USE_LIBTOOL=		yes
PKG_SYSCONFSUBDIR=	authlib

REPLACE_PERL=		samplepipe.pl sysconftool

USE_LANGUAGES=		c c++
USE_TOOLS+=		cat:run gmake perl:run
CONFIGURE_ENV+=		CAT=${TOOLS_CAT:Q}		# makedat

CONFIGURE_ARGS+=	--localstatedir=${VARBASE:Q}
CONFIGURE_ARGS+=	--with-pkgconfdir=${PKG_SYSCONFDIR:Q}
CONFIGURE_ARGS+=	--without-stdheaderdir

AUTHDAEMONVAR?=		${VARBASE}/authdaemon
CONFIGURE_ARGS+=	--with-authdaemonvar=${AUTHDAEMONVAR:Q}
OWN_DIRS_PERMS=		${AUTHDAEMONVAR} ${COURIER_USER} ${COURIER_GROUP} 0750
FILES_SUBST+=		AUTHDAEMONVAR=${AUTHDAEMONVAR:Q}

# Expect is used to change the password from within the courier webmail
# application (sqwebmail).  Assume that it's installed in the same prefix
# as courier-authlib.
#
CONFIGURE_ENV+=		EXPECT=${PREFIX:Q}/bin/expect
CHECK_INTERPRETER_SKIP=	libexec/courier-authlib/authsystem.passwd

AUTHLIBDIR=		lib/courier-authlib
AUTHLIBEXECDIR=		libexec/courier-authlib
AUTHEXAMPLEDIR=		share/examples/courier-authlib
AUTHDOCDIR=		share/doc/courier-authlib
FILES_SUBST+=		AUTHLIBEXECDIR=${AUTHLIBEXECDIR:Q}
FILES_SUBST+=		AUTHEXAMPLEDIR=${AUTHEXAMPLEDIR:Q}

PKG_SYSCONFSUBDIR?=	courier

EGDIR=			${PREFIX}/${AUTHEXAMPLEDIR}
DOCDIR=			${PREFIX}/${AUTHDOCDIR}
RCD_SCRIPTS=		authdaemond
GEN_FILES=		authdaemonrc
FILES_SUBST+=		GEN_FILES=${GEN_FILES:Q}
AUTHLIB_PLIST=		${AUTHEXAMPLEDIR}/authdaemonrc.dist

# Install the example config files into ${EGDIR}.
INSTALL_AM_MAKEFLAGS=	authdaemonrc=${EGDIR}/authdaemonrc		\
			authldaprc=${EGDIR}/authldaprc			\
			authmysqlrc=${EGDIR}/authmysqlrc		\
			authpgsqlrc=${EGDIR}/authpgsqlrc
INSTALL_MAKE_FLAGS=	${MAKE_FLAGS}					\
			AM_MAKEFLAGS=${INSTALL_AM_MAKEFLAGS:Q}

POST_INSTALL_TARGETS=	post-install-common post-install-authdaemon

.include "options.mk"
.include "../../devel/libltdl/buildlink3.mk"

.for _file_ in ${GEN_FILES}
CONF_FILES_PERMS+=	${EGDIR}/${_file_}.dist ${PKG_SYSCONFDIR}/${_file_} \
			${COURIER_USER} ${COURIER_GROUP} 0660
.endfor

.for _file_ in ${AUTHLIB_PLIST}
GENERATE_PLIST+=	${TEST} -f ${DESTDIR}${PREFIX}/${_file_} &&	\
			${ECHO} "${_file_}";
.endfor
.if !empty(AUTHLIB_PLIST:M${AUTHEXAMPLEDIR}/*)
GENERATE_PLIST+=	${ECHO} "@dirrm ${AUTHEXAMPLEDIR}";
.endif
GENERATE_PLIST+=	${ECHO} "@dirrm ${AUTHDOCDIR}";
GENERATE_PLIST+=	${ECHO} "@dirrm ${AUTHLIBEXECDIR}";
GENERATE_PLIST+=	${ECHO} "@dirrm ${AUTHLIBDIR}";

INSTALLATION_DIRS=	bin sbin

post-install: ${POST_INSTALL_TARGETS}

post-install-common:
	${INSTALL_DATA_DIR} ${DESTDIR}${EGDIR}
	${INSTALL_SCRIPT} ${WRKSRC}/sysconftool ${DESTDIR}${PREFIX}/sbin
	${INSTALL_DATA_DIR} ${DESTDIR}${DOCDIR}
	${INSTALL_DATA} ${WRKSRC}/INSTALL.html ${DESTDIR}${DOCDIR}
	${INSTALL_DATA} ${WRKSRC}/README.authdebug.html ${DESTDIR}${DOCDIR}
	${INSTALL_DATA} ${WRKSRC}/README.html ${DESTDIR}${DOCDIR}
	${INSTALL_DATA} ${WRKSRC}/README_authlib.html ${DESTDIR}${DOCDIR}

post-install-authdaemon:
	${CHOWN} ${SHAREOWN}:${SHAREGRP} ${DESTDIR}${EGDIR}/authdaemonrc.dist
	${CHMOD} ${SHAREMODE} ${DESTDIR}${EGDIR}/authdaemonrc.dist

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