diff options
author | asami <asami@FreeBSD.org> | 1997-09-19 17:30:11 +0800 |
---|---|---|
committer | asami <asami@FreeBSD.org> | 1997-09-19 17:30:11 +0800 |
commit | 0bb8cee4ccdc0f485766efb3605fe6d378c1f376 (patch) | |
tree | 055caf58fc95be0815a8710984b0161bb64fd313 /japanese/Wnn6 | |
parent | f2019eb6f4d5844b035f01379a031862d318a499 (diff) | |
download | freebsd-ports-graphics-0bb8cee4ccdc0f485766efb3605fe6d378c1f376.tar.gz freebsd-ports-graphics-0bb8cee4ccdc0f485766efb3605fe6d378c1f376.tar.zst freebsd-ports-graphics-0bb8cee4ccdc0f485766efb3605fe6d378c1f376.zip |
Cleanup etc. submitted by port maintainer. Create account automatically
if it doesn't exist, and chown everything to the right UID after unpacking.
Submitted by: maintainer
Diffstat (limited to 'japanese/Wnn6')
-rw-r--r-- | japanese/Wnn6/Makefile | 72 | ||||
-rw-r--r-- | japanese/Wnn6/pkg-comment | 2 | ||||
-rw-r--r-- | japanese/Wnn6/pkg-descr | 12 | ||||
-rw-r--r-- | japanese/Wnn6/pkg-install | 201 | ||||
-rw-r--r-- | japanese/Wnn6/pkg-plist | 3 |
5 files changed, 225 insertions, 65 deletions
diff --git a/japanese/Wnn6/Makefile b/japanese/Wnn6/Makefile index 4d4abfcaaca..23ccfc1a28c 100644 --- a/japanese/Wnn6/Makefile +++ b/japanese/Wnn6/Makefile @@ -1,13 +1,13 @@ -# New ports collection makefile for: Wnn6-demo +# New ports collection makefile for: Wnn6 # Version required: 97.6.6 # Date created: 15 July 1997 # Whom: Satoshi Taoka <taoka@infonets.hiroshima-u.ac.jp> # -# $Id: Makefile,v 1.17 1997/09/10 06:51:52 asami Exp $ +# $Id: Makefile,v 1.18 1997/09/10 07:55:31 asami Exp $ # DISTNAME= OMRONWnn6 -PKGNAME= jp-Wnn6-97.6.6 +PKGNAME= ja-Wnn6-97.6.6 CATEGORIES= japanese EXTRACT_SUFX= .tgz @@ -16,74 +16,72 @@ MAINTAINER= taoka@infonets.hiroshima-u.ac.jp IGNOREFILES= ${DISTFILES} WRKSRC= ${WRKDIR} LIBDIR= ${PREFIX}/OMRONWnn6 -STARTUP_SCRIPT= ${PREFIX}/etc/rc.d/wnn6.sh DISTDIR= ${MOUNT_PT}/fbsd MOUNT_PT?= /cdrom MOUNT_DEV?= /dev/wcd0c -RESTRICTED= "Restrictive copyright" - -NO_CDROM= yes -NO_PACKAGE= yes +RESTRICTED= "You should buy from Omron Software Co., Ltd." +NO_CDROM= "You should buy from Omron Software Co., Ltd." +NO_PACKAGE= "You should buy from Omron Software Co., Ltd." +NO_BUILD= yes NO_CONFIGURE= yes NO_PATCH= yes IS_INTERACTIVE= yes +# If ${.CURDIR}/work/.build_done (which will be ${BUILD_COOKIE}) exists, +# we do nothing in a 'do-fetch' stage. +.if exists(${.CURDIR}/work/.build_done) +do-fetch: +.else do-fetch: - @echo -n "Please set the CD-ROM of 'Wnn6' into your cdrom-drive. (Press Return)"; \ + @${ECHO} -n "Please set the CD-ROM of 'Wnn6' into your cdrom-drive. (Press Return)"; \ read dummy; \ - echo "A mount point and the device file are '${MOUNT_PT}' and '${MOUNT_DEV}' respectively."; \ - echo -n "Are these correct? (y/n) [y]"; \ + ${ECHO} "By default, a mount point and a device file"; \ + ${ECHO} " are '${MOUNT_PT}' and '${MOUNT_DEV}' respectively."; \ + ${ECHO} -n "Are these correct? (y/n) [y]"; \ (read ans; \ case x$${ans} in \ xn*|xN*) \ - echo "Please rerun 'make' in specifying MOUNT_PT and MOUNT_DEV"; \ - echo "For example:"; \ - echo " make MOUNT_PT=/mnt MOUNT_DEV=/dev/cd0c"; \ + ${ECHO} "###########################################################"; \ + ${ECHO} "Please rerun 'make' in specifying MOUNT_PT and MOUNT_DEV"; \ + ${ECHO} "For example:"; \ + ${ECHO} " make MOUNT_PT=/mnt MOUNT_DEV=/dev/cd0c"; \ + ${ECHO} "###########################################################"; \ /usr/bin/false; \ ;; \ *) \ - echo "Now mounting the CD-ROM ..."; \ + ${ECHO} "Now mounting the CD-ROM ..."; \ ;; \ esac) - @for t in `mount | grep ${MOUNT_PT}`; do \ + @for t in `mount | ${GREP} ${MOUNT_PT}`; do \ if [ x"$$t" = x"${MOUNT_PT}" ]; then \ - echo "##################################################"; \ - echo "${MOUNT_PT} is busy"; \ - echo "Please umount ${MOUNT_PT}"; \ - echo "##################################################"; \ + ${ECHO} "##################################################"; \ + ${ECHO} "${MOUNT_PT} is busy"; \ + ${ECHO} "Please 'umount ${MOUNT_PT}'"; \ + ${ECHO} "##################################################"; \ /usr/bin/false; \ fi; \ done @/sbin/mount_cd9660 ${MOUNT_DEV} ${MOUNT_PT} +.endif pre-extract: @if [ ! -e ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} ]; then \ - echo "${DISTDIR}/${DISTNAME}${EXTRACT_SUFX}: No such file"; \ - echo "Perhaps the CD-ROM is not one of Wnn6"; \ + ${ECHO} "${DISTDIR}/${DISTNAME}${EXTRACT_SUFX}: No such file"; \ + ${ECHO} "Perhaps the CD-ROM is not one of Wnn6"; \ /sbin/umount ${MOUNT_PT}; \ - echo "Umounting is done ..."; \ + ${ECHO} "Umounting is done ..."; \ /usr/bin/false; \ fi -do-build: +post-extract: @/sbin/umount ${MOUNT_PT} +pre-install: + @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGDIR}/INSTALL ${PKGNAME} PRE-INSTALL + do-install: @cd ${WRKSRC}/usr; tar cf - OMRONWnn6 | (cd ${PREFIX}; tar xvpf -) - @${INSTALL_SCRIPT} ${FILESDIR}/setup.sh ${LIBDIR} - @if [ ! -f ${STARTUP_SCRIPT} ]; then \ - echo "Installing ${STARTUP_SCRIPT} startup file."; \ - echo '#!/bin/sh' > ${STARTUP_SCRIPT}; \ - echo 'wnn6=/usr/local/bin/Wnn6/jserver' \ - >> ${STARTUP_SCRIPT} ; \ - echo 'if [ -f $$wnn6 ]; then' >> ${STARTUP_SCRIPT} ; \ - echo " echo -n ' Wnn6'" >> ${STARTUP_SCRIPT}; \ - echo ' $$wnn6' >> ${STARTUP_SCRIPT} ; \ - echo "fi" >> ${STARTUP_SCRIPT} ; \ - chmod 755 ${STARTUP_SCRIPT} ; \ - chown bin.bin ${STARTUP_SCRIPT}; \ - fi post-install: @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGDIR}/INSTALL ${PKGNAME} POST-INSTALL diff --git a/japanese/Wnn6/pkg-comment b/japanese/Wnn6/pkg-comment index 3f582ae1651..34d5fbf9c62 100644 --- a/japanese/Wnn6/pkg-comment +++ b/japanese/Wnn6/pkg-comment @@ -1 +1 @@ -A Japanese input method (this is a commodity) +A Japanese input method (this is not free) diff --git a/japanese/Wnn6/pkg-descr b/japanese/Wnn6/pkg-descr index 89762d5517e..3da0e09e45a 100644 --- a/japanese/Wnn6/pkg-descr +++ b/japanese/Wnn6/pkg-descr @@ -1,5 +1,5 @@ -This is Wnn6, a Japanese input method. This software is a commodity, -and you can buy it from Omron Software Co., Ltd. +This is Wnn6, a Japanese input method. This software 'Wnn6' is not +free, and you can buy it from Omron Software Co., Ltd. +------------------------------------------+ | URL: http://www.omronsoft.co.jp | @@ -8,15 +8,13 @@ and you can buy it from Omron Software Co., Ltd. | FAX: +81-44-246-6011 | +------------------------------------------+ -Remark 1. If you install this package, the folloing symbolic links are -made, +Remark 1. If a value of ${PKG_PREFIX} is not '/usr/local', the +following symbolic links are made: "/usr/local/bin/Wnn6" to "${PKG_PREFIX}/OMRONWnn6/Wnn6fbsd" and, "/usr/local/lib/wnn6" to "${PKG_PREFIX}/OMRONWnn6/wnn6fbsd". -Remark 2. We do not fetch by FTP. - +Remark 2. We do not fetch by FTP but get from CD-ROM. - S. Taoka taoka@infonets.hiroshima-u.ac.jp - diff --git a/japanese/Wnn6/pkg-install b/japanese/Wnn6/pkg-install index aa52c4e88d6..e50af7b35e6 100644 --- a/japanese/Wnn6/pkg-install +++ b/japanese/Wnn6/pkg-install @@ -1,19 +1,184 @@ #!/bin/sh -if [ "$2" != "POST-INSTALL" ]; then exit 0; fi - -mkdir -p /usr/local/bin -mkdir -p /usr/local/lib -cd /usr/local/bin; rm -f Wnn6; ln -s ${PKG_PREFIX}/OMRONWnn6/Wnn6fbsd Wnn6 -cd /usr/local/lib; rm -f wnn6; ln -s ${PKG_PREFIX}/OMRONWnn6/wnn6fbsd wnn6 -cd ${PKG_PREFIX}/OMRONWnn6/wnn6fbsd/ja_JP; rm -f dic; ln -s ../../wnn6dic dic -chown -R 127.bin ${PKG_PREFIX}/OMRONWnn6 - -echo "######################################################################" -echo "Execute ${PKG_PREFIX}/OMRONWnn6/setup.sh for startup configuration." -if [ X${PKG_PREFIX} != X"/usr/local" ]; then - echo - echo "Warning!!" - echo "We made symbolic links from \"/usr/local/bin/Wnn6\" to \"${PKG_PREFIX}/OMRONWnn6/Wnn6fbsd\"" - echo "and from \"/usr/local/lib/wnn6\" to \"${PKG_PREFIX}/OMRONWnn6/wnn6fbsd\"" -fi -echo "######################################################################" +# an installation script for Wnn6 + +check_pw() +{ + if which -s pw; then + : + else + cat <<EOF + +This system looks like a pre-2.2 version of FreeBSD. We see that it +is missing the "pw" utility. We need this utility. Please get and +install it, and try again. You can get the source from: + + ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/usr.sbin/pw.tar.gz + +EOF + exit 1 + fi +} + +ask() { + local question default answer + + question=$1 + default=$2 + if [ -z "${PACKAGE_BUILDING}" ]; then + read -p "${question} (y/n) [${default}]? " answer + fi + if [ x${answer} = x ]; then + answer=${default} + fi + echo ${answer} +} + +yesno() { + local dflt question answer + + question=$1 + dflt=$2 + while :; do + answer=$(ask "${question}" "${dflt}") + case "${answer}" in + [Yy]*) return 0;; + [Nn]*) return 1;; + esac + echo "Please answer yes or no." + done +} + +case $2 in +PRE-INSTALL) + + ## Hack /etc/services ## + FILE="/etc/services" + # check + OK=no + HAS_WNN6=no + COUNT=1 + for i in `grep wnn6 $FILE `; do + if [ $COUNT = 1 ] && [ X"$i" = X"wnn6" ]; then + HAS_WNN6=yes + elif [ $COUNT = 2 ] && [ $HAS_WNN6 = yes ] && \ + [ X"$i" = X"22273/tcp" ]; then + OK=yes + break + fi + COUNT=`expr ${COUNT} + 1` + done + # add an entry for wnn6 to /etc/services + if [ $OK = no ]; then + echo "This system has no entry for Wnn6 in ${FILE}" + if yesno "Would you like to add it automatically?" y; then + mv ${FILE} ${FILE}.bak + (grep -v wnn6 ${FILE}.bak ; \ + echo "wnn6 22273/tcp # Wnn6") >> ${FILE} + rm ${FILE}.bak + else + echo "Please add 'wnn6 22273/tcp' into ${FILE}, and try again." + exit 1 + fi + fi + + ## Hack /etc/master.passwd ## + # check + id_69=`id -u 69 2> /dev/null` + id_wnn=`id -u wnn 2> /dev/null` + if [ X"$id_wnn" = X69 ];then + exit 0 + elif [ X"$id_69" != X ]; then +cat <<EOF + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +This system already has an account whose name is not 'wnn' and ID +number is 69. + + '`id 69`' + +For Wnn6 in this port or package, ID number of 'wnn' has to be 69. +Please try again after you delete the account. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +EOF + exit 1 + elif [ X"$id_wnn" != X ]; then + cat <<EOF + +This system has an 'wnn' account whose ID number is $id_wnn. It seems +that Wnn4.2 has been already installed. For Wnn6 in this ports or +package, ID number of 'wnn' has to be 69. So we do the following two +things: + +1) You should delete the account. + +2) It seems that all of files or directories for Wnn4.2 are in + ${PKG_PREFIX}/lib/wnn and ${PKG_PREFIX}/bin. You should change these ID + number from '$id_wnn' to '69'. + + Notice: After doing 1) and 2), we will create a new 'wnn' account + whose ID number is '69'. + +EOF + if yesno "Would you like to do the above things automatically" y; then + # We need a command 'pw(8)' + check_pw + pw userdel wnn + if [ $? != 0 ]; then + echo "" + echo "Cannot delete it. Please do it, and try again." + exit 1 + fi + find ${PKG_PREFIX}/lib/wnn ${PKG_PREFIX}/bin \ + -user $id_wnn -exec chown 69 {} \; + else + echo "Please do those, and try again." + exit 1 + fi + fi + + # add an account 'wnn' to this system + echo "" + echo "You need an account 'wnn' whose ID number is 69" + if yesno "Would you like to create it automatically?" y; then + # We need a command 'pw(8)' + check_pw + pw useradd wnn -u 69 -g 7 -h - -d /nonexistent \ + -s /nonexistent -c Wnn6 || exit + else + echo "Please create it, and try again." + exit 1 + fi + ;; + +POST-INSTALL) + + mkdir -p /usr/local/bin + mkdir -p /usr/local/lib + cd /usr/local/bin; rm -f Wnn6; ln -s ${PKG_PREFIX}/OMRONWnn6/Wnn6fbsd Wnn6 + cd /usr/local/lib; rm -f wnn6; ln -s ${PKG_PREFIX}/OMRONWnn6/wnn6fbsd wnn6 + if [ X${PKG_PREFIX} != X"/usr/local" ]; then + echo + echo "Warning!!" + echo "We made symbolic links from \"/usr/local/bin/Wnn6\" to \"${PKG_PREFIX}/OMRONWnn6/Wnn6fbsd\"" + echo "and from \"/usr/local/lib/wnn6\" to \"${PKG_PREFIX}/OMRONWnn6/wnn6fbsd\"" + fi + cd ${PKG_PREFIX}/OMRONWnn6/wnn6fbsd/ja_JP; rm -f dic; ln -s ../../wnn6dic dic + chown -R wnn ${PKG_PREFIX}/OMRONWnn6 + + ## create a startup script ## + wnnserver=/usr/local/bin/Wnn6/jserver + wnnname=Wnn6 + startup_script=${PKG_PREFIX}/etc/rc.d/${wnnname}.sh + if [ ! -f ${startup_script} ]; then + echo "Installing ${startup_script} startup file." + echo '#!/bin/sh' > ${startup_script}; + echo "wnn=${wnnserver}" >> ${startup_script}; + echo 'if [ -f $wnn ]; then' >> ${startup_script}; + echo " echo -n ' ${wnnname}'" >> ${startup_script}; + echo ' $wnn' >> ${startup_script}; + echo "fi" >> ${startup_script}; + chmod 755 ${startup_script} + chown bin.bin ${startup_script} + fi + ;; +esac diff --git a/japanese/Wnn6/pkg-plist b/japanese/Wnn6/pkg-plist index f4876e2547d..12665a4fe84 100644 --- a/japanese/Wnn6/pkg-plist +++ b/japanese/Wnn6/pkg-plist @@ -87,7 +87,6 @@ OMRONWnn6/Wnn6fbsd/wnntouch OMRONWnn6/README.sjis OMRONWnn6/README.jis OMRONWnn6/README.euc -OMRONWnn6/setup.sh @dirrm OMRONWnn6/wnnsdk/sdk @dirrm OMRONWnn6/wnnsdk/mule-2.2.2 @dirrm OMRONWnn6/wnnsdk @@ -101,6 +100,6 @@ OMRONWnn6/setup.sh @dirrm OMRONWnn6/doc @dirrm OMRONWnn6/Wnn6fbsd @dirrm OMRONWnn6 -etc/rc.d/wnn6.sh +etc/rc.d/Wnn6.sh @unexec rm /usr/local/bin/Wnn6 @unexec rm /usr/local/lib/wnn6 |