Subject: pkg/13340: devel/id-utils combo patch (PKGLOCALEDIR, buildlink and emacs issue)
To: None <gnats-bugs@gnats.netbsd.org>
From: Stoned Elipot <Stoned.Elipot@script.jussieu.fr>
List: netbsd-bugs
Date: 06/29/2001 13:47:49
>Number:         13340
>Category:       pkg
>Synopsis:       fixes for devel/id-utils regarding PKGLOCALEDIR, buildlink and emacs issue
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 29 04:46:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Stoned Elipot
>Release:        pkgsrc-current
>Organization:
SCRIPT, Paris VII University, France
>Environment:
System: SunOS tzolkin 5.8 Generic_108528-06 sun4u sparc SUNW,Ultra-5_10
System: NetBSD bandsept 1.5 NetBSD 1.5 (BANDSEPT) #0: Mon Dec 18 14:43:36 CET 2000     seb@bandsept:/site/a/src/sys-nbsd15/arch/sparc/compile/BANDSEPT sparc

>Description:
Patches and new patches/patch-* files are provided to resolv the following 
quirks:
1) devel/id-utils's PLIST use 'share/locale' instead of ${PKGLOCALEDIR} this
cause trouble for Zoularis.
2) support for emacs gets installed in source ands byte-compiled version
if emacs is found by configure. This cause trouble with the PLIST as these
files are not mentionned. => support user selectable make variable
USE_EMACS or USE_XEMACS to activate/deactivate elisp file byte-compilation.
3) use devel/gettext-lib/buildlink.mk, USE_BUILDLINK_ONLY and 
BUILD_USES_GETTEXT_M4 (redondant?) 
>How-To-Repeat:
1) Try to build on Zoularis and check the PLIST.
2) Try to build and install the pkg with emacs or xemacs installed
3) This has to be since buildlink scheme is among us, right ?
>Fix:

New file: patches/patch-ae
========
$NetBSD$

--- lisp/Makefile.am.orig	Sun Jun  2 07:15:31 1996
+++ lisp/Makefile.am
@@ -1,10 +1,3 @@
 ## Process this file with automake to create Makefile.in
 
-EXTRA_DIST = id-utils.el elisp-comp
-elc_SCRIPTS = id-utils.elc
-elcdir = @LISPDIR@
-SUFFIXES = .el .elc
-
-.el.elc:
-	@echo "WARNING: Warnings can be ignored. :-)"
-	$(SHELL) $(srcdir)/elisp-comp $<
+lisp_LISP = id-utils.el
New file: patches/patch-af
========
$NetBSD$

--- libidu/Makefile.am.orig	Sun Jul  7 18:36:06 1996
+++ libidu/Makefile.am
@@ -2,9 +2,9 @@
 
 AUTOMAKE_OPTIONS = ansi2knr
 
-noinst_LIBRARIES = idu
+noinst_LIBRARIES = libidu.a
 
-idu_SOURCES = dynvec.c hash.c idfile.c idread.c idwrite.c fnprint.c \
+libidu_a_SOURCES = dynvec.c hash.c idfile.c idread.c idwrite.c fnprint.c \
 	scanners.c walker.c
 
 idudir = $(prefix)/share
New file: patches/patch-ag
========
$NetBSD$

--- lib/Makefile.am.orig	Tue Jul  9 06:22:34 1996
+++ lib/Makefile.am
@@ -1,13 +1,13 @@
 ## Process this file with automake to create Makefile.in
 
-noinst_LIBRARIES = sys
+noinst_LIBRARIES = libsys.a
 
 EXTRA_DIST = alloca.c basename.c dirname.c error.c fnmatch.c getopt.c \
 	getopt1.c memcpy.c memset.c obstack.c regex.c rx.c \
 	strcasecmp.c strcspn.c strdup.c strndup.c strpbrk.c strspn.c \
 	strstr.c strtok.c
 
-sys_SOURCES = xgetcwd.c xmalloc.c
+libsys_a_SOURCES = xgetcwd.c xmalloc.c
 
 noinst_HEADERS = ansidecl.h error.h fnmatch.h getopt.h obstack.h \
 	pathmax.h regex.h rx.h xalloca.h xdirent.h xfnmatch.h \
@@ -19,4 +19,4 @@
 	   -I../intl -I$(top_srcdir)/intl \
 	   -I.. -I$(top_srcdir) 
 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
-sys_LIBADD = @REGEXOBJ@ @LIBOBJS@ @ALLOCA@
+libsys_a_LIBADD = @LIBOBJS@ @ALLOCA@
New file: patches/patch-ah
======== 
$NetBSD$

--- configure.in.orig	Wed Aug  7 05:16:19 1996
+++ configure.in
@@ -10,7 +10,7 @@
 ##############################################################################
 
 AC_INIT(src/mkid.c)
-AC_CONFIG_HEADER(config.h)
+AM_CONFIG_HEADER(config.h)
 AC_PREREQ(2.10)
 AC_ARG_PROGRAM
 
@@ -50,7 +50,7 @@
 
 AC_PROG_CC
 AC_PROG_LN_S
-AM_PROG_INSTALL
+AC_PROG_INSTALL
 AC_PROG_MAKE_SET
 AC_PROG_CPP
 AC_PROG_GCC_TRADITIONAL
@@ -81,12 +81,12 @@
 ################ Check for typedefs, structs, and compiler params ############
 ##############################################################################
 
-AC_C_CONST
 AM_C_PROTOTYPES
+AC_C_CONST
 AC_TYPE_SIGNAL
 AC_TYPE_OFF_T
 AC_TYPE_SIZE_T
-md_TYPE_PTRDIFF_T
+AM_TYPE_PTRDIFF_T
 
 ##############################################################################
 ################ Set default compilation flags ###############################
@@ -102,20 +102,20 @@
 ##############################################################################
 
 AC_FUNC_ALLOCA
-ud_WITH_REGEX
+AM_WITH_REGEX
 AC_FUNC_VPRINTF
 AC_CHECK_FUNCS(getwd getcwd link strerror isascii bcopy bzero memcpy)
 AC_REPLACE_FUNCS(strdup strndup strspn strcspn strpbrk strstr strtok)
 AC_REPLACE_FUNCS(basename dirname fnmatch error memcpy memset)
-AC_REPLACE_GNU_GETOPT
-AC_REPLACE_OBSTACK
+AC_CHECK_FUNC(getopt_long, , [LIBOBJS="$LIBOBJS getopt1.o getopt.o"])
+AC_SUBST(LIBOBJS)
+AM_FUNC_OBSTACK
 
 ##############################################################################
 ################ Internationalization ########################################
 ##############################################################################
 
-ud_GNU_GETTEXT
-AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
+AM_GNU_GETTEXT
 
 ##############################################################################
 ################ Find a home for language map ################################
@@ -134,7 +134,7 @@
 ################ Find a home for Emacs Lisp code #############################
 ##############################################################################
 
-ud_PATH_LISPDIR
+AM_PATH_LISPDIR
 
 ##############################################################################
 ################ Generate the configure script ###############################
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/devel/id-utils/Makefile,v
retrieving revision 1.15
diff -u -r1.15 Makefile
--- Makefile	2001/05/17 08:38:43	1.15
+++ Makefile	2001/06/29 11:42:18
@@ -10,11 +10,51 @@
 HOMEPAGE=	http://www.gnu.org/software/idutils/idutils.html
 COMMENT=	Classic Berkeley gid/lid tools for looking up variables in code
 
+BUILD_DEPENDS+=		automake>=1.4:../../devel/automake
+
 BUILD_USES_MSGFMT=	yes
+BUILD_USES_GETTEXT_M4=	yes
+USE_BUILDLINK_ONLY=	yes
 
 INFO_FILES=	id-utils.info
 GNU_CONFIGURE=	yes
 USE_GMAKE=	yes
-USE_LIBINTL=	yes
 
+.include "../../mk/bsd.prefs.mk"
+
+.ifdef USE_XEMACS
+EMACS=			${LOCALBASE}/bin/xemacs
+BUILD_DEPENDS+=		xemacs-*:../editors/xemacs
+CLISPDIR=		${LISPDIR}
+.elifdef USE_EMACS
+EMACS=			${LOCALBASE}/bin/emacs
+BUILD_DEPENDS+=		emacs-*:../../editors/emacs
+CLISPDIR=		${LISPDIR}
+.endif
+
+# we end-up installing .el file here whenever we use emacs or xemacs
+LISPDIR?=		share/emacs/site-lisp
+CLISPDIR?=		'@comment '
+EMACS?=			${FALSE}
+
+CONFIGURE_ENV+=		EMACS=${EMACS}
+BUILD_DEFS+=		EMACS
+
+PLIST_SUBST+=		LISPDIR=${LISPDIR}
+PLIST_SUBST+=		CLISPDIR=${CLISPDIR}
+
+post-patch:
+	cd ${WRKSRC}/lisp && rm elisp-comp
+
+# we manually missing and elisp-comp scripts in the sources
+# to get around an apparent bug (??) in automake...
+pre-configure:
+	cd ${WRKSRC} && ${LOCALBASE}/bin/aclocal && \
+	${LOCALBASE}/bin/autoheader && \
+	${INSTALL_SCRIPT} ${LOCALBASE}/share/automake/missing ./missing && \
+	${INSTALL_SCRIPT} ${LOCALBASE}/share/automake/elisp-comp ./lisp/elisp-comp && \
+	${LOCALBASE}/bin/automake --gnu && \
+	${LOCALBASE}/bin/autoconf
+
+.include "../../devel/gettext-lib/buildlink.mk"
 .include "../../mk/bsd.pkg.mk"
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/devel/id-utils/distinfo,v
retrieving revision 1.2
diff -u -r1.2 distinfo
--- distinfo	2001/04/21 00:44:23	1.2
+++ distinfo	2001/06/29 11:42:18
@@ -6,3 +6,7 @@
 SHA1 (patch-ab) = bb079b1a82c500fcb93d45bdf0fbb14a3729c0cb
 SHA1 (patch-ac) = f1f941b47e918dafc87b9b47f56e7026899eb229
 SHA1 (patch-ad) = cd13aea19f0ac5dcdc8695ce40b409ecb15b1ec0
+SHA1 (patch-ae) = 58fa58e328fd658ee9c4d1dc88e9a23da8ddea8e
+SHA1 (patch-af) = 5bd90d47e2991667b96e29a5883a8aa809eb33a7
+SHA1 (patch-ag) = 85312aeb8c39f653205d51e881d4533a542657ec
+SHA1 (patch-ah) = 0b18b576be854935cb79cc3eb85848447ac17909
Index: pkg/PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/devel/id-utils/pkg/PLIST,v
retrieving revision 1.6
diff -u -r1.6 PLIST
--- PLIST	1999/02/11 19:17:30	1.6
+++ PLIST	2001/06/29 11:42:18
@@ -12,5 +12,7 @@
 info/id-utils.info
 @exec install-info %D/info/id-utils.info %D/info/dir
 share/id-lang.map
-share/locale/de/LC_MESSAGES/id-utils.mo
-share/locale/fr/LC_MESSAGES/id-utils.mo
+${PKGLOCALEDIR}/locale/de/LC_MESSAGES/id-utils.mo
+${PKGLOCALEDIR}/locale/fr/LC_MESSAGES/id-utils.mo
+${CLISPDIR}/id-utils.elc
+${LISPDIR}/id-utils.el
>Release-Note:
>Audit-Trail:
>Unformatted: