aboutsummaryrefslogtreecommitdiffstats
path: root/net/ldapscripts/Makefile
blob: afd2eec46da72224cafc00c4341e7b0486627aa7 (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
# Created by: Ganael LAPLANCHE <ganael.laplanche@martymac.org>
# $FreeBSD$

PORTNAME=   ldapscripts
PORTVERSION=    2.0.5
PORTREVISION=   1
CATEGORIES= net
MASTER_SITES=   SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION} \
        http://contribs.martymac.org/ldapscripts/
EXTRACT_SUFX=   .tgz

MAINTAINER= martymac@FreeBSD.org
COMMENT=    Scripts to manage posix accounts in an OpenLDAP directory

LICENSE=    GPLv2

RUN_DEPENDS=    ldapadd:${PORTSDIR}/net/openldap${OPENLDAP_VER}-client \
        ldapsearch:${PORTSDIR}/net/openldap${OPENLDAP_VER}-client \
        ldapdelete:${PORTSDIR}/net/openldap${OPENLDAP_VER}-client \
        ldapmodify:${PORTSDIR}/net/openldap${OPENLDAP_VER}-client \
        ldapmodrdn:${PORTSDIR}/net/openldap${OPENLDAP_VER}-client \
        ldappasswd:${PORTSDIR}/net/openldap${OPENLDAP_VER}-client

USE_OPENLDAP=   yes
USES=       iconv
LIBDIR= ${PREFIX}/lib/${PORTNAME}
MAKE_ENV+=  MANDIR=${MANPREFIX}/man \
        ETCDIR=${ETCDIR}

SUB_FILES=  pkg-message

PORTDOCS=   README CHANGELOG VERSION TODO

# Unset 'all' target set by default to 'help'
# and set paths to OpenLDAP binaries
post-patch:
    ${REINPLACE_CMD} "s|^all:.*|all:|g" ${WRKSRC}/Makefile
    ${REINPLACE_CMD} "s|^PREFIX = .*|PREFIX = ${PREFIX}|g" ${WRKSRC}/Makefile
    ${REINPLACE_CMD} \
    -e "s|^LDAPSEARCHBIN=.*|LDAPSEARCHBIN=\"${LOCALBASE}/bin/ldapsearch\"|g" \
    -e "s|^LDAPADDBIN=.*|LDAPADDBIN=\"${LOCALBASE}/bin/ldapadd\"|g" \
    -e "s|^LDAPDELETEBIN=.*|LDAPDELETEBIN=\"${LOCALBASE}/bin/ldapdelete\"|g" \
    -e "s|^LDAPMODIFYBIN=.*|LDAPMODIFYBIN=\"${LOCALBASE}/bin/ldapmodify\"|g" \
    -e "s|^LDAPMODRDNBIN=.*|LDAPMODRDNBIN=\"${LOCALBASE}/bin/ldapmodrdn\"|g" \
    -e "s|^LDAPPASSWDBIN=.*|LDAPPASSWDBIN=\"${LOCALBASE}/bin/ldappasswd\"|g" \
    -e "s|^ICONVBIN=.*|ICONVBIN=\"${LOCALBASE}/bin/iconv\"|g" \
    ${WRKSRC}/etc/ldapscripts.conf

# Install remaining stuff
post-install:
    @${RM} ${STAGEDIR}${ETCDIR}/ldapscripts.conf \
        ${STAGEDIR}${ETCDIR}/ldapscripts.passwd
    @${MKDIR} ${STAGEDIR}${DOCSDIR}
    ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>