Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Apr 2002 21:38:33 +0200
From:      Jens Rehsack <rehsack@liwing.de>
To:        "David W. Chapman Jr." <dwcjr@inethouston.net>
Cc:        ports@freebsd.org, rifter@liwing.de
Subject:   Re: FreeBSD Port: samba-2.2.3a - configuration options interactive   script
Message-ID:  <3CCDA139.3BB5E18B@liwing.de>
References:  <3CC871DC.4EAC9AA@liwing.de> <20020425215741.GA95577@leviathan.inethouston.net> <3CCA6D96.696B26DE@liwing.de> <20020427165900.GA97604@leviathan.inethouston.net> <3CCC0220.66570DF3@liwing.de> <000c01c1eee4$5df02d20$f800a8c0@dwcjr>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------CC901333EC1120E2791BAC84
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi David,

here the files for the samba port we were talking about.
We (an collegue and me) used to store the "WITH_"-flags in Makefile.inc to
avoid duplicating code...
So it's more easy to enhance the makefile and enhance the dialog later ...

So long
Jens

"David W. Chapman Jr." wrote:
> 
> > Do I have to mail to portmgr@freebsd.org? But for the first time, I will
> do it
> > like all the others, too.
> 
> I cc'd them, if you don't see anything from someone then I'd drop them an
> email and see what they think.

-- 
L     i  W     W     W  i                 Jens Rehsack
L        W     W     W
L     i   W   W W   W   i  nnn    gggg    LiWing IT-Services
L     i    W W   W W    i  n  n  g   g
LLLL  i     W     W     i  n  n  g   g    Friesenstraße 2
                                  gggg    06112 Halle
                                     g
                                 g   g
Tel.:  +49 - 3 45 - 5 17 05 91    ggg     e-Mail: <rehsack@liwing.de>
Fax:   +49 - 3 45 - 5 17 05 92            http://www.liwing.de/
--------------CC901333EC1120E2791BAC84
Content-Type: text/plain; charset=us-ascii;
 name="configure.samba"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="configure.samba"

#!/bin/sh

if [ -f ${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc ]; then
	exit
fi

tempfile=`/usr/bin/mktemp -t checklist`

if [ "${BATCH}" ]; then
	if [ "${SAMBA_OPTIONS}" ]; then
		set ${SAMBA_OPTIONS}
	fi
else
	/usr/bin/dialog --title "configuration options" --clear \
		--checklist "\n\
Please select desired options:" -1 -1 7 \
syslog		"With syslog support" OFF \
ssl		"With ssl support" OFF \
ldap		"With LDAP2 support" OFF \
nocups		"Without CUPS" OFF \
krb5		"With Kerberos support" OFF \
acl		"With ACL support" OFF \
2> $tempfile

	retval=$?

	if [ -s $tempfile ]; then
		set `cat $tempfile`
	fi
	rm -f $tempfile

	case $retval in
		0)	if [ -z "$*" ]; then
				echo "Nothing selected"
			fi
			;;
		1)	echo "Cancel pressed."
			exit 1
			;;
	esac
fi

>${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc

while [ "$1" ]; do
	case $1 in
		\"syslog\")
			echo "WITH_SYSLOG=YES" >>${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc
			;;
		\"ssl\")
			echo "WITH_SSL=YES" >>${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc
			;;
		\"ldap\")
			echo "WITH_LDAP=YES" >>${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc
			;;
		\"nocups\")
			echo "WITHOUT_CUPS=YES" >>${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc
			;;
		\"krb5\")
			echo "KRB5_HOME=YES" >>${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc
			;;
		\"acl\")
			echo "WITH_ACL_SUPPORT=YES" >>${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc
			;;

		*)
			echo "Invalid option: $1"
			rm -f ${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc
			exit 1
			;;
	esac
	shift
done



--------------CC901333EC1120E2791BAC84
Content-Type: text/plain; charset=us-ascii;
 name="Makefile"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="Makefile"

# New ports collection makefile for:	samba
# Date created:				11th Feb 1995
# Whom:					gpalmer
#
# $FreeBSD: ports/net/samba/Makefile,v 1.79 2002/04/01 19:57:13 ade Exp $
#

PORTNAME=	samba
PORTVERSION=	2.2.3a
CATEGORIES=	net
MASTER_SITES=	ftp://ftp.samba.org/pub/samba/%SUBDIR%/ \
		ftp://samba.anu.edu.au/pub/samba/%SUBDIR%/ \
		ftp://de.samba.org/pub/mirror/samba/%SUBDIR%/ \
		ftp://se.samba.org/pub/samba/%SUBDIR%/ \
		ftp://ftp.sunet.se/pub/unix/utilities/samba/%SUBDIR%/
MASTER_SITE_SUBDIR=	. old-versions old

MAINTAINER=	dwcjr@FreeBSD.org

.if defined(WITH_RECYCLE)
PATCH_SITES+=	http://www.amherst.edu/~bbstone/recycle_bin/2.2.3/
PATCHFILES+=	proto.h.patch loadparm.c.patch reply.c.patch
.endif

# directories
VARDIR=		/var
SAMBA_SPOOL=	${VARDIR}/spool/samba
SAMBA_LOGDIR=	${VARDIR}/log
SAMBA_PRIVATE=	${PREFIX}/private
SAMBA_CONFDIR=	${PREFIX}/etc
# sample files
STARTUP_SCRIPT=	${PREFIX}/etc/rc.d/samba.sh.sample
SAMPLE_CONFIG=	${SAMBA_CONFDIR}/smb.conf.default

USE_AUTOCONF=	yes
CONFIGURE_ARGS=	--libdir=${SAMBA_CONFDIR} \
		--localstatedir=${VARDIR} --with-swatdir=${PREFIX}/share/swat \
		--with-sambabook=${PREFIX}/share/swat/using_samba \
		--with-lockdir=${VARDIR}/lock --with-privatedir=${SAMBA_PRIVATE} \
		--with-pam

.if !defined(BATCH) && !defined(PACKAGE_BUILDING)
IS_INTERACTIVE=	yes
.endif

.if exists(${WRKDIRPREFIX}${.CURDIR}/Makefile.inc)
.include "${WRKDIRPREFIX}${.CURDIR}/Makefile.inc"
.endif

.include <bsd.port.pre.mk>

SCRIPTS_ENV=	WRKDIRPREFIX="${WRKDIRPREFIX}" \
		TOUCH="${TOUCH}" \
		MKDIR="${MKDIR}" \
		CAT="${CAT}" \
		SAMBA_OPTIONS="${SAMBA_OPTIONS}" \
		REALCURDIR="${.CURDIR}"

.if defined(WITH_SYSLOG)
CONFIGURE_ARGS+=	--with-syslog
.endif

.if defined(WITH_SSL)
CONFIGURE_ARGS+=	--with-ssl --with-sslinc=/usr/include/openssl --with-ssllib=/usr/lib
.endif

.if defined(WITH_LDAP)
LIB_DEPENDS+=  ldap.2:${PORTSDIR}/net/openldap2
CONFIGURE_ARGS+=--with-ldapsam
CONFIGURE_ENV+=	CPPFLAGS=-I${LOCALBASE}/include \
		LDFLAGS=-L${LOCALBASE}/lib
.endif

.if !defined(WITHOUT_CUPS)
WITH_CUPS=	yes
.endif

.if defined(WITH_CUPS)
LIB_DEPENDS+=	cups.2:${PORTSDIR}/print/cups-base
CONFIGURE_ENV+=	CPPFLAGS=-I${LOCALBASE}/include \
		LDFLAGS=-L${LOCALBASE}/lib
.endif

.if defined(KRB5_HOME) && exists(${KRB5_HOME})
CONFIGURE_ARGS+=	--with-krb5=${KRB5_HOME}
.endif

.if defined(WITH_ACL_SUPPORT)
.if ${OSVERSION} < 500018
BROKEN=	"Requires a recent FreeBSD 5.0-CURRENT"
.else
CONFIGURE_ARGS+=	--with-acl-support
.endif
.endif

WRKSRC=		${WRKDIR}/${DISTNAME}/source

MAN1=		findsmb.1 make_smbcodepage.1 rpcclient.1 make_unicodemap.1 \
		nmblookup.1 smbcacls.1 smbclient.1 smbcontrol.1 \
		smbsh.1 smbstatus.1 smbtar.1 testparm.1 \
		testprns.1 wbinfo.1
MAN5=		lmhosts.5 smb.conf.5 smbpasswd.5
MAN7=		samba.7
MAN8=		nmbd.8 pdbedit.8 smbd.8 smbmnt.8 smbmount.8 \
		smbpasswd.8 smbspool.8 smbumount.8 swat.8 winbindd.8

SED_PLIST=	${SED} -e 's!${PREFIX}!%D!g'

pre-fetch:
	@${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/configure.samba

post-clean:
	@${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc

post-install:
	${MKDIR} ${PREFIX}/share/examples/samba
	${CP} -rp ${WRKDIR}/${DISTNAME}/examples/* ${PREFIX}/share/examples/samba
	@if [ ! -f ${STARTUP_SCRIPT} ]; then				\
		${ECHO} "Installing ${STARTUP_SCRIPT} startup file." ;	\
		${INSTALL_SCRIPT} ${FILESDIR}/samba.sh.sample 		\
			${STARTUP_SCRIPT} ;				\
	fi
	@test -d ${SAMBA_SPOOL} || ${MKDIR} ${SAMBA_SPOOL} && ${CHMOD} 1777 ${SAMBA_SPOOL}
	@if [ ! -f ${SAMPLE_CONFIG} ]; then				\
		${SED} -e 's!%%SAMBA_SPOOL%%!${SAMBA_SPOOL}!'		\
			-e 's!%%SAMBA_LOGDIR%%!${SAMBA_LOGDIR}!'	\
			-e 's!%%SAMBA_CONFDIR%%!${SAMBA_CONFDIR}!'	\
			${FILESDIR}/smb.conf.default			\
			> ${SAMPLE_CONFIG} ;				\
	fi
	${INSTALL_SCRIPT} ${WRKDIR}/${DISTNAME}/source/script/mksmbpasswd.sh ${PREFIX}/bin/make_smbpasswd
	if [ ! -d ${SAMBA_PRIVATE} ] ; then				\
		${MKDIR} ${SAMBA_PRIVATE} ;				\
		${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			\
		${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
	${ECHO_CMD} "@exec ${TEST} -d ${SAMBA_SPOOL} || ${MKDIR} ${SAMBA_SPOOL} && ${CHMOD} 1777 ${SAMBA_SPOOL}" | ${SED_PLIST} >> ${TMPPLIST}
	${ECHO_CMD} "@unexec ${RM} -rf ${SAMBA_SPOOL}" | ${SED_PLIST} >> ${TMPPLIST}
	${ECHO_CMD} "@exec ${MKDIR} -m 500 ${SAMBA_PRIVATE}" | ${SED_PLIST} >> ${TMPPLIST}
	${ECHO_CMD} "@exec ${CHOWN} root:wheel ${SAMBA_PRIVATE}" | ${SED_PLIST} >> ${TMPPLIST}
	${ECHO_CMD} "@exec ${CAT} /etc/passwd | ${GREP} -v "^#" | ${PREFIX}/bin/make_smbpasswd > ${SAMBA_PRIVATE}/smbpasswd.default" | ${SED_PLIST} >> ${TMPPLIST}
	${ECHO_CMD} "@exec ${TEST} -e ${SAMBA_PRIVATE}/smbpasswd || ${CP} -p ${SAMBA_PRIVATE}/smbpasswd.default ${SAMBA_PRIVATE}/smbpasswd" | ${SED_PLIST} >> ${TMPPLIST}
	${ECHO_CMD} "@exec ${CHMOD} 600 ${SAMBA_PRIVATE}/smbpasswd*" | ${SED_PLIST} >> ${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}" | ${SED_PLIST} >> ${TMPPLIST}
	${ECHO_CMD} "@unexec ${RM} -f ${SAMBA_PRIVATE}/smbpasswd.default" | ${SED_PLIST} >> ${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.\")" | ${SED_PLIST} >> ${TMPPLIST}

.if !defined(NOPORTDOCS)
	@${MKDIR} ${DOCSDIR}
	@${INSTALL_DATA} ${FILESDIR}/README.FreeBSD ${DOCSDIR}
	for i in ${WRKDIR}/${DISTNAME}/README				\
			${WRKDIR}/${DISTNAME}/COPYING			\
			${WRKDIR}/${DISTNAME}/Manifest			\
			${WRKDIR}/${DISTNAME}/Read-Manifest-Now		\
			${WRKDIR}/${DISTNAME}/Roadmap			\
			${WRKDIR}/${DISTNAME}/WHATSNEW.txt		\
			${WRKDIR}/${DISTNAME}/docs/THANKS		\
			${WRKDIR}/${DISTNAME}/docs/announce		\
			${WRKDIR}/${DISTNAME}/docs/history ; do		\
		${INSTALL_DATA} $$i ${DOCSDIR} ;		\
	done
	for i in faq htmldocs textdocs Registry ; do			\
		${MKDIR} ${DOCSDIR}/$$i ;		\
		for j in ${WRKDIR}/${DISTNAME}/docs/$$i/* ; do		\
			if [ $$j != ${WRKDIR}/${DISTNAME}/docs/htmldocs/using_samba ] ; then \
				if [ $$j != ${WRKDIR}/${DISTNAME}/docs/textdocs/outdated ] ; then \
					${INSTALL_DATA} $$j ${DOCSDIR}/$$i ;\
				fi; \
			fi; \
		done							\
	done
	@${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/swat/README ${DOCSDIR}/README.swat
.endif

.include <bsd.port.post.mk>

--------------CC901333EC1120E2791BAC84
Content-Type: text/plain; charset=us-ascii;
 name="Makefile.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="Makefile.diff"

42,49d41
< .if !defined(BATCH) && !defined(PACKAGE_BUILDING)
< IS_INTERACTIVE=	yes
< .endif
< 
< .if exists(${WRKDIRPREFIX}${.CURDIR}/Makefile.inc)
< .include "${WRKDIRPREFIX}${.CURDIR}/Makefile.inc"
< .endif
< 
52,58d43
< SCRIPTS_ENV=	WRKDIRPREFIX="${WRKDIRPREFIX}" \
< 		TOUCH="${TOUCH}" \
< 		MKDIR="${MKDIR}" \
< 		CAT="${CAT}" \
< 		SAMBA_OPTIONS="${SAMBA_OPTIONS}" \
< 		REALCURDIR="${.CURDIR}"
< 
108,113d92
< 
< pre-fetch:
< 	@${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/configure.samba
< 
< post-clean:
< 	@${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc

--------------CC901333EC1120E2791BAC84--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3CCDA139.3BB5E18B>