aboutsummaryrefslogtreecommitdiffstats
path: root/net/smbldap-tools/Makefile
blob: 46780396298cabdfd79c1334115fde967ef01a7c (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
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
112
113
114
# New ports collection makefile for:    smbldap-tools
# Date created:             May 8 2004
# Whom:                 Florent Thoumie <flz@xbsd.org>
#
# $FreeBSD$
#

PORTNAME=   smbldap-tools
PORTVERSION=    0.9.6
CATEGORIES= net
MASTER_SITES=   http://download.gna.org/smbldap-tools/sources/${PORTVERSION}/

MAINTAINER= mm@FreeBSD.org
COMMENT=    Samba-LDAP management and support tools

BUILD_DEPENDS=  ${SITE_PERL}/Net/LDAP.pm:${PORTSDIR}/net/p5-perl-ldap \
        ${SITE_PERL}/Crypt/SmbHash.pm:${PORTSDIR}/security/p5-Crypt-SmbHash \
        ${SITE_PERL}/${PERL_ARCH}/Digest/SHA1.pm:${PORTSDIR}/security/p5-Digest-SHA1 \
        ${SITE_PERL}/${PERL_ARCH}/Unicode/Map8.pm:${PORTSDIR}/converters/p5-Unicode-MapUTF8
RUN_DEPENDS=    ${BUILD_DEPENDS}

WRKSRC=     ${WRKDIR}/${PORTNAME}-${PORTVERSION:C/a//}

LICENSE=    GPLv2
LICENSE_FILE=   ${WRKSRC}/COPYING

USE_PERL5=  yes
NO_BUILD=   yes

PORTDOCS=   *
PORTEXAMPLES=   *

OPTIONS=    MIGRATION_SCRIPTS   "Install migration scripts" off \
        PDF_DOC         "Install PDF documentation" off

SMBLDAP_TOOLS=  smbldap-groupadd \
        smbldap-groupdel \
        smbldap-grouplist \
        smbldap-groupmod \
        smbldap-groupshow \
        smbldap-useradd \
        smbldap-userdel \
        smbldap-userinfo \
        smbldap-userlist \
        smbldap-usermod \
        smbldap-usershow \
        smbldap-passwd \
        smbldap-populate

.include <bsd.port.pre.mk>

.if defined(WITH_MIGRATION_SCRIPTS)
PLIST_SUB+= MIGRATION_SCRIPTS=""
.else
PLIST_SUB+= MIGRATION_SCRIPTS="@comment "
.endif

post-patch:
    @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
            -e "s|/etc/samba|${PREFIX}/etc|g" \
            -e "s|/etc/smb/|${PREFIX}/etc/smb/|g" \
            ${WRKSRC}/configure.pl \
            ${WRKSRC}/doc/smb.conf \
            ${WRKSRC}/smbldap_tools.pm
.for i in smbldap_tools.pm ${SMBLDAP_TOOLS} \
doc/migration_scripts/smbldap-migrate-pwdump-groups \
doc/migration_scripts/smbldap-migrate-unix-accounts \
doc/migration_scripts/smbldap-migrate-unix-groups \
doc/migration_scripts/smbldap-migrate-pwdump-accounts
    @${REINPLACE_CMD} -e "s|/usr/bin/perl|${PERL}|g" \
            -e "s|/usr/sbin|${LOCALBASE}/sbin|g" \
            -e "s|/etc/opt/IDEALX|${PREFIX}/etc|g" \
            ${WRKSRC}/$i
.endfor

do-install:
    ${MKDIR} ${PREFIX}/etc/smbldap-tools
.for i in smbldap.conf smbldap_bind.conf
    ${INSTALL_DATA} ${WRKSRC}/$i ${PREFIX}/etc/smbldap-tools/$i.sample
    @[ -f ${PREFIX}/etc/smbldap-tools/$i ] || ${INSTALL_DATA} ${WRKSRC}/$i ${PREFIX}/etc/smbldap-tools/$i
.endfor
.for i in ${SMBLDAP_TOOLS}
    ${INSTALL_SCRIPT} ${WRKSRC}/$i ${PREFIX}/sbin
.endfor
    ${INSTALL_DATA} ${WRKSRC}/smbldap_tools.pm ${SITE_PERL}/
.if !defined(NOPORTEXAMPLES)
    ${MKDIR} ${EXAMPLESDIR}
    ${INSTALL_DATA} ${WRKSRC}/doc/smb.conf ${EXAMPLESDIR}/
    ${INSTALL_DATA} ${WRKSRC}/doc/slapd.conf ${EXAMPLESDIR}/
    ${INSTALL_SCRIPT} ${WRKSRC}/configure.pl ${EXAMPLESDIR}/
.endif

.if defined(WITH_MIGRATION_SCRIPTS)
    ${MKDIR} ${DOCSDIR}/migration_scripts
.for i in smbldap-migrate-pwdump-accounts smbldap-migrate-pwdump-groups \
smbldap-migrate-unix-accounts smbldap-migrate-unix-groups
    ${INSTALL_SCRIPT} ${WRKSRC}/doc/migration_scripts/$i ${PREFIX}/sbin
.endfor
.endif


post-install:
.if !defined(NOPORTDOCS)
    ${MKDIR} ${DOCSDIR}
.for file in CONTRIBUTORS COPYING ChangeLog FILES INFRA INSTALL README TODO
    ${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR}/
.endfor
    ${INSTALL_DATA} ${WRKSRC}/doc/smbldap-tools.html ${DOCSDIR}/smbldap-tools.html
.if defined(WITH_PDF_DOC)
    ${INSTALL_DATA} ${WRKSRC}/doc/smbldap-tools.pdf ${DOCSDIR}/smbldap-tools.pdf
.endif
.endif

.include <bsd.port.post.mk>