1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-22 04:17:44 +00:00

net/smbldap-tools: support stage

- Use options sub
- Use @sample

PR:		192245
This commit is contained in:
William Grzybowski 2014-07-30 15:24:57 +00:00
parent b4eb9a3268
commit d377e2ab58
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=363486
2 changed files with 17 additions and 29 deletions

View File

@ -9,6 +9,9 @@ MASTER_SITES= http://download.gna.org/smbldap-tools/sources/${PORTVERSION}/
MAINTAINER= ports@FreeBSD.org
COMMENT= Samba-LDAP management and support tools
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING
BUILD_DEPENDS= p5-perl-ldap>=0:${PORTSDIR}/net/p5-perl-ldap \
p5-Crypt-SmbHash>=0:${PORTSDIR}/security/p5-Crypt-SmbHash \
p5-Digest-SHA1>=0:${PORTSDIR}/security/p5-Digest-SHA1 \
@ -17,9 +20,6 @@ RUN_DEPENDS:= ${BUILD_DEPENDS}
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION:C/a//}
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING
USES= gmake perl5
GNU_CONFIGURE= yes
ALL_TARGET= build
@ -29,50 +29,43 @@ PORTDOCS= *
OPTIONS_DEFINE= MIGRATION_SCRIPTS PDF_DOC DOCS
MIGRATION_SCRIPTS_DESC= Install migration scripts
PDF_DOC_DESC= Install PDF documentation
OPTIONS_SUB= yes
CONFIGURE_ARGS+= --with-samba-sysconfdir=${LOCALBASE}/etc \
--with-samba-bindir=${LOCALBASE}/bin \
--with-perl=${PERL} \
--with-perl-libdir=sitelib
NO_STAGE= yes
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MMIGRATION_SCRIPTS}
PLIST_SUB+= MIGRATION_SCRIPTS=""
.else
PLIST_SUB+= MIGRATION_SCRIPTS="@comment "
.endif
post-patch:
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
${WRKSRC}/smbldap-config.pl
post-install:
@${MKDIR} ${PREFIX}/etc/smbldap-tools
@${MKDIR} ${STAGEDIR}${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
${INSTALL_DATA} ${WRKSRC}/$i ${STAGEDIR}${PREFIX}/etc/smbldap-tools/$i.sample
.endfor
.if ${PORT_OPTIONS:MMIGRATION_SCRIPTS}
. for i in smbldap-migrate-pwdump-accounts smbldap-migrate-pwdump-groups \
smbldap-migrate-unix-accounts smbldap-migrate-unix-groups
@${SED} -e 's|/usr/bin/perl|${PERL}|g' \
${WRKSRC}/doc/migration_scripts/$i > ${PREFIX}/sbin/$i
${WRKSRC}/doc/migration_scripts/$i > ${STAGEDIR}${PREFIX}/sbin/$i
. endfor
.endif
.if ${PORT_OPTIONS:MDOCS}
${MKDIR} ${DOCSDIR}
${INSTALL_SCRIPT} ${WRKSRC}/smbldap-config.cmd ${DOCSDIR}/smbldap-config
${INSTALL_SCRIPT} ${WRKSRC}/smbldap-upgrade-0.9.6.cmd ${DOCSDIR}/smbldap-upgrade-0.9.6
.for file in CONTRIBUTORS COPYING ChangeLog FILES INFRA INSTALL README TODO
${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR}/
${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_SCRIPT} ${WRKSRC}/smbldap-config.cmd ${STAGEDIR}${DOCSDIR}/smbldap-config
${INSTALL_SCRIPT} ${WRKSRC}/smbldap-upgrade-0.9.6.cmd ${STAGEDIR}${DOCSDIR}/smbldap-upgrade-0.9.6
.for f in CONTRIBUTORS COPYING ChangeLog FILES INFRA INSTALL README TODO
${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR}/
.endfor
${INSTALL_DATA} ${WRKSRC}/doc/smbldap-tools.html ${DOCSDIR}/smbldap-tools.html
${INSTALL_DATA} ${WRKSRC}/doc/smbldap-tools.html ${STAGEDIR}${DOCSDIR}/smbldap-tools.html
.if ${PORT_OPTIONS:MPDF_DOC}
${INSTALL_DATA} ${WRKSRC}/doc/smbldap-tools.pdf ${DOCSDIR}/smbldap-tools.pdf
${INSTALL_DATA} ${WRKSRC}/doc/smbldap-tools.pdf ${STAGEDIR}${DOCSDIR}/smbldap-tools.pdf
.endif
.endif

View File

@ -16,12 +16,7 @@ sbin/smbldap-userinfo
sbin/smbldap-userlist
sbin/smbldap-usermod
sbin/smbldap-usershow
@exec mkdir -p %D/etc/smbldap-tools
@unexec if cmp -s %D/etc/smbldap-tools/smbldap.conf %D/etc/smbldap-tools/smbldap.conf.sample; then rm -f %D/etc/smbldap-tools/smbldap.conf; fi
etc/smbldap-tools/smbldap.conf.sample
@exec [ -f %D/etc/smbldap-tools/smbldap.conf ] || cp %B/%f %D/etc/smbldap-tools/smbldap.conf
@unexec if cmp -s %D/etc/smbldap-tools/smbldap_bind.conf %D/etc/smbldap-tools/smbldap_bind.conf.sample; then rm -f %D/etc/smbldap-tools/smbldap_bind.conf; fi
etc/smbldap-tools/smbldap_bind.conf.sample
@exec [ -f %D/etc/smbldap-tools/smbldap_bind.conf ] || cp %B/%f %D/etc/smbldap-tools/smbldap_bind.conf
@sample %%ETCDIR%%/smbldap.conf.sample
@sample %%ETCDIR%%/smbldap_bind.conf.sample
%%SITE_PERL%%/smbldap_tools.pm
@dirrmtry etc/smbldap-tools
@dirrmtry %%ETCDIR%%