aboutsummaryrefslogtreecommitdiffstats
path: root/mail/qmail-activedir/Makefile
blob: bdf189d5e2da3e9ae625f9961c121cbe1fd59861 (plain) (blame)
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
# Created by: Jean Milanez Melo <jmelo@FreeBSD.org>
# $FreeBSD$

PORTNAME=   qmail-activedir
PORTVERSION=    0.17
PORTREVISION=   1
CATEGORIES= mail
MASTER_SITES=   http://fo2k.com/qmail-activedir/

MAINTAINER= ports@FreeBSD.org
COMMENT=    Programs to allow qmail to authenticate users through a MS ad

USES=       qmail:run
SUB_FILES=  pkg-message
SUB_LIST+=  QMAIL_PREFIX=${QMAIL_PREFIX}
USE_OPENLDAP=   yes

BINARIES=   checkadpassword qmail-adgetpw create_alias_files

CFLAGS+=    -I${LOCALBASE}/include -L${LOCALBASE}/lib -Wall -lldap

PLIST_FILES=    bin/checkadpassword \
        bin/create_alias_files \
        bin/qmail-adgetpw

PORTDOCS=   INSTALL README

.if defined(WITH_OPENLDAP_VER)
WANT_OPENLDAP_VER=  ${WITH_OPENLDAP_VER}
.endif

NO_STAGE=   yes
.include <bsd.port.options.mk>

post-patch:
    @${REINPLACE_CMD} -e 's,/var/qmail,${QMAIL_PREFIX},g' \
              -e 's,\(#define AD_USE_GC\) 1,\1 0,' \
              -e 's,\(#define AD_ONLY_USE_SSL\) 1,\1 0,' \
        ${WRKSRC}/ad_func.h

do-build:
.for prog in ${BINARIES}
    ${CC} ${CFLAGS} ${WRKSRC}/${prog}.c ${WRKSRC}/ad_func.c -o \
        ${WRKSRC}/${prog}
.endfor

do-install:
.for prog in ${BINARIES}
    ${INSTALL_PROGRAM} ${WRKSRC}/${prog} ${PREFIX}/bin/
.endfor
    ${CHMOD} 700 ${PREFIX}/bin/checkadpassword \
             ${PREFIX}/bin/create_alias_files
    ${CHMOD} 711 ${PREFIX}/bin/qmail-adgetpw
    ${CHOWN} root:qmail ${PREFIX}/bin/qmail-adgetpw
    ${CHOWN} root:wheel ${PREFIX}/bin/create_alias_files
.if ${PORT_OPTIONS:MDOCS}
    ${MKDIR} ${DOCSDIR}
.for i in ${PORTDOCS}
    ${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
.endfor
.endif
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>