NSS winbind option install script fixes:
1) Move the INSTALL_TEMPLATES line to the 'winbind' option section. 2) Enable the install script on all platforms. 3) Use the value of ${NSS_WINBIND} in the script as the name of the library (should work on all platforms). 4) In the install script only create the symlink if ${NSS_WINBIND} doesn't start with '@comment' (i.e. no nss winbind on this platform) and the target file exists and the symlink _doesn't_ already exist. 5) Create a DEINSTALL_TEMPLATES to remove the nss winbind symlink if it exists and point to the correct target. Bump PKGREVISION.
This commit is contained in:
parent
9044d7c7e2
commit
41b0c6a941
4 changed files with 41 additions and 11 deletions
19
net/samba/DEINSTALL.nss_winbind
Normal file
19
net/samba/DEINSTALL.nss_winbind
Normal file
|
@ -0,0 +1,19 @@
|
|||
# $NetBSD: DEINSTALL.nss_winbind,v 1.1 2012/08/19 07:28:36 sbd Exp $
|
||||
|
||||
case ${STAGE} in
|
||||
DEINSTALL)
|
||||
NSS_WINBIND='@NSS_WINBIND@'
|
||||
case $NSS_WINBIND in
|
||||
"@comment *") ;;
|
||||
*)
|
||||
if ${TEST} -e /usr/lib/${NSS_WINBIND##*/} && \
|
||||
target=`${LS} -l /usr/lib/${NSS_WINBIND##*/} | \
|
||||
${AWK} '{print $NF;}'` && \
|
||||
${TEST} x"$target" = x"${PREFIX}/${NSS_WINBIND}" ;then
|
||||
${ECHO} "Removeing /usr/lib/${NSS_WINBIND##*/} symlink."
|
||||
${RM} -f /usr/lib/${NSS_WINBIND##*/}
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
|
@ -1,7 +1,17 @@
|
|||
# $NetBSD: INSTALL.nss_winbind,v 1.1 2011/12/16 11:05:24 asau Exp $
|
||||
# $NetBSD: INSTALL.nss_winbind,v 1.2 2012/08/19 07:28:36 sbd Exp $
|
||||
|
||||
case ${STAGE} in
|
||||
POST-INSTALL)
|
||||
ln -sf ${PREFIX}/lib/nss_winbind.so.0 /usr/lib/nss_winbind.so.0
|
||||
NSS_WINBIND='@NSS_WINBIND@'
|
||||
case $NSS_WINBIND in
|
||||
"@comment *") ;;
|
||||
*)
|
||||
if ${TEST} -f ${PREFIX}/${NSS_WINBIND} && \
|
||||
${TEST} ! -e /usr/lib/${NSS_WINBIND##*/} ;then
|
||||
${ECHO} "Creating /usr/lib/${NSS_WINBIND##*/} symlink."
|
||||
${LN} -sf ${PREFIX}/${NSS_WINBIND} /usr/lib/${NSS_WINBIND##*/}
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
# $NetBSD: Makefile,v 1.220 2012/07/06 23:32:59 asau Exp $
|
||||
# $NetBSD: Makefile,v 1.221 2012/08/19 07:28:36 sbd Exp $
|
||||
|
||||
.include "../../net/samba/Makefile.mirrors"
|
||||
|
||||
DISTNAME= samba-${VERSION}
|
||||
PKGREVISION= 1
|
||||
CATEGORIES= net
|
||||
MASTER_SITES= ${SAMBA_MIRRORS:=stable/}
|
||||
|
||||
|
@ -95,13 +96,6 @@ MAKEFLAGS+= PWD_MKDB=${PWD_MKDB:Q}
|
|||
FILES_SUBST+= MKTEMP=${MKTEMP:Q}
|
||||
FILES_SUBST+= PWD_MKDB=${PWD_MKDB:Q}
|
||||
|
||||
.if ${OPSYS} == "NetBSD"
|
||||
. if !empty(PKG_OPTIONS:Mwinbind)
|
||||
# Install a /usr/lib/nss_winbind.so.0 -> ${PREFIX}/lib/nss_winbind.so.0 symlink
|
||||
INSTALL_TEMPLATES+= INSTALL.nss_winbind
|
||||
. endif
|
||||
.endif
|
||||
|
||||
INSTALLATION_DIRS+= ${DOCDIR} ${EGDIR}
|
||||
|
||||
DOCDIR= share/doc/${PKGBASE}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: options.mk,v 1.29 2012/02/01 08:30:39 sbd Exp $
|
||||
# $NetBSD: options.mk,v 1.30 2012/08/19 07:28:36 sbd Exp $
|
||||
|
||||
# Recommended package options for various setups:
|
||||
#
|
||||
|
@ -136,6 +136,7 @@ PLIST.winbind= yes
|
|||
|
||||
# Install the NSS winbind module if it exists.
|
||||
PLIST_SUBST+= NSS_WINBIND=${NSS_WINBIND:Q}
|
||||
FILES_SUBST+= NSS_WINBIND=${NSS_WINBIND:Q}
|
||||
NSS_WINBIND= ${NSS_WINBIND_cmd:sh}
|
||||
NSS_WINBIND_cmd= \
|
||||
${TEST} -x ${WRKSRC}/config.status || \
|
||||
|
@ -146,6 +147,12 @@ NSS_WINBIND_cmd= \
|
|||
{ sub(".*/", "lib/"); print; }' && \
|
||||
${RM} -f config.log
|
||||
|
||||
# Install a /usr/lib/${NSS_WINBIND:T} -> ${PREFIX}/${NSS_WINBIND} symlink
|
||||
# Unfortunately NSS_WINDIND_cmd can not be used to determine whether the
|
||||
# (de)install templates are needed or not.
|
||||
INSTALL_TEMPLATES+= INSTALL.nss_winbind
|
||||
DEINSTALL_TEMPLATES+= DEINSTALL.nss_winbind
|
||||
|
||||
.PHONY: samba-nss-winbind-install
|
||||
post-install: samba-nss-winbind-install
|
||||
samba-nss-winbind-install:
|
||||
|
|
Loading…
Reference in a new issue