summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorsbd <sbd@pkgsrc.org>2012-08-19 07:28:36 +0000
committersbd <sbd@pkgsrc.org>2012-08-19 07:28:36 +0000
commit41b0c6a941c95504a462182b726f8994697996b9 (patch)
tree508e3d4a5a84ca9e8c073db859bb0aeac56b8d6d /net
parent9044d7c7e24bf1cce02397382e451247fe34dd3f (diff)
downloadpkgsrc-41b0c6a941c95504a462182b726f8994697996b9.tar.gz
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.
Diffstat (limited to 'net')
-rw-r--r--net/samba/DEINSTALL.nss_winbind19
-rw-r--r--net/samba/INSTALL.nss_winbind14
-rw-r--r--net/samba/Makefile10
-rw-r--r--net/samba/options.mk9
4 files changed, 41 insertions, 11 deletions
diff --git a/net/samba/DEINSTALL.nss_winbind b/net/samba/DEINSTALL.nss_winbind
new file mode 100644
index 00000000000..fa6d3555099
--- /dev/null
+++ b/net/samba/DEINSTALL.nss_winbind
@@ -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
diff --git a/net/samba/INSTALL.nss_winbind b/net/samba/INSTALL.nss_winbind
index d187e4c8e83..d6ae0442222 100644
--- a/net/samba/INSTALL.nss_winbind
+++ b/net/samba/INSTALL.nss_winbind
@@ -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
diff --git a/net/samba/Makefile b/net/samba/Makefile
index a8f2a970b4d..98dfbea048d 100644
--- a/net/samba/Makefile
+++ b/net/samba/Makefile
@@ -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}
diff --git a/net/samba/options.mk b/net/samba/options.mk
index c3035da2108..25c193ab996 100644
--- a/net/samba/options.mk
+++ b/net/samba/options.mk
@@ -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: