From 0257eacb1c68fdfca61da8a525dbbdbc3e7544f0 Mon Sep 17 00:00:00 2001 From: "David W. Chapman Jr." Date: Wed, 29 May 2002 19:09:05 +0000 Subject: Add menu system Inspired by: submitters of samba menu system --- net/samba-tng/Makefile | 14 ++++++++ net/samba-tng/scripts/configure.samba | 68 +++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 net/samba-tng/scripts/configure.samba diff --git a/net/samba-tng/Makefile b/net/samba-tng/Makefile index 4685307f8c3c..ee6b8aa0394b 100644 --- a/net/samba-tng/Makefile +++ b/net/samba-tng/Makefile @@ -20,6 +20,7 @@ GNU_CONFIGURE= YES INSTALLS_SHLIB= YES USE_GMAKE= YES USE_BZIP2= YES +USE_SUBMAKE= YES USE_AUTOCONF= YES WRKSRC= ${WRKDIR}/tng-clean/source @@ -52,6 +53,13 @@ MAN8= browserd.8 lsarpcd.8 netlogond.8 nmbd.8 rpcclient.8 \ .include +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 @@ -77,6 +85,12 @@ CONFIGURE_ENV+= CPPFLAGS=-I${LOCALBASE}/include \ LDFLAGS=-L${LOCALBASE}/lib .endif +pre-fetch: + @${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/configure.samba + +post-clean: + @${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc + post-install: @${INSTALL_SCRIPT} ${WRKSRC}/script/samba-init.d ${SAMBA_CONFDIR}/rc.d/samba-tng.sh.sample diff --git a/net/samba-tng/scripts/configure.samba b/net/samba-tng/scripts/configure.samba new file mode 100644 index 000000000000..78b9b996dcc9 --- /dev/null +++ b/net/samba-tng/scripts/configure.samba @@ -0,0 +1,68 @@ +#!/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 9 \ +syslog "With syslog support" OFF \ +ldap "With LDAP2 support" ON \ +nocups "Without CUPS" OFF \ +msdfs "With MSDFS support" OFF \ +quota "With Quota 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 + +echo "SCRIPT_RUN=yes" >${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc + +while [ "$1" ]; do + case $1 in + \"syslog\") + echo "WITH_SYSLOG=YES" >>${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc + ;; + \"ldap\") + echo "WITH_LDAP=YES" >>${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc + ;; + \"nocups\") + echo "WITHOUT_CUPS=YES" >>${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc + ;; + \"msdfs\") + echo "WITH_MSDFS=YES" >>${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc + ;; + \"quota\") + echo "WITH_QUOTA=YES" >>${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc + ;; + *) + echo "Invalid option: $1" + rm -f ${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc + exit 1 + ;; + esac + shift +done -- cgit v1.2.3