ports/73131: [PATCH] japanese/ndtpd Update to ebnetd 1.0

KIMURA Yasuhiro yasu at utahime.org
Mon Oct 25 17:00:47 UTC 2004


>Number:         73131
>Category:       ports
>Synopsis:       [PATCH] japanese/ndtpd Update to ebnetd 1.0
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 25 17:00:46 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     KIMURA Yasuhiro
>Release:        FreeBSD 4.10-RELEASE-p3 i386
>Organization:
>Environment:
System: FreeBSD eastasia.home.utahime.org 4.10-RELEASE-p3 FreeBSD 4.10-RELEASE-p3 #0: Mon Sep 20 23:12:27 JST 2004 root at eastasia.home.utahime.org:/usr/obj/usr1/cvsup/releng_4_10/src/sys/EASTASIA i386


	
>Description:
	- Update to ebnetd 1.0, the successor of ndtpd.
	- rcNGfy startup script
	- pkg-install script should work properly now with BATCH=yes

	As package name is changed, directory of package should also
	be changed from japanese/ndtpd to japanese/ebnetd.

	
>How-To-Repeat:
	
>Fix:

	

--- ebnetd.diff begins here ---
diff -Nru japanese/ndtpd/Makefile japanese/ebnetd/Makefile
--- japanese/ndtpd/Makefile	Wed Feb  4 14:44:56 2004
+++ japanese/ebnetd/Makefile	Mon Oct 25 23:20:32 2004
@@ -1,22 +1,18 @@
-# New ports collection makefile for:	ndtpd
+# New ports collection makefile for:	ebnetd
 # Date created:			4 Aug 1998
 # Whom:				Motoyuki Kasahara <m-kasahr at sra.co.jp>
 #
 # $FreeBSD: ports/japanese/ndtpd/Makefile,v 1.31 2004/02/04 05:21:22 marcus Exp $
 #
 
-PORTNAME=	ndtpd
-PORTVERSION=	3.1.5
-PORTREVISION=	1
+PORTNAME=	ebnetd
+PORTVERSION=	1.0
 CATEGORIES=	japanese ipv6
-MASTER_SITES=	ftp://ftp.sra.co.jp/pub/net/ndtp/ndtpd/ \
-		ftp://ftp.eos.hokudai.ac.jp/pub/net/ndtp/ndtpd/
-
-PATCH_SITES=	${MASTER_SITES}
-#PATCHFILES=	${DISTNAME}+.diff
+MASTER_SITES=	ftp://ftp.sra.co.jp/pub/misc/eb/ \
+		ftp://ftp.eos.hokudai.ac.jp/pub/net/ndtp/eb/
 
 MAINTAINER=	takamune2004 at yahoo.co.jp
-COMMENT=	Server for accessing CD-ROM books with NDTP
+COMMENT=	Servers for accessing CD-ROM books via TCP/IP
 
 LIB_DEPENDS=	eb.7:${PORTSDIR}/japanese/eb
 
@@ -24,18 +20,19 @@
 CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
 CONFIGURE_ARGS=	--localstatedir=${RUNDIR} --with-logdir=${LOGDIR}
 
-.if !defined(PACKAGE_BUILDING)
-IS_INTERACTIVE=	Maybe_interactive_at_install_stage
-.endif
-
 # Local variables
 LOGDIR=		/var/log
 RUNDIR=		/var/run
-STARTUP_SCRIPT=	${PORTNAME}.sh.sample
+STARTUP_SCRIPT=	${PORTNAME}.sh
+
+USE_RC_SUBR=	yes
+RC_SCRIPTS_SUB=	PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
+
+INFO=		ebnetd ebnetd-ja
 
 post-build:
-	${SED} "s, at prefix@,${PREFIX},; s, at rundir@,${RUNDIR},"\
-	  ${FILESDIR}/${STARTUP_SCRIPT} > ${WRKDIR}/${STARTUP_SCRIPT}
+	${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+		${FILESDIR}/${STARTUP_SCRIPT} > ${WRKDIR}/${STARTUP_SCRIPT}
 
 post-install:
 	${INSTALL_SCRIPT} ${WRKDIR}/${STARTUP_SCRIPT} ${PREFIX}/etc/rc.d
diff -Nru japanese/ndtpd/distinfo japanese/ebnetd/distinfo
--- japanese/ndtpd/distinfo	Wed Mar 31 18:53:44 2004
+++ japanese/ebnetd/distinfo	Sun Oct  3 01:07:41 2004
@@ -1,2 +1,2 @@
-MD5 (ndtpd-3.1.5.tar.gz) = ccfd4f2f539802b1abe6d922e7cfa374
-SIZE (ndtpd-3.1.5.tar.gz) = 558367
+MD5 (ebnetd-1.0.tar.gz) = 854237acd834060bbbd021af353ef253
+SIZE (ebnetd-1.0.tar.gz) = 686413
diff -Nru japanese/ndtpd/files/ebnetd.sh japanese/ebnetd/files/ebnetd.sh
--- japanese/ndtpd/files/ebnetd.sh	Thu Jan  1 09:00:00 1970
+++ japanese/ebnetd/files/ebnetd.sh	Sun Oct  3 23:39:30 2004
@@ -0,0 +1,77 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: ebnetd ndtpd ebhttpd
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: FreeBSD shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable EBNETD servers:
+# ebnetd_enable (bool):  Set to "NO" by default.
+#                        Set it to "YES" to enable ebnetd.
+# ebnetd_flags (str):    Set to "" by default.
+#                        Extra flags passed to start ebnetd.
+# ndtpd_enable (bool):   Set to "NO" by default.
+#                        Set it to "YES" to enable ndtpd.
+# ndtpd_flags (str):     Set to "" by default.
+#                        Extra flags passed to start ndtpd.
+# ebhttpd_enable (bool): Set to "NO" by default.
+#                        Set it to "YES" to enable ebhttpd.
+# ebhttpd_flags (str):   Set to "" by default.
+#                        Extra flags passed to start ebhttpd.
+
+. %%RC_SUBR%%
+
+# ebnetd
+name=ebnetd
+rcvar=`set_rcvar`
+command="%%PREFIX%%/sbin/${name}"
+pidfile="/var/run/ebnetd/ebnd.pid"
+required_dirs="/var/run/ebnetd"
+required_files=%%PREFIX%%/etc/ebnetd.conf
+
+ebnetd_enable=${ebnetd_enable:-"NO"}
+ebnetd_flags=${ebnetd_flags:-""}
+
+sig_reload=SIGHUP
+extra_commands="reload"
+
+load_rc_config $name
+run_rc_command "$1"
+
+# ndtpd
+name=ndtpd
+rcvar=`set_rcvar`
+command="%%PREFIX%%/sbin/${name}"
+pidfile="/var/run/ebnetd/${name}.pid"
+required_dirs="/var/run/ebnetd"
+required_files=%%PREFIX%%/etc/ebnetd.conf
+
+ndtpd_enable=${ndtpd_enable:-"NO"}
+ndtpd_flags=${ndtpd_flags:-""}
+
+sig_reload=SIGHUP
+extra_commands="reload"
+
+load_rc_config $name
+run_rc_command "$1"
+
+# ebhttpd
+name=ebhttpd
+rcvar=`set_rcvar`
+command="%%PREFIX%%/sbin/${name}"
+pidfile="/var/run/ebnetd/${name}.pid"
+required_dirs="/var/run/ebnetd"
+required_files=%%PREFIX%%/etc/ebnetd.conf
+
+ebhttpd_enable=${ebhttpd_enable:-"NO"}
+ebhttpd_flags=${ebhttpd_flags:-""}
+
+sig_reload=SIGHUP
+extra_commands="reload"
+
+load_rc_config $name
+run_rc_command "$1"
diff -Nru japanese/ndtpd/files/ndtpd.sh.sample japanese/ebnetd/files/ndtpd.sh.sample
--- japanese/ndtpd/files/ndtpd.sh.sample	Sun Aug 19 04:35:06 2001
+++ japanese/ebnetd/files/ndtpd.sh.sample	Thu Jan  1 09:00:00 1970
@@ -1,57 +0,0 @@
-#!/bin/sh -e -
-#
-# $FreeBSD: ports/japanese/ndtpd/files/ndtpd.sh.sample,v 1.5 2001/08/18 19:35:06 ijliao Exp $
-#
-# startup script for ndtpd
-# Usage: ndtpd.sh {start|stop}
-
-command=$1
-standalone=YES		# Run ndtpd as a standalone daemon.
-#standalone=NO		# Run ndtpd as a child of inetd.
-
-GetDirective() {
-    local directive
-
-    directive=$1
-
-    awk '/^[ 	]*'${directive}'[ 	]+/ {print $2; exit}' ${conf}
-}
-
-MakeWorkingDirectory() {
-    local user group work
-
-    user="`GetDirective user`"
-    group="`GetDirective group`"
-    work="`GetDirective work-path`"
-
-    rm -rf ${work:=@rundir@/ndtpd}
-    eval install -d ${user:+-o ${user}} ${group:+-g ${group}} ${work}
-}
-
-conf=@prefix@/etc/ndtpd.conf
-ndtpd=@prefix@/sbin/ndtpd
-ndtpcheck=@prefix@/sbin/ndtpcheck
-ndtpcontrol=@prefix@/sbin/ndtpcontrol
-
-${ndtpcheck} -c ${conf} || exit
-
-case "${command}" in
-start)
-    MakeWorkingDirectory
-
-    if [ "${standalone}" = YES ]; then
-	${ndtpd} && echo -n " ndtpd"
-    fi
-    ;;
-stop)
-    if [ "${standalone}" = YES ]; then
-	${ndtpcontrol} terminate && echo -n " ndtpd"
-    fi
-    ;;
-*)
-    echo "usage: `basename $0` {start|stop}" >&2
-    exit 22
-    ;;
-esac
-
-exit
diff -Nru japanese/ndtpd/files/patch-doc-ja::ebnetd-ja.texi japanese/ebnetd/files/patch-doc-ja::ebnetd-ja.texi
--- japanese/ndtpd/files/patch-doc-ja::ebnetd-ja.texi	Thu Jan  1 09:00:00 1970
+++ japanese/ebnetd/files/patch-doc-ja::ebnetd-ja.texi	Sun Oct  3 02:00:19 2004
@@ -0,0 +1,13 @@
+--- ../ebnetd-1.0-dist/doc-ja/ebnetd-ja.texi	Wed Sep  3 20:26:39 2003
++++ doc-ja/ebnetd-ja.texi	Sat Oct  2 23:50:34 2004
+@@ -8,9 +8,7 @@
+ 
+ @dircategory CD-ROM Book Utilities
+ @direntry
+-* EBNETD: (ebnetd).             Network EB Library server.
+-* NDTPD: (ndtpd).               Server for accessing CD-ROM books with NDTP.
+-* ebHTTPD: (ebhttpd).           Server for accessing CD-ROM books with HTTP.
++* EBNETD-ja: (ebnetd-ja).       Servers for accessing CD-ROM books via TCP/IP
+ @end direntry
+ 
+ @ifinfo
diff -Nru japanese/ndtpd/files/patch-doc::ebnetd.texi japanese/ebnetd/files/patch-doc::ebnetd.texi
--- japanese/ndtpd/files/patch-doc::ebnetd.texi	Thu Jan  1 09:00:00 1970
+++ japanese/ebnetd/files/patch-doc::ebnetd.texi	Sun Oct  3 01:59:39 2004
@@ -0,0 +1,13 @@
+--- ../ebnetd-1.0-dist/doc/ebnetd.texi	Wed Sep  3 20:26:39 2003
++++ doc/ebnetd.texi	Sat Oct  2 23:46:15 2004
+@@ -8,9 +8,7 @@
+ 
+ @dircategory CD-ROM Book Utilities
+ @direntry
+-* EBNETD: (ebnetd).             Network EB Library server.
+-* NDTPD: (ndtpd).               Server for accessing CD-ROM books with NDTP.
+-* ebHTTPD: (ebhttpd).           Server for accessing CD-ROM books with HTTP.
++* EBNETD: (ebnetd).             Servers for accessing CD-ROM books via TCP/IP
+ @end direntry
+ 
+ @ifinfo
diff -Nru japanese/ndtpd/pkg-descr japanese/ebnetd/pkg-descr
--- japanese/ndtpd/pkg-descr	Thu Jan 22 20:06:09 2004
+++ japanese/ebnetd/pkg-descr	Sun Oct  3 01:45:38 2004
@@ -1,18 +1,25 @@
-NDTPD is a server for accessing CD-ROM books with NDTP (Network
-Dictionary Transfer Protocol) on TCP.  You can replace dserver with
-NDTPD.  NDTPD can run on UNIX derived systems.  It supports CD-ROM
-books of EB, EBG, EBXA, EBXA-C, S-EBXA and EPWING formats.  CD-ROM
-books of those formats are popular in Japan.  Since CD-ROM books
-themseves are stands on the ISO 9660 format, you can mount the discs
-by the same way as other ISO 9660 discs.
-
--- Motoyuki Kasahara <m-kasahr at sra.co.jp>
-
-In addition, you must follow the licenses of your CD-ROM books.
-Though NDTPD is free software, your books may not be free.  Don't
-open your books to unlicensed hosts nor users.
+This EBNETD distribution contains three server commands: ebnetd, ndtpd
+and ebhttpd. They are servers for accessing CD-ROM book on remote host
+via TCP/IP.
 
-You can get information about NDTPD from their website.
-WWW: http://www.sra.co.jp/people/m-kasahr/ndtpd/
+ebnetd:  ebnetd is a server of EBNET protocol which is designed to
+	 communicate with EB Library. For more details about EB
+	 Library, see http://www.sra.co.jp/m-kasahr/eb/.
 
--- Kazu TAKAMUNE <takamune2004 at yahoo.co.jp>
+ndtpd:   ndtpd is an NDTP (Network Dictionary Transfer Protocol)
+	 server. The first implementation of the NDTP esrver is
+	 `dserver'. ndtpd has upper compatibility with dserver-2.2.
+
+ebhttpd: ebhttpd is a WWW (World Wide Web) server. It supprts HTTP/1.0
+	 and HTTP/1.1 (Hypertext Transfer Protocol version 1.0 and 1.1).
+
+The servers support CD-ROM books of EB, EBG, EBXA, EBXA-C, S-EBXA and
+EPWING formats. The servers can run as a standalone daemons by
+default, but can also run as children of `inetd'.
+
+In addition, you must follow the licenses of your CD-ROM books. Though
+EBNETD is free software, your books may not be free. Don't open your
+books to unlicensed hosts nor users.
+
+Author:	Motoyuki Kasahara <m-kasahr at sra.co.jp>
+WWW:	http://www.sra.co.jp/people/m-kasahr/ebnetd/
diff -Nru japanese/ndtpd/pkg-install japanese/ebnetd/pkg-install
--- japanese/ndtpd/pkg-install	Thu Aug 19 19:50:20 1999
+++ japanese/ebnetd/pkg-install	Tue Oct 26 01:17:43 2004
@@ -1,5 +1,8 @@
 #!/bin/sh -
-# an installation script for ndtpd
+# an installation script for ebnetd
+
+BATCH=${BATCH:=no}
+basename=`basename $0`
 
 ask() {
     local question default answer
@@ -7,7 +10,7 @@
     question=$1
     default=$2
 
-    if [ -z "${PACKAGE_BUILDING}" ]; then
+    if [ -z "${PACKAGE_BUILDING}" -a x${BATCH} = xno ]; then
 	read -p "${question} (y/n) [${default}]? " answer
         [ "${answer}" ] && default=${answer}
     fi
@@ -29,31 +32,86 @@
     done
 }
 
+check() {
+    local file entry
+
+    file=$1
+    entry=$2
+
+    sed 's/#.*//' ${file} | grep -qw ${entry}
+}
+
+checkall() {
+    local file list item
+
+    file=$1
+    shift
+    list=$*
+
+    for item in $list; do
+	if check ${file} ${item}; then
+	    :
+	else
+	    return 1
+	fi
+    done
+    return 0
+}
+
+add() {
+    local oldfile newfile entry port comment
+
+    file=$1
+    entry=$2
+    port=$3
+    comment=$4
+
+    if check ${file} ${entry}; then
+	:
+    elif sed 's/#.*//' ${file} | grep -qw ${port} ; then
+	oldumask=`umask`
+	umask 0077
+	tmpfile=`mktemp -q /tmp/${basename}.XXXXXX`
+	if [ $? -ne 0 ]; then
+	    echo "Can't create temp file" 1>&2
+	    exit 1
+	fi
+	cp $file $tmpfile
+	trap '' 1 2 15
+	sed 's,^\([^#]*[ 	]'${port}'\),\1	'${entry}, ${tmpfile} > ${file}
+	trap 1 2 15
+	rm $tmpfile
+	umask $oldumask
+    else
+	echo "${entry}		${port}   #${comment}" >> ${file}
+    fi
+}
+
 [ "$2" = POST-INSTALL ] || exit 0
 
 #
-# Add an entry for `ndtp' to /etc/services.
+# Add entries for EBNETD (`ebnet' and `ndtp') to /etc/services.
 #
 file=/etc/services
 back=${file}.bak
-name=ndtp
-port=2010/tcp
-comment="Network Dictionary Transfer Protocol"
+entrylist='ebnet ndtp'
+entry_ebnet=ebnet
+port_ebnet=22010/tcp
+comment_ebnet='EBNET Protocol'
+entry_ndtp=ndtp
+port_ndtp=2010/tcp
+comment_ndtp='Network Dictionary Transfer Protocol'
 
 echo "************************************************************************"
-if sed 's/#.*//' ${file} | grep -qw ${name}; then
-    echo "This system has already an entry for ${name} in ${file}."
+if checkall ${file} ${entrylist}; then
+    echo "This system has already all entries for EBNETD in ${file}."
 else
-    echo "This system has no entry for ${name} in ${file}."
-    if yesno "  Would you like to add it automatically?" y; then
+    echo "This system doesn't have some of entries for EBNETD in ${file}."
+    if yesno "  Would you like to add them automatically?" y; then
 	cp -f ${file} ${back}
 	echo "    The original file is saved as ${back}."
-
-	if sed 's/#.*//' ${file} | grep -qw ${port}; then
-	    sed 's,^\([^#]*[ 	]'${port}'\),\1	'${name}, ${back} > ${file}
-	else
-	    echo "${name}		${port}   #${comment}" >> ${file}
-	fi
+	add ${file} ${entry_ebnet} ${port_ebnet} ${comment_ebnet}
+	add ${file} ${entry_ndtp} ${port_ndtp} ${comment_ndtp}
     fi
 fi
 echo "************************************************************************"
diff -Nru japanese/ndtpd/pkg-message japanese/ebnetd/pkg-message
--- japanese/ndtpd/pkg-message	Sat Jan 22 15:40:19 2000
+++ japanese/ebnetd/pkg-message	Tue Oct 26 01:36:45 2004
@@ -1,19 +1,32 @@
-************************************************************************
-You'll need manual configurations to actually activate `ndtpd'.
+**********************************************************************
+You'll need manual configurations to actually activate EBNETD servers.
 
-**** IF YOU WANT TO SETUP PRIVATE SYSLOG, edit /etc/syslog.conf.
+Step 0(optional):
+If you want to setup private syslog, edit /etc/syslog.conf.
 
-1st) Copy a sample configuration file `ndtpd.conf.sample' to `ndtpd.conf'
-     in `${PREFIX}/etc' directory, and edit it.
-     Consult the "Configuration File" section of info file.
+Step 1:
+Copy a sample configuration file `ebnetd.conf.sample' to `ebnetd.conf'
+in `${PREFIX}/etc' directory, and edit it. Consult the "Configuration
+File" section of info file.
 
-2nd) Copy a sample startup script `ndtpd.sh.sample' to `ndtpd.sh'
-     in `${PREFIX}/etc/rc.d' directory, and edit it.
+Step 2a:
+To start EBNETD servers as standalone daemons, add the following lines
+to /etc/rc.conf:
+ebhttpd_enable (bool): Set to "NO" by default.
+                       Set it to "YES" to enable ebhttpd.
+ebhttpd_flags (str):   Set to "" by default.
+                       Extra flags passed to start ebhttpd.
+ebnetd_enable (bool):  Set to "NO" by default.
+                       Set it to "YES" to enable ebnetd.
+ebnetd_flags (str):    Set to "" by default.
+                       Extra flags passed to start ebnetd.
+ndtpd_enable (bool):   Set to "NO" by default.
+                       Set it to "YES" to enable ndtpd.
+ndtpd_flags (str):     Set to "" by default.
+                       Extra flags passed to start ndtpd.
 
-     a) To start `ndtpd' as a standalone daemon, set the variable
-	`standalone' in the script to `YES', and exec it.
-
-     b) Otherwise, to start as a child process of `inetd',
-	set `standalone' to `NO', and edit the file `/etc/inetd.conf'.
-	Consult the "Run as a Child of inetd" section of info file.
-************************************************************************
+Step 2b:
+To start EBNETD servers as child processes of 'inetd', edit
+/etc/inetd.conf. Consult the "Run `xxxx' as a child of `inetd'"
+sections of info file.
+**********************************************************************
diff -Nru japanese/ndtpd/pkg-plist japanese/ebnetd/pkg-plist
--- japanese/ndtpd/pkg-plist	Mon Apr  1 01:14:54 2002
+++ japanese/ebnetd/pkg-plist	Mon Oct 25 20:04:55 2004
@@ -1,18 +1,19 @@
-etc/ndtpd.conf.sample
-etc/rc.d/ndtpd.sh.sample
- at unexec install-info --delete %D/info/ndtpd-ja.info %D/info/dir
- at unexec install-info --delete %D/info/ndtpd.info %D/info/dir
-info/ndtpd-ja.info
-info/ndtpd-ja.info-1
-info/ndtpd-ja.info-2
-info/ndtpd.info
-info/ndtpd.info-1
-info/ndtpd.info-2
- at exec install-info %D/info/ndtpd-ja.info %D/info/dir
- at exec install-info %D/info/ndtpd.info %D/info/dir
+ at comment $FreeBSD$
+etc/ebnetd.conf.sample
+etc/rc.d/ebnetd.sh
+libexec/ebhtstat
+libexec/ebnstat
 libexec/ndtpstat
+sbin/ebhtcheck
+sbin/ebhtcontrol
+sbin/ebhttpd
+sbin/ebncheck
+sbin/ebncontrol
+sbin/ebndaily
+sbin/ebnetd
+sbin/ebnupgrade
 sbin/ndtpcheck
 sbin/ndtpcontrol
 sbin/ndtpd
-sbin/ndtpdaily
-sbin/ndtpupgrade
+ at exec /bin/mkdir -m 0755 -p /var/run/ebnetd
+ at unexec rmdir /var/run/ebnetd
--- ebnetd.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list