Index: head/japanese/ebnetd/Makefile =================================================================== --- head/japanese/ebnetd/Makefile (revision 524527) +++ head/japanese/ebnetd/Makefile (revision 524528) @@ -1,47 +1,51 @@ # Created by: Motoyuki Kasahara # $FreeBSD$ PORTNAME= ebnetd PORTVERSION= 1.0 -PORTREVISION= 11 +PORTREVISION= 12 CATEGORIES= japanese MASTER_SITES= ftp://ftp.sra.co.jp/pub/misc/eb/ MAINTAINER= yasu@utahime.org COMMENT= Servers for accessing CD-ROM books via TCP/IP LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/COPYING LIB_DEPENDS= libeb.so:japanese/eb +USES= iconv:patch + GNU_CONFIGURE= yes CONFIGURE_ARGS= --localstatedir=${RUNDIR} --with-logdir=${LOGDIR} CONFIGURE_ENV= PERL=${PREFIX}/bin/perl USERS= ${EBNETD_USER} GROUPS= ${EBNETD_GROUP} # Local variables LOGDIR= /var/log RUNDIR= /var/run EBNETD_USER= ebnetd EBNETD_GROUP= ebnetd USE_RC_SUBR= ebhttpd ebnetd ndtpd SUB_FILES= pkg-message PLIST_SUB= EBNETD_RUNDIR=${RUNDIR}/${PORTNAME} \ EBNETD_USER=${EBNETD_USER} \ EBNETD_GROUP=${EBNETD_GROUP} INFO= ebnetd ebnetd-ja post-patch: + ${MV} ${WRKSRC}/doc-ja/ebnetd-ja.texi ${WRKSRC}/doc-ja/ebnetd-ja.texi.orig + ${ICONV_CMD} -f EUC-JP -t UTF-8 ${WRKSRC}/doc-ja/ebnetd-ja.texi.orig > ${WRKSRC}/doc-ja/ebnetd-ja.texi ${REINPLACE_CMD} -e "s/%%EBNETD_USER%%/${EBNETD_USER}/" \ -e "s/%%EBNETD_GROUP%%/${EBNETD_GROUP}/" \ ${WRKSRC}/ebnetd.conf.sample.in post-install: ${MKDIR} -m 0755 ${STAGEDIR}${RUNDIR}/${PORTNAME} .include Index: head/japanese/ebnetd/pkg-install =================================================================== --- head/japanese/ebnetd/pkg-install (revision 524527) +++ head/japanese/ebnetd/pkg-install (revision 524528) @@ -1,119 +1,121 @@ #!/bin/sh - # an installation script for ebnetd BATCH=${BATCH:=no} basename=`basename $0` ask() { local question default answer question=$1 default=$2 - if [ -z "${PACKAGE_BUILDING}" -a x${BATCH} = xno ]; then + if [ x${BATCH} = xno ]; then read -p "${question} (y/n) [${default}]? " answer - [ "${answer}" ] && default=${answer} + [ "${answer}" ] && default=${answer} fi echo ${default} } yesno() { local question default question=$1 default=$2 while :; do case `ask "${question}" ${default}` in [Yy]*) return 0;; [Nn]*) return 1;; esac echo "Please answer yes or no." 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 entries for EBNETD (`ebnet' and `ndtp') to /etc/services. # file=/etc/services back=${file}.bak 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 checkall ${file} ${entrylist}; then - echo "This system has already all entries for EBNETD in ${file}." -else - 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}." - add ${file} ${entry_ebnet} ${port_ebnet} ${comment_ebnet} - add ${file} ${entry_ndtp} ${port_ndtp} ${comment_ndtp} +if [ -z "${PACKAGE_BUILDING}" ]; then + echo "************************************************************************" + if checkall ${file} ${entrylist}; then + echo "This system has already all entries for EBNETD in ${file}." + else + 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}." + add ${file} ${entry_ebnet} ${port_ebnet} ${comment_ebnet} + add ${file} ${entry_ndtp} ${port_ndtp} ${comment_ndtp} + fi fi + echo "************************************************************************" fi -echo "************************************************************************" exit 0