summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2001-11-21 17:17:43 +0000
committerjlam <jlam@pkgsrc.org>2001-11-21 17:17:43 +0000
commit23a9ff7e9b3481275c37f8f29061966297fca1a1 (patch)
treedfeb38ae22470e0e44a31382c4321d76353806f7 /net
parent38d6066075fee95b12abbc0bb672f4499040f26b (diff)
downloadpkgsrc-23a9ff7e9b3481275c37f8f29061966297fca1a1.tar.gz
Use the general INSTALL/DEINSTALL scripts, and minimize the differences
between this package and the net/samba package.
Diffstat (limited to 'net')
-rw-r--r--net/samba20/DEINSTALL101
-rw-r--r--net/samba20/INSTALL45
-rw-r--r--net/samba20/MESSAGE3
-rw-r--r--net/samba20/Makefile47
-rw-r--r--net/samba20/PLIST4
-rwxr-xr-xnet/samba20/files/nmbd.sh30
-rw-r--r--net/samba20/files/samba.sh61
-rwxr-xr-xnet/samba20/files/smbd.sh28
8 files changed, 114 insertions, 205 deletions
diff --git a/net/samba20/DEINSTALL b/net/samba20/DEINSTALL
deleted file mode 100644
index 02ee91a4729..00000000000
--- a/net/samba20/DEINSTALL
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/bin/sh
-#
-# $NetBSD: DEINSTALL,v 1.1 2001/10/31 22:58:45 zuntum Exp $
-
-PKGNAME=$1
-STAGE=$2
-
-CAT="@CAT@"
-CMP="@CMP@"
-RM="@RM@"
-RMDIR="@RMDIR@"
-TRUE="@TRUE@"
-
-SAMBA_PRIVATE="@SAMBA_PRIVATE@"
-SAMBA_LOCKDIR="@SAMBA_LOCKDIR@"
-SAMPLECONFDIR=${PKG_PREFIX}/share/examples/samba
-CONFDIR=@SAMBA_ETCDIR@
-CONFFILES="smb.conf"
-
-case ${STAGE} in
-DEINSTALL)
- # Remove configuration files if they don't differ from the default
- # config file.
- #
- for file in ${CONFFILES}
- do
- FILE=${CONFDIR}/${file}
- SAMPLEFILE=${SAMPLECONFDIR}/${file}.sample
- if ${CMP} -s ${FILE} ${SAMPLEFILE}
- then
- ${RM} -f ${FILE}
- fi
- done
- ;;
-
-POST-DEINSTALL)
- modified_files=''
- for file in ${CONFFILES}
- do
- FILE=${CONFDIR}/${file}
- if [ -f ${FILE} ]
- then
- modified_files="${modified_files} ${FILE}"
- fi
- done
-
- ${RMDIR} ${SAMBA_PRIVATE} 2>/dev/null || ${TRUE}
- ${RMDIR} ${SAMBA_LOCKDIR} 2>/dev/null || ${TRUE}
- ${RMDIR} ${CONFDIR} 2>/dev/null || ${TRUE}
-
- existing_dirs=''
- for dir in ${CONFDIR} ${SAMBA_PRIVATE} ${SAMBA_LOCKDIR}
- do
- if [ -d ${dir} ]
- then
- existing_dirs="${existing_dirs} ${dir}"
- fi
- done
-
- if [ -n "${modified_files}" -o -n "${existing_dirs}" ]
- then
- ${CAT} << EOF
-===========================================================================
-If you won't be using ${PKGNAME} any longer, you may want to remove:
-EOF
- if [ -n "${modified_files}" ]
- then
- ${CAT} << EOF
-
- * the following files:
-
-EOF
- for file in ${modified_files}
- do
- echo " ${file}"
- done
- fi
- if [ -n "${existing_dirs}" ]
- then
- ${CAT} << EOF
-
- * the following directories:
-
-EOF
- for dir in ${existing_dirs}
- do
- echo " ${dir}"
- done
- fi
- ${CAT} << EOF
-===========================================================================
-EOF
- fi
- ;;
-
-*)
- echo "Unexpected argument: ${STAGE}"
- exit 1
- ;;
-esac
-exit 0
diff --git a/net/samba20/INSTALL b/net/samba20/INSTALL
index 3cc6bbe08ef..67df6166a88 100644
--- a/net/samba20/INSTALL
+++ b/net/samba20/INSTALL
@@ -1,48 +1,15 @@
#!/bin/sh
#
-# $NetBSD: INSTALL,v 1.1 2001/10/31 22:58:46 zuntum Exp $
-
-PKGNAME=$1
-STAGE=$2
-
-CAT="@CAT@"
-CHMOD="@CHMOD@"
-CHOWN="@CHOWN@"
-CP="@CP@"
-MKDIR="@MKDIR@"
-RM="@RM@"
+# $NetBSD: INSTALL,v 1.2 2001/11/21 17:17:44 jlam Exp $
SAMBA_PRIVATE="@SAMBA_PRIVATE@"
-SAMBA_LOCKDIR="@SAMBA_LOCKDIR@"
-SAMPLECONFDIR=${PKG_PREFIX}/share/examples/samba
-CONFDIR=@SAMBA_ETCDIR@
-CONFFILES="smb.conf"
case ${STAGE} in
-PRE-INSTALL)
- ;;
-
POST-INSTALL)
- ${MKDIR} ${CONFDIR} ${SAMBA_PRIVATE} ${SAMBA_LOCKDIR}
- echo "Installing configuration files:"
- for file in ${CONFFILES}
- do
- FILE=${CONFDIR}/${file}
- SAMPLEFILE=${SAMPLECONFDIR}/${file}.sample
- if [ -f ${FILE} ]
- then
- echo " ${FILE} already exists"
- else
- echo " ${FILE}"
- ${CP} ${SAMPLEFILE} ${FILE}
- ${CHMOD} 644 ${FILE}
- fi
- done
-
# Create SMB password file
- if [ ! -f ${SAMBA_PRIVATE}/smbpasswd ]
+ if [ ! -e ${SAMBA_PRIVATE}/smbpasswd ]
then
- echo -n "Creating ${SAMBA_PRIVATE}/smbpasswd..."
+ ${ECHO} -n "Creating ${SAMBA_PRIVATE}/smbpasswd..."
${CHOWN} -R 0:0 ${SAMBA_PRIVATE}
${CAT} /etc/passwd | ${PKG_PREFIX}/sbin/mksmbpasswd \
> ${SAMBA_PRIVATE}/smbpasswd
@@ -51,10 +18,4 @@ POST-INSTALL)
echo "done."
fi
;;
-
-*)
- echo "Unexpected argument: ${STAGE}"
- exit 1
- ;;
esac
-exit 0
diff --git a/net/samba20/MESSAGE b/net/samba20/MESSAGE
index 234f89859fd..dee2e187f8b 100644
--- a/net/samba20/MESSAGE
+++ b/net/samba20/MESSAGE
@@ -1,5 +1,5 @@
===========================================================================
-$NetBSD: MESSAGE,v 1.1 2001/10/31 22:58:46 zuntum Exp $
+$NetBSD: MESSAGE,v 1.2 2001/11/21 17:17:44 jlam Exp $
*===* Security Notes *===*
@@ -12,5 +12,4 @@ port, pkg_delete will *NOT* remove the smbpasswd file because
pkg_delete can be used for upgrading this package. If you won't use
this package anymore, I strongly recommend that you remove the
smbpasswd file manually.
-
===========================================================================
diff --git a/net/samba20/Makefile b/net/samba20/Makefile
index 9e51a331437..c87034d041e 100644
--- a/net/samba20/Makefile
+++ b/net/samba20/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2001/08/22 15:42:19 jlam Exp $
+# $NetBSD: Makefile,v 1.3 2001/11/21 17:17:44 jlam Exp $
DISTNAME= samba-2.0.10
WRKSRC= ${WRKDIR}/${DISTNAME}/source
@@ -17,12 +17,11 @@ USE_BUILDLINK_ONLY= # defined
.include "../../mk/bsd.prefs.mk"
-SAMPLE_CONFIG= ${PREFIX}/share/examples/samba/smb.conf.sample
SAMBA_LOGDIR?= /var/log
SAMBA_LOCKDIR?= /var/run/samba
-SAMBA_ETCDIR?= /etc/samba
+SAMBA_ETCDIR?= ${CONFDIR}/samba
SAMBA_PRIVATE?= ${SAMBA_ETCDIR}/private
-SAMBA_DATADIR?= ${PREFIX}/share
+SAMBA_DATADIR= ${PREFIX}/share
MAKE_ENV+= CONFIGDIR=${SAMBA_ETCDIR}
@@ -49,53 +48,46 @@ CONFIGURE_ARGS+= --with-pam
CONFIGURE_ARGS+= --without-smbwrapper
CONFIGURE_ARGS+= --without-smbmount
-INSTALL_FILE= ${WRKDIR}/INSTALL
-DEINSTALL_FILE= ${WRKDIR}/DEINSTALL
-
DOCDIR= ${PREFIX}/share/doc/samba
HTMLDIR= ${PREFIX}/share/doc/html/samba
EXAMPLESDIR= ${PREFIX}/share/examples/samba
-FILES_SUBST= SAMBA_PRIVATE=${SAMBA_PRIVATE}
+FILES_SUBST= SAMBA_PRIVATE=${SAMBA_PRIVATE}
FILES_SUBST+= SAMBA_LOCKDIR=${SAMBA_LOCKDIR}
FILES_SUBST+= SAMBA_LOGDIR=${SAMBA_LOGDIR}
FILES_SUBST+= SAMBA_ETCDIR=${SAMBA_ETCDIR}
-FILES_SUBST+= PREFIX=${PREFIX}
-FILES_SUBST+= CAT=${CAT:Q}
-FILES_SUBST+= CHMOD=${CHMOD:Q}
-FILES_SUBST+= CHOWN=${CHOWN:Q}
-FILES_SUBST+= CMP=${CMP:Q}
-FILES_SUBST+= CP=${CP:Q}
-FILES_SUBST+= ECHO=${ECHO:Q}
-FILES_SUBST+= MKDIR=${MKDIR:Q}
-FILES_SUBST+= RM=${RM:Q}
-FILES_SUBST+= RMDIR=${RMDIR:Q}
-FILES_SUBST+= TRUE=${TRUE:Q}
-FILES_SUBST_SED= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/}
-
MESSAGE_SUBST+= ETCDIR=${SAMBA_ETCDIR}
+CONF_FILES= ${EXAMPLESDIR}/smb.conf.sample ${SAMBA_ETCDIR}/smb.conf
+RCD_SCRIPTS= samba nmbd smbd
+MAKE_DIRS= ${SAMBA_LOCKDIR}
+OWN_DIRS= ${SAMBA_ETCDIR} ${SAMBA_PRIVATE}
+
+INSTALL_EXTRA_TMPL= ${PKGDIR}/INSTALL
+
pre-install:
- ${SED} ${FILES_SUBST_SED} ${FILESDIR}/samba.sh > ${WRKDIR}/samba.sh
- ${SED} ${FILES_SUBST_SED} ${PKGDIR}/INSTALL > ${INSTALL_FILE}
- ${SED} ${FILES_SUBST_SED} ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE}
+ for script in ${RCD_SCRIPTS}; do \
+ ${SED} ${FILES_SUBST_SED} ${FILESDIR}/$${script}.sh \
+ > ${WRKDIR}/$${script}; \
+ done
post-install:
# Install Samba documentation.
- #
${INSTALL_DATA_DIR} ${DOCDIR} ${HTMLDIR}
cd ${WRKDIR}/${DISTNAME}/docs; \
${INSTALL_DATA} announce *.reg textdocs/* ${DOCDIR}; \
${INSTALL_DATA} faq/*.html ${HTMLDIR}
# Install Samba examples.
- #
${INSTALL_DATA_DIR} ${EXAMPLESDIR}
${CP} -R ${WRKDIR}/${DISTNAME}/examples/* ${EXAMPLESDIR}
${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${EXAMPLESDIR}
${CHMOD} -R ugo-w ${EXAMPLESDIR}
- ${INSTALL_SCRIPT} ${WRKDIR}/samba.sh ${PREFIX}/etc/rc.d/samba
+ for script in ${RCD_SCRIPTS}; do \
+ ${INSTALL_SCRIPT} ${WRKDIR}/$${script} \
+ ${PREFIX}/etc/rc.d/$${script}; \
+ done
${MV} ${PREFIX}/bin/convert_smbpasswd ${PREFIX}/sbin/convert_smbpasswd
${INSTALL_SCRIPT} ${WRKSRC}/script/mksmbpasswd.sh \
${PREFIX}/sbin/mksmbpasswd
@@ -109,4 +101,5 @@ post-install:
.include "../../devel/gettext-lib/buildlink.mk"
.include "../../devel/readline/buildlink.mk"
.include "../../security/openssl/buildlink.mk"
+.include "../../mk/bsd.pkg.install.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/net/samba20/PLIST b/net/samba20/PLIST
index 5976bb69b07..afca26b3cef 100644
--- a/net/samba20/PLIST
+++ b/net/samba20/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.1 2001/10/31 22:58:46 zuntum Exp $
+@comment $NetBSD: PLIST,v 1.2 2001/11/21 17:17:44 jlam Exp $
bin/addtosmbpass
bin/make_printerdef
bin/make_smbcodepage
@@ -12,7 +12,9 @@ bin/smbstatus
bin/smbtar
bin/testparm
bin/testprns
+etc/rc.d/nmbd
etc/rc.d/samba
+etc/rc.d/smbd
man/man1/make_smbcodepage.1
man/man1/make_unicodemap.1
man/man1/nmblookup.1
diff --git a/net/samba20/files/nmbd.sh b/net/samba20/files/nmbd.sh
new file mode 100755
index 00000000000..9f60a1d0c0c
--- /dev/null
+++ b/net/samba20/files/nmbd.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# $NetBSD: nmbd.sh,v 1.3 2001/11/21 17:17:44 jlam Exp $
+#
+# PROVIDE: nmbd
+# REQUIRE: DAEMON
+
+if [ -d /etc/rc.d -a -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
+name="nmbd"
+rcvar=$name
+command="@PREFIX@/sbin/${name}"
+required_files="@SAMBA_ETCDIR@/smb.conf"
+extra_commands="reload"
+command_args="-D" # _must_ start as daemon from rc.d;
+ # add more flags through ${${name}_flags}
+
+reload_cmd=":" # avoid dumping debug output on SIGHUP
+
+if [ ! -d /etc/rc.d ]
+then
+ @ECHO@ -n ' ${name}'
+ ${command} ${nmbd_flags} ${command_args}
+else
+ load_rc_config $name
+ run_rc_command "$1"
+fi
diff --git a/net/samba20/files/samba.sh b/net/samba20/files/samba.sh
index 5fe93e2a90b..be58749b28d 100644
--- a/net/samba20/files/samba.sh
+++ b/net/samba20/files/samba.sh
@@ -1,52 +1,49 @@
#!/bin/sh
#
-# $NetBSD: samba.sh,v 1.2 2001/08/23 04:15:11 jlam Exp $
+# $NetBSD: samba.sh,v 1.3 2001/11/21 17:17:44 jlam Exp $
#
# PROVIDE: samba
-# REQUIRE: DAEMON
-#
-# nmbd may require DNS to resolve NetBIOS hostnames, and smbd may be acting as
-# a Backup Domain Controller and may need the network to be up, so simply
-# require DAEMON above.
-#
-# To use this script, copy to /etc/rc.d and set samba=YES in /etc/rc.conf.
-# You may also set nmbd_flags and smbd_flags to any additional options you
-# wish to pass to the Samba daemons.
+# KEYWORD: nostart
if [ -d /etc/rc.d -a -f /etc/rc.subr ]
then
. /etc/rc.subr
fi
-arg="$1"
-rcvar="samba"
-required_files="@SAMBA_ETCDIR@/smb.conf"
-extra_commands="reload"
-command_args="-D" # _must_ start as daemon from rc.d;
- # add more flags through ${${name}_flags}
+# NOTE: run_rc_command sets $_arg
+#
+forward_commands()
+{
+ for file in $COMMAND_LIST; do
+ /etc/rc.d/$file $_arg
+ done
+}
-name="nmbd"
-command="@PREFIX@/sbin/${name}"
-reload_cmd=":" # avoid dumping debug output on SIGHUP
+reverse_commands()
+{
+ REVCOMMAND_LIST=
+ for file in $COMMAND_LIST; do
+ REVCOMMAND_LIST="$file $REVCOMMAND_LIST"
+ done
+ for file in $REVCOMMAND_LIST; do
+ /etc/rc.d/$file $_arg
+ done
+}
-if [ ! -d /etc/rc.d ]
-then
- @ECHO@ -n ' ${name}'
- ${command} ${nmbd_flags} ${command_args}
-else
- load_rc_config $name
- run_rc_command "$arg"
-fi
+COMMAND_LIST="nmbd smbd"
-name="smbd"
-command="@PREFIX@/sbin/${name}"
-reload_cmd= # use default reload command for smbd
+name="samba"
+start_cmd="forward_commands"
+stop_cmd="reverse_commands"
+reload_cmd="forward_commands"
+status_cmd="forward_commands"
+extra_commands="reload status"
if [ ! -d /etc/rc.d ]
then
@ECHO@ -n ' ${name}'
- ${command} ${smbd_flags} ${command_args}
+ _arg="$1"
+ ${start_cmd}
else
- load_rc_config $name
run_rc_command "$1"
fi
diff --git a/net/samba20/files/smbd.sh b/net/samba20/files/smbd.sh
new file mode 100755
index 00000000000..3e233312f8a
--- /dev/null
+++ b/net/samba20/files/smbd.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# $NetBSD: smbd.sh,v 1.4 2001/11/21 17:17:44 jlam Exp $
+#
+# PROVIDE: smbd
+# REQUIRE: DAEMON
+
+if [ -d /etc/rc.d -a -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
+name="smbd"
+rcvar=$name
+command="@PREFIX@/sbin/${name}"
+required_files="@SAMBA_ETCDIR@/smb.conf"
+extra_commands="reload"
+command_args="-D" # _must_ start as daemon from rc.d;
+ # add more flags through ${${name}_flags}
+
+if [ ! -d /etc/rc.d ]
+then
+ @ECHO@ -n ' ${name}'
+ ${command} ${smbd_flags} ${command_args}
+else
+ load_rc_config $name
+ run_rc_command "$1"
+fi