From owner-freebsd-ports Mon Mar 25 1:35: 6 2002 Delivered-To: freebsd-ports@freebsd.org Received: from h1.generalresources.com (h1.generalresources.com [211.21.66.250]) by hub.freebsd.org (Postfix) with ESMTP id A1F7837B405; Mon, 25 Mar 2002 01:34:56 -0800 (PST) Received: from server.tucheng.generalresources.com (int-1-253.generalresources.com [192.168.1.253]) by h1.generalresources.com (8.11.6/8.11.6) with ESMTP id g2P9YrU35544; Mon, 25 Mar 2002 17:34:53 +0800 (CST) (envelope-from hsw@acm.org) Received: from x4.tucheng.generalresources.com (x4.tucheng.generalresources.com [192.168.2.4]) by server.tucheng.generalresources.com (8.11.4/8.11.4) with ESMTP id g2P9YrL86748; Mon, 25 Mar 2002 17:34:53 +0800 (CST) (envelope-from hsw@acm.org) Received: from x4.tucheng.generalresources.com (localhost [127.0.0.1]) by x4.tucheng.generalresources.com (8.11.6/8.11.6) with ESMTP id g2P9Yrc36346; Mon, 25 Mar 2002 17:34:53 +0800 (CST) (envelope-from hsw@acm.org) Message-Id: <200203250934.g2P9Yrc36346@x4.tucheng.generalresources.com> To: dwcjr@FreeBSD.org Reply-To: Christopher Hall From: Christopher Hall Cc: ports@FreeBSD.org Subject: net/samba: printing fails, smbpasswd stored in package Content-transfer-encoding: 8bit Content-type: text/plain; charset=big5 X-Operating-System: FreeBSD X-Mailer: Exmh Date: Mon, 25 Mar 2002 17:34:53 +0800 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org A. samba2.2.3a compiled with "make package" and the package installed an a fresly installed bsd installation, printing fails. After investigation I found that "/var/spool/samba" was not created by the pkg_add. B. When I recompiled it as "make PACKAGE_BUILDING=yes package" it added my "/usr/local/private/smbpasswd" to the package. Which contained all the usernames/passwords from the machine I generated the package on. I suggest (after looking at japanese/samba) 1. Remove ".if defined(PACKAGE_BUILDING)" block from the Makefile. 2. modify pkg-plist to generate the smbpasswd file on installation and create the /var/spool/samba directory with @exec and @unexec statements. Here is my attempt at a patch - however, it puts absolute pathnames into the generated TMPPLIST. Somehow it needs to change PREFIX to %D. How about /var, is there a %LETTER for this? --- Makefile.orig Mon Mar 18 08:34:19 2002 +++ Makefile Mon Mar 25 17:14:03 2002 @@ -111,19 +111,27 @@ ${CHOWN} root:wheel ${SAMBA_PRIVATE} ; \ fi ${CHMOD} 700 ${SAMBA_PRIVATE} + if [ ! -f ${SAMBA_PRIVATE}/smbpasswd.default ] ; then \ + ${CAT} /etc/passwd | ${GREP} -v "^#" | ${PREFIX}/bin/make_smbpasswd > ${SAMBA_PRIVATE}/smbpasswd.default ; \ + ${CHMOD} 600 ${SAMBA_PRIVATE}/smbpasswd.default ; \ + fi if [ ! -f ${SAMBA_PRIVATE}/smbpasswd ] ; then \ - ${CAT} /etc/passwd | ${GREP} -v "^#" | ${PREFIX}/bin/make_smbpasswd > ${SAMBA_PRIVATE}/smbpasswd ; \ - ${CHMOD} 600 ${SAMBA_PRIVATE}/smbpasswd ; \ + ${CP} -p ${SAMBA_PRIVATE}/smbpasswd.default ${SAMBA_PRIVATE}/smbpasswd ; \ + ${CHMOD} 600 ${SAMBA_PRIVATE}/smbpasswd ; \ fi ${CHMOD} 500 ${SAMBA_PRIVATE} ${CHOWN} root:wheel ${PREFIX}/bin/smbpasswd ${CHMOD} 111 ${PREFIX}/bin/smbpasswd -.if defined(PACKAGE_BUILDING) - ${ECHO_CMD} "private/smbpasswd" >> ${TMPPLIST} - ${ECHO_CMD} "@dirrm private" >> ${TMPPLIST} -.else - ${ECHO_CMD} "@unexec ${ECHO_CMD} \"Warning: If you will *NOT* use this package anymore, please remove %D/private/smbpasswd manually.\"" >> ${TMPPLIST} -.endif + ${ECHO_CMD} "@exec ${TEST} -d ${SAMBA_SPOOL} || ${MKDIR} ${SAMBA_SPOOL} && ${CHMOD} 1777 ${SAMBA_SPOOL}" >> ${TMPPLIST} + ${ECHO_CMD} "@unexec ${RM} -rf ${SAMBA_SPOOL}" >> ${TMPPLIST} + ${ECHO_CMD} "@exec ${MKDIR} -m 500 ${SAMBA_PRIVATE}" >> ${TMPPLIST} + ${ECHO_CMD} "@exec ${CHOWN} root:wheel ${SAMBA_PRIVATE}" >> ${TMPPLIST} + ${ECHO_CMD} "@exec ${CAT} /etc/passwd | ${GREP} -v "^#" | ${PREFIX}/bin/make_smbpasswd > ${SAMBA_PRIVATE}/smbpasswd.default" >> ${TMPPLIST} + ${ECHO_CMD} "@exec ${TEST} -e ${SAMBA_PRIVATE}/smbpasswd || ${CP} -p ${SAMBA_PRIVATE}/smbpasswd.default ${SAMBA_PRIVATE}/smbpasswd" >> ${TMPPLIST} + ${ECHO_CMD} "@exec ${CHMOD} 600 ${SAMBA_PRIVATE}/smbpasswd*" >> ${TMPPLIST} + ${ECHO_CMD} "@unexec /usr/bin/cmp -s ${SAMBA_PRIVATE}/smbpasswd ${SAMBA_PRIVATE}/smbpasswd.default && ${RM} -f ${SAMBA_PRIVATE}/smbpasswd ${SAMBA_PRIVATE}/secrets.tdb || ${TRUE}" >> ${TMPPLIST} + ${ECHO_CMD} "@unexec ${RM} -f ${SAMBA_PRIVATE}/smbpasswd.default" >> ${TMPPLIST} + ${ECHO_CMD} "@unexec ${RMDIR} ${SAMBA_PRIVATE} || (${ECHO_CMD} \"Warning: If you will *NOT* use this package anymore,\" && ${ECHO_CMD} \" please remove ${SAMBA_PRIVATE} and its contents manually.\")" >> ${TMPPLIST} .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} --- Christopher Hall Fax: +886-2-2795-3030 Christopher Hall Phone: +886-2-2795-5799 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message