Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Apr 1997 00:52:27 -0700 (PDT)
From:      asami@vader.cs.berkeley.edu (Satoshi Asami)
To:        jmacd@freebsd.org, committers@freebsd.org
Cc:        ports@freebsd.org, ports-jp@jp.freebsd.org
Subject:   ports and new info system
Message-ID:  <199704150752.AAA26724@silvia.HIP.Berkeley.EDU>

next in thread | raw e-mail | index | archive | help
(Josh: It seems that "install-info --delete" doesn't delete all entries
 if multiple entries are supplied in @direntry.  Can you please take a
 look?)

The new texinfo in RELENG_2_2 seems to be working, so we can start
converting ports to use the new system.  (I will make an "RELENG_2_2
upgrade kit" for 2.2.1R users -- other than bsd.port.mk and
/usr/bin/*info, what else do we need?).

This is what you (as a porter) need to know:

===
## install-info --help
install-info [OPTION]... [INFO-FILE [DIR-FILE]]
  Install INFO-FILE in the Info directory file DIR-FILE.

Options:
--delete          Delete existing entries in INFO-FILE;
                    don't insert any new entries.
 :
===

Note that this program will NOT actually install info files; it merely 
inserts or deletes entries in the dir file.

Here's my five-step procedure to convert ports to use install-info.  I 
will use editors/emacs for an example.

(1) Look at the texinfo sources and make a patch to insert appropriate
    entries.  This is a patch for editors/emacs:

=======
--- ./man/emacs.texi.org	Mon Aug 19 21:15:12 1996
+++ ./man/emacs.texi	Mon Apr 14 23:08:20 1997
@@ -49,6 +49,24 @@
 @settitle GNU Emacs Manual
 @setfilename ../info/emacs
 @synindex pg cp
+@dircategory The Emacs editor and associated tools
+@direntry
+* Emacs: (emacs).	The extensible self-documenting text editor.
+* VIP: (vip).		A VI-emulation for Emacs.
+* VIPER: (viper).       The new VI-emulation mode in Emacs-19.29.
+* Forms: (forms).	Emacs package for editing data bases
+			  by filling in forms.
+* GNUS: (gnus).		The news reader GNUS.
+* MH-E: (mh-e).		Emacs interface to the MH mail system.
+* CL: (cl).		Partial Common Lisp support for Emacs Lisp.
+* SC: (sc).		Supercite lets you cite parts of messages you're 
+			  replying to, in flexible ways.
+* Dired-X: (dired-x).   Dired Extra Features.
+* Ediff: (ediff).	A comprehensive visual interface to diff & patch.
+* CC mode: (ccmode).	The GNU Emacs mode for editing C, C++, Objective-C
+			  and Java code.
+@end direntry
+
 @c
 @c in general, keep the following line commented out, unless doing a
 @c copy of this manual that will be published.  the manual should go
=======

    The format should be self-explanatory.  There is usually a "dir"
    file lying around in the source tree that contains all the entries 
    you need, so look before you try to write your own entry.

    Also, make sure that the info files are generated from the texinfo 
    sources.

=======
--- ./Makefile.in.org	Mon Aug 19 21:12:19 1996
+++ ./Makefile.in	Tue Apr 15 00:15:28 1997
@@ -184,7 +184,7 @@
 # Subdirectories to make recursively.  `lisp' is not included
 # because the compiled lisp files are part of the distribution
 # and you cannot remake them without installing Emacs first.
-SUBDIR = lib-src src
+SUBDIR = lib-src src man
 
 # The makefiles of the directories in $SUBDIR.
 SUBDIR_MAKEFILES = lib-src/Makefile man/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile
--- ./man/Makefile.in.org	Thu Jun 27 15:27:19 1996
+++ ./man/Makefile.in	Tue Apr 15 00:29:52 1997
@@ -66,6 +66,7 @@
 	${srcdir}/gnu1.texi \
 	${srcdir}/glossary.texi
 
+all: info
 info: $(INFO_TARGETS)
 
 dvi: $(DVI_TARGETS)
=======

    I needed the second hunk to make sure "make all" called from the
    parent Makefile works in man/Makefile.

    Note that you can give the info dir entries to install-info as
    arguments instead of patching the texinfo sources.  I do not think
    it is a good idea for ports because you need to duplicate the same
    information in several places (probably Makefile and @exec/@unexec
    of PLIST -- see below).

(2) Find the place in the source (Makefile) that it is installing the
    dir file and delete it.

=======
--- ./Makefile.in.org	Mon Aug 19 21:12:19 1996
+++ ./Makefile.in	Mon Apr 14 23:38:07 1997
@@ -368,14 +368,8 @@
 	if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \
 	then \
 	  (cd ${infodir};  \
-	   if [ -f dir ]; then \
-	     if [ ! -f dir.old ]; then mv -f dir dir.old; \
-	     else mv -f dir dir.bak; fi; \
-	   fi; \
 	   cd ${srcdir}/info ; \
-	   (cd $${thisdir}; ${INSTALL_DATA} ${srcdir}/info/dir ${infodir}/dir); \
-	   (cd $${thisdir}; chmod a+r ${infodir}/dir); \
 	   for f in ccmode* cl* dired-x* ediff* emacs* forms* gnus* info* message* mh-e* sc* vip*; do \
 	     (cd $${thisdir}; \
 	      ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \
 	      chmod a+r ${infodir}/$$f); \
@@ -426,7 +424,7 @@
 	    esac ;					\
 	  fi ;						\
 	done
=======

(3) Take a look at pkg/PLIST and delete anything that is trying to
    patch up info/dir.  They may be in pkg/INSTALL or some other file, 
    so search extensively.

=======
Index: pkg/PLIST
===================================================================
RCS file: /usr/cvs/ports/editors/emacs/pkg/PLIST,v
retrieving revision 1.15
diff -u -r1.15 PLIST
--- PLIST	1997/03/04 08:04:00	1.15
+++ PLIST	1997/04/15 06:32:12
@@ -15,9 +15,6 @@
 man/man1/emacs.1.gz
 man/man1/etags.1.gz
 man/man1/ctags.1.gz
-@unexec cp %D/info/dir %D/info/dir.bak
-info/dir
-@unexec cp %D/info/dir.bak %D/info/dir
 info/cl
 info/cl-1
 info/cl-2
======


(4) Add a post-install target to the Makefile to create a dir file if
    it is not there.  Also, call install-info with the installed info
    file[s].  Note that I lumped all the info dir entries into the
    info file "emacs" so I only need to call it with that one.

=======
Index: Makefile
===================================================================
RCS file: /usr/cvs/ports/editors/emacs/Makefile,v
retrieving revision 1.26
diff -u -r1.26 Makefile
--- Makefile	1996/11/19 13:14:40	1.26
+++ Makefile	1997/04/15 06:55:06
@@ -21,5 +21,9 @@
 	for file in emacs-19.34 emacsclient etags ctags b2m; do \
 	  strip ${PREFIX}/bin/$$file; \
 	done
+	if [ ! -f ${PREFIX}/info/dir ]; then \
+	  sed -ne '1,/Menu:/p' /usr/share/info/dir > ${PREFIX}/info/dir; \
+	fi
+	install-info ${PREFIX}/info/emacs ${PREFIX}/info/dir
 
 .include <bsd.port.mk>
=======

    Do not use anything other than /usr/share/info/dir and the above
    command to create a new info file.  In fact, I'd add the first
    three lines of the above patch to bsd.port.mk if you (the porter)
    wouldn't have to do it in pkg/PLIST by yourself anyway.

(5) Edit pkg/PLIST and add equivalent @exec statements and also
    @unexec for pkg_delete.  You do not need to delete info/dir with
    @unexec.

=======
Index: pkg/PLIST
===================================================================
RCS file: /usr/cvs/ports/editors/emacs/pkg/PLIST,v
retrieving revision 1.15
diff -u -r1.15 PLIST
--- PLIST	1997/03/04 08:04:00	1.15
+++ PLIST	1997/04/15 07:48:13
@@ -15,9 +15,6 @@
 man/man1/emacs.1.gz
 man/man1/etags.1.gz
 man/man1/ctags.1.gz
-@unexec cp %D/info/dir %D/info/dir.bak
-info/dir
-@unexec cp %D/info/dir.bak %D/info/dir
 info/cl
 info/cl-1
 info/cl-2
@@ -29,6 +26,7 @@
 info/ediff
 info/ediff-1
 info/ediff-2
+@unexec install-info --delete %D/info/emacs %D/info/dir
 info/emacs
 info/emacs-1
 info/emacs-10
@@ -87,6 +85,8 @@
 info/viper-2
 info/viper-3
 info/viper-4
+@exec [ -f %D/info/dir ] || sed -ne '1,/Menu:/p' /usr/share/info/dir > %D/info/dir
+@exec install-info %D/info/emacs %D/info/dir
 libexec/emacs/19.34/i386--freebsd/cvtmail
 libexec/emacs/19.34/i386--freebsd/digest-doc
 libexec/emacs/19.34/i386--freebsd/emacsserver
=======

    Note that the "@unexec install-info --delete" command has to be
    before the deletion of the actual info file, so it can get 

Comments welcome.  If we all agree on this, we can go in and convert
the ports.  (But don't touch any of the emacs/mule ports -- as you can
see, I already have most of the work done.)

Satoshi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704150752.AAA26724>