ports/113572: [patch] japanese/sj3 is broken

Hirohisa Yamaguchi umq at ueo.co.jp
Mon Jun 11 12:00:12 UTC 2007


>Number:         113572
>Category:       ports
>Synopsis:       [patch] japanese/sj3 is broken
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 11 12:00:11 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Hirohisa Yamaguchi
>Release:        FreeBSD 7.0-CURRENT amd64
>Organization:
<organization of PR author (multiple lines)>
>Environment:
System: FreeBSD calliope.****.org 7.0-CURRENT FreeBSD 7.0-CURRENT #8: Mon May 28 02:37:30 JST 2007 root at calliope.****.org:/usr/obj/usr/src/sys/CALLIOPE64 amd64

>Description:
	There are several problems with japanese/sj3 port.

	 1. Original MASTER_SITES don't seem to work any longer.
	 2. With the current patchset it builds okay, but it is said that it does not work correctly.
	 3. It does not build under 7-CURRENT (i.e. with gcc4.2).

>How-To-Repeat:
	cd ports/japanese/sj3
	make && make install
	/usr/local/etc/rc.d/sj3.sh start
	(run sj3 client)

>Fix:

	1. As long as the current version is mirrored in MASTER_SITE_LOCAL
	   this might not be a problem.
	2.,3. There's a new set of patch
	   http://quasiquote.org/log2/SJ3/2007/04/01/patch

	The patch against the port skelton follows.
	 deleted:
	  files/patch-aa
	  files/patch-ab
	 needs fix:
	  pkg-install needs to get appropriate UID number for a dedicated user `_sj3'
	  (and ports/UIDs has to be updated).

diff -Npru ports.orig/japanese/sj3/Makefile ports/japanese/sj3/Makefile
--- ports.orig/japanese/sj3/Makefile	Fri Sep 17 12:21:00 2004
+++ ports/japanese/sj3/Makefile	Mon Jun 11 18:05:37 2007
@@ -7,41 +7,39 @@
 
 PORTNAME=	sj3
 PORTVERSION=	2.0.1.20
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	japanese
 MASTER_SITES=	ftp://ftp.sony.co.jp/pub/unsupported/src/ \
 		ftp://ftp.cs.titech.ac.jp/pub/japanese/sj3/
 MASTER_SITES+=	${MASTER_SITE_LOCAL}
 MASTER_SITE_SUBDIR=	nork
 
-PATCH_SITES=	http://oikumene.que.ne.jp/misc/
-PATCHFILES=	${PORTNAME}-patches-20040916.bz2
+PATCH_SITES=	http://quasiquote.org/files/
+PATCHFILES=	${PORTNAME}-qq-2.0.1.21.diff.gz
+PATCH_DIST_STRIP=	-p1
 
 MAINTAINER=	hiroo+freebsd at oikumene.gcd.org
 COMMENT=	A Japanese input method
 
-BUILD_DEPENDS=	xmkmf:${X_IMAKE_PORT}
+USE_RC_SUBR=	sj3.sh
+USE_IMAKE=	yes
 
 MAN1=		sj3.1 sj3dic.1 sj3mkdic.1 sj3serv.1
 MANLANG=	ja
+MANCOMPRESSED=	no
+PORTDOCS=	Nihongo.ps.Z hinsi.ms makedict.ms sj3lib.ms sj3serv.ms
 
-STARTUP_SCRIPT=	${PREFIX}/etc/rc.d/sj3.sh
-
-# This port requires xmkmf but installs in /usr/local
-#
 # NOTE : You must not use 'xmkmf -a', because the running 'make depend' caused a error.
 
 .include <bsd.port.pre.mk>
 
-do-configure:
-	( cd $(WRKSRC) ; xmkmf ; make Makefiles )
+pre-configure:
+	${REINPLACE_CMD} -e "\#^SJ3TOP#s#=.*#= ${PREFIX}#" \
+		-e "\#^SJ3DICTDIR#s#=.*#= \\$$\(SJ3LIBDIR)/sj3/dict#" \
+		-e "\#^SJ3VARRUNDIR#s#=.*#= ${DESTDIR}\\$$\(VARDIR)/run/sj3#" \
+		${WRKSRC}/sj3.tmpl
 
-post-install:
-	if [ ! -f ${STARTUP_SCRIPT} ]; then 				\
-		${ECHO_MSG} "Installing ${STARTUP_SCRIPT} startup file."; 	\
-		${INSTALL_SCRIPT} ${FILESDIR}/sj3.sh.in ${STARTUP_SCRIPT};	\
-	fi
-	${SETENV} PKG_PREFIX=${PREFIX} \
-		${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+do-configure:
+	( cd $(WRKSRC) ; ${XMKMF} ; make Makefiles )
 
 .include <bsd.port.post.mk>
diff -Npru ports.orig/japanese/sj3/distinfo ports/japanese/sj3/distinfo
--- ports.orig/japanese/sj3/distinfo	Sun Jan 22 21:39:08 2006
+++ ports/japanese/sj3/distinfo	Sat Jun  9 09:05:33 2007
@@ -1,6 +1,6 @@
 MD5 (sj3-2.0.1.20.tar.gz) = 36cc23702e2295e4552271b9d481c863
 SHA256 (sj3-2.0.1.20.tar.gz) = 6195e0252382032f99a2597590283acbcf43180df1d9a0a3754c4c8ad4945292
 SIZE (sj3-2.0.1.20.tar.gz) = 584065
-MD5 (sj3-patches-20040916.bz2) = a55b0094e5e55fd32c5f5f2cd038d9bd
-SHA256 (sj3-patches-20040916.bz2) = ee3ee636015a5b6fa2ee44eee9c10b9b35acb991b43e211880448c639ad30cd5
-SIZE (sj3-patches-20040916.bz2) = 53266
+MD5 (sj3-qq-2.0.1.21.diff.gz) = 906ecafa79ea6b9d5d0f90f6322cb0bd
+SHA256 (sj3-qq-2.0.1.21.diff.gz) = 0c362d623ce10a18fab604f1f79e498ec33fbdf9a3236066a2c0b0e4960b2d28
+SIZE (sj3-qq-2.0.1.21.diff.gz) = 102686
diff -Npru ports.orig/japanese/sj3/files/patch-sj3.tmpl ports/japanese/sj3/files/patch-sj3.tmpl
--- ports.orig/japanese/sj3/files/patch-sj3.tmpl	Thu Jan  1 09:00:00 1970
+++ ports/japanese/sj3/files/patch-sj3.tmpl	Mon Jun 11 17:57:53 2007
@@ -0,0 +1,21 @@
+--- ./sj3.tmpl.orig	Sat Jun  9 23:22:10 2007
++++ ./sj3.tmpl	Sat Jun  9 23:22:45 2007
+@@ -56,18 +56,6 @@
+ 
+ #define Sj3LibRev 1.21
+ 
+-/*
+- * Change for FreeBSD.
+- * Because When the LANG variable is EUC, setlocale function in library libc 
+- * return NULL, use it in library libxpg4 
+- * Patched by Hidekazu Kuroki(hidekazu at cs.titech.ac.jp)		1996/8/10
+- */
+-#if defined(FreeBSDArchitecture)
+-
+-CODE_LIBS	= -lxpg4
+-
+-#endif
+-
+ #if SystemV4 || SystemV
+ USETLI          = -DTLI
+ #else
diff -Npru ports.orig/japanese/sj3/files/sj3.sh.in ports/japanese/sj3/files/sj3.sh.in
--- ports.orig/japanese/sj3/files/sj3.sh.in	Wed Jul  5 21:36:36 2000
+++ ports/japanese/sj3/files/sj3.sh.in	Mon Jun 11 19:52:38 2007
@@ -1,22 +1,28 @@
 #!/bin/sh
+#
+# $FreeBSD$
+#
 
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
-    echo "$0: Cannot determine the PREFIX" >&2
-    exit 1
-fi
+# PROVIDE: sj3
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: shutdown
 
-case "$1" in
-start)
-	sj3=${PREFIX}/bin/sj3serv
-	if [ -f $sj3 ]; then
-	     $sj3
-	fi
-	;;
-stop)
-	;;
-*)
-	echo "Usage: `basename $0` {start|stop}" >&2
-	;;
-esac
+# Define these sj3_* variables in one of these files:
+#	/etc/rc.conf
+#	/etc/rc.conf.local
+#	/etc/rc.conf.d/sj3
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+sj3_enable=${sj3_enable:-"NO"}		# Enable sj3
+#sj3_program="%%PREFIX%%/sbin/sj3serv"	# Location of sj3
 
-exit 0
+. %%RC_SUBR%%
+
+name="sj3"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/sbin/sj3serv"
+
+load_rc_config $name
+run_rc_command "$1"
diff -Npru ports.orig/japanese/sj3/pkg-install ports/japanese/sj3/pkg-install
--- ports.orig/japanese/sj3/pkg-install	Sun Apr 11 02:26:40 2004
+++ ports/japanese/sj3/pkg-install	Mon Jun 11 18:09:15 2007
@@ -1,9 +1,36 @@
 #!/bin/sh
 
+PATH=/bin:/usr/sbin
+
 case $2 in
     POST-INSTALL)
-	dic="${PKG_PREFIX}/lib/sj3/dict/user"
-	mkdir -p $dic
-	chown bin:bin $dic
+	USER=_sj3
+	GROUP=${USER}
+	UID=****_CHANGE_ME_****
+	GID=${UID}
+
+	if pw group show "${GROUP}" 2>/dev/null; then
+		echo "You already have a group \"${GROUP}\", so I will use it."
+	else
+		if pw groupadd ${GROUP} -g ${GID}; then
+			echo "Added group \"${GROUP}\"."
+		else
+			echo "Adding group \"${GROUP}\" failed..."
+			exit 1
+		fi
+	fi
+
+	if pw user show "${USER}" 2>/dev/null; then
+		echo "You already have a user \"${USER}\", so I will use it."
+	else
+		if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
+			-d /nonexistent -s /sbin/nologin -c "SJ3 Daemon"
+		then
+			echo "Added user \"${USER}\"."
+		else
+			echo "Adding user \"${USER}\" failed..."
+			exit 1
+		fi
+	fi
 	;;
 esac
diff -Npru ports.orig/japanese/sj3/pkg-plist ports/japanese/sj3/pkg-plist
--- ports.orig/japanese/sj3/pkg-plist	Fri Oct  9 15:10:47 1998
+++ ports/japanese/sj3/pkg-plist	Mon Jun 11 17:10:16 2007
@@ -1,24 +1,21 @@
 bin/sj3
 bin/sj3dic
 bin/sj3mkdic
-bin/sj3serv
 bin/sj3stat
+etc/sj3/cvtkey.news
+etc/sj3/cvtkey.nwp511
+etc/sj3/cvtkey.nwp517
+etc/sj3/cvtkey.xterm
+etc/sj3/serverrc
+etc/sj3/sjrc
+etc/sj3/sjrk
 include/sj3lib.h
 lib/libsj3lib.a
-lib/sj3/Nihongo.ps.Z
-lib/sj3/cvtkey.news
-lib/sj3/cvtkey.nwp511
-lib/sj3/cvtkey.nwp517
-lib/sj3/cvtkey.xterm
+lib/libsj3lib.so
+lib/libsj3lib.so.1
 lib/sj3/dict/sj3main.dic
-lib/sj3/hinsi.ms
-lib/sj3/makedict.ms
-lib/sj3/serverrc
-lib/sj3/sj3lib.ms
-lib/sj3/sj3serv.ms
-lib/sj3/sjrc
-lib/sj3/sjrk
-etc/rc.d/sj3.sh
+sbin/sj3serv
 @dirrm lib/sj3/dict/user
 @dirrm lib/sj3/dict
 @dirrm lib/sj3
+ at dirrm etc/sj3
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list