Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Nov 2000 16:46:20 +0200
From:      Maxim Sobolev <sobomax@FreeBSD.org>
To:        ports@FreeBSD.org, asami@FreeBSD.org
Subject:   GNU Texinfo pages handling patch, revised
Message-ID:  <3A23C53C.67C84A71@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------239CF5AD19B6422BF091997A
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 7bit

Hi -ports & PW,

Some time ago I submitted a patch for bsd.port.mk to automate handling of info
pages and was told that it should be extended to allow specify number of pieces
page being split onto (i.e. bar.info, bar.info-1, bar.info-2 etc.). I extended
my patch to handle this and attaching it with this message. Also I'm attaching
diffs for two ports, which should have you an idea how it's supposed to work.

-Maxim

--------------239CF5AD19B6422BF091997A
Content-Type: text/plain; charset=koi8-r;
 name="sawfish.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="sawfish.diff"

diff -druN /usr/ports/x11-wm/sawfish/Makefile sawfish/Makefile
--- /usr/ports/x11-wm/sawfish/Makefile	Wed Nov 15 10:50:10 2000
+++ sawfish/Makefile	Tue Nov 28 16:20:07 2000
@@ -31,6 +31,8 @@
 CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \
 		LIBS="-L${LOCALBASE}/lib"
 
+INFOPAGES=	sawfish%6%"X11 window manager"%"* sawfish: (sawfish).           sawfish programming manual"
+
 .include <bsd.port.pre.mk>
 
 .if defined(HAVE_GNOME)
@@ -56,10 +58,5 @@
 	@find ${WRKSRC} \( -name "*.jl" -or -name "*.jl.in" \) | \
 		xargs ${GREP} -l "../locale" | \
 		xargs ${PERL} -pi -e "s|\.\./locale|../../../locale|g"
-
-post-install:
-	install-info --section="X11 window manager" \
-	--entry="* sawfish: (sawfish).           sawfish programming manual" \
-	${PREFIX}/info/sawfish.info ${PREFIX}/info/dir
 
 .include <bsd.port.post.mk>
diff -druN /usr/ports/x11-wm/sawfish/pkg-plist sawfish/pkg-plist
--- /usr/ports/x11-wm/sawfish/pkg-plist	Thu Nov  9 17:54:17 2000
+++ sawfish/pkg-plist	Tue Nov 28 16:20:21 2000
@@ -3,14 +3,6 @@
 bin/sawfish-client
 %%GNOME:%%bin/sawfish-themer
 bin/sawfish-ui
-@unexec install-info --delete %D/info/sawfish.info %D/info/dir
-info/sawfish.info
-info/sawfish.info-1
-info/sawfish.info-2
-info/sawfish.info-3
-info/sawfish.info-4
-info/sawfish.info-5
-@exec install-info --section="X11 window manager" --entry="* sawfish: (sawfish).           sawfish programming manual" %D/info/sawfish.info %D/info/dir
 libexec/rep/%%GNUHOST%%/sawfish/client.so
 libexec/rep/%%GNUHOST%%/sawfish/client.la
 libexec/sawfish/%%VERSION%%/%%GNUHOST%%/DOC

--------------239CF5AD19B6422BF091997A
Content-Type: text/plain; charset=koi8-r;
 name="wget.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="wget.diff"

diff -druN /usr/ports/ftp/wget/Makefile wget/Makefile
--- /usr/ports/ftp/wget/Makefile	Mon Jul  3 09:44:24 2000
+++ wget/Makefile	Tue Nov 28 16:14:53 2000
@@ -24,10 +24,9 @@
 CONFIGURE_ENV+=	CPPFLAGS=-I${PREFIX}/include \
 		LDFLAGS=-L${PREFIX}/lib
 
+INFOPAGES=	wget
+
 pre-build:
 	${RM} -rf ${WRKSRC}/doc/wget.info*
-
-post-install:
-	install-info ${PREFIX}/info/wget.info ${PREFIX}/info/dir
 
 .include <bsd.port.mk>
diff -druN /usr/ports/ftp/wget/pkg-plist wget/pkg-plist
--- /usr/ports/ftp/wget/pkg-plist	Wed Nov 22 11:22:11 2000
+++ wget/pkg-plist	Tue Nov 28 16:14:37 2000
@@ -1,9 +1,6 @@
 @comment $FreeBSD: ports/ftp/wget/pkg-plist,v 1.8 2000/11/22 02:22:48 obrien Exp $
 bin/wget
 etc/wgetrc
-@unexec install-info --delete %D/info/wget.info %D/info/dir
-info/wget.info
-@exec install-info %D/info/wget.info %D/info/dir
 share/locale/cs/LC_MESSAGES/wget.mo
 share/locale/de/LC_MESSAGES/wget.mo
 share/locale/hr/LC_MESSAGES/wget.mo

--------------239CF5AD19B6422BF091997A
Content-Type: text/plain; charset=koi8-r;
 name="bsd.port.mk-infopages.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="bsd.port.mk-infopages.diff"

--- bsd.port.mk	2000/11/28 14:12:44	1.1
+++ bsd.port.mk	2000/11/28 14:27:40
@@ -286,6 +286,21 @@
 #				  NOMANCOMPRESS.  The default is "yes" if USE_IMAKE
 #				  is set and NO_INSTALL_MANPAGES is not set, and
 #				  "no" otherwise.
+# INFOPAGES		- A list of GNU Texinfo pages installed by the port.
+#				  The format for entries is the following:
+#				  name[%[numpages][%[section][%entry]]]. For example if
+#				  your port has "info/foo.info" and "info/bar.info", set
+#				  "INFOPAGES=foo bar". Optional numpages, section and
+#				  entry fields provided for the cases when info page is
+#				  split across several files and/or doesn't contain
+#				  information required for install-info(1) to correctly
+#				  register the page into catalog of info pages. In this
+#				  case use something like the following:
+#				  ``INFOPAGES=foo%3%"Bar utils"%"* Foo: (foo).	Foo app"''
+#				  which means that foo page is split into 3 files:
+#				  foo.info, foo.info-1 and foo.info-2, and should be
+#				  registered as "* Foo: (foo).	Foo app" in the
+#				  "Bar utils" section of GNU Texinfo catalog.
 #
 # Default targets and their behaviors:
 #
@@ -925,6 +940,7 @@
 AUTOCONF?=		autoconf
 LIBTOOL?=		libtool
 XMKMF?=			xmkmf -a
+INSTALL-INFO?=	/usr/bin/install-info
 .if exists(/sbin/md5)
 MD5?=			/sbin/md5
 .elif exists(/bin/md5)
@@ -1345,6 +1361,11 @@
 .endif
 .endif
 
+INFOPREFIX?=	${PREFIX}
+INFOSUBDIR?=	info
+INFOCATALOG?=	${PREFIX}/${INFOSUBDIR}/dir
+INFO_SUFX?=		.info
+
 # Put this for down as possible so it will catch all PLIST_SUB definitions.
 
 .if defined(INSTALLS_SHLIB)
@@ -1988,6 +2009,27 @@
 .if make(real-install) && (defined(_MANPAGES) || defined(_MLINKS))
 	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} compress-man
 .endif
+.if make(real-install) && defined(INFOPAGES)
+	@${ECHO_MSG} "===>   Registering infopages"
+	@for i in ${INFOPAGES}; do \
+		INFOPAGE=`${ECHO} "$${i}" | ${AWK} --field-separator "%" '{ print $$1 }'`; \
+		INFOSECTION=`${ECHO} "$${i}" | ${AWK} --field-separator "%" '{ print $$3 }'`; \
+		INFOENTRY=`${ECHO} "$${i}" | ${AWK} --field-separator "%" '{ print $$4 }'`;\
+		_INFOPAGE=""; \
+		_INFOSECTION="--quiet"; \
+		_INFOENTRY="--quiet"; \
+		if [ x"$${INFOPAGE}" != x"" ]; then \
+			_INFOPAGE=${INFOPREFIX}/${INFOSUBDIR}/$${INFOPAGE}${INFO_SUFX}; \
+			if [ x"$${INFOSECTION}" != x"" ]; then \
+				_INFOSECTION="--section=$${INFOSECTION}"; \
+			fi; \
+			if [ x"$${INFOENTRY}" != x"" ]; then \
+				_INFOENTRY="--entry=$${INFOENTRY}"; \
+			fi; \
+			${INSTALL-INFO} "$${_INFOSECTION}" "$${_INFOENTRY}" $${_INFOPAGE} ${INFOCATALOG}; \
+		fi; \
+	done
+.endif
 .if make(real-install) && defined(INSTALLS_SHLIB)
 	@${ECHO_MSG} "===>   Running ldconfig"
 	${LDCONFIG} -m ${LDCONFIG_RUNLIST}
@@ -2841,6 +2883,37 @@
 	@for man in ${__MANPAGES}; do \
 		${ECHO} $${man} >> ${TMPPLIST}; \
 	done
+.if defined(INFOPAGES)
+	@for i in ${INFOPAGES}; do \
+		INFOPAGE=`${ECHO} "$${i}" | ${AWK} --field-separator "%" '{ print $$1 }'`; \
+		INFONUMBER=`${ECHO} "$${i}" | ${AWK} --field-separator "%" '{ print $$2 }'`; \
+		INFOSECTION=`${ECHO} "$${i}" | ${AWK} --field-separator "%" '{ print $$3 }'`; \
+		INFOENTRY=`${ECHO} "$${i}" | ${AWK} --field-separator "%" '{ print $$4 }'`;\
+		_INFOPAGE=""; \
+		_INFOSECTION=""; \
+		_INFOENTRY=""; \
+		if [ x"$${INFOPAGE}" != x"" ]; then \
+			_INFOPAGE=${INFOSUBDIR}/$${INFOPAGE}${INFO_SUFX}; \
+			_INFONUMBER=$${INFONUMBER:-1}; \
+			if [ x"$${INFOSECTION}" != x"" ]; then \
+				_INFOSECTION="--section=\"$${INFOSECTION}\""; \
+			fi; \
+			if [ x"$${INFOENTRY}" != x"" ]; then \
+				_INFOENTRY="--entry=\"$${INFOENTRY}\""; \
+			fi; \
+			(if [ $${_INFONUMBER} -gt 0 ]; then \
+			 	j=0; \
+				while [ $${j} -lt $${_INFONUMBER} ]; do \
+					_SUFFX="-$${j}"; \
+					${ECHO} "$${_INFOPAGE}$${_SUFFX%-0}"; \
+					j=$$(($${j} + 1)); \
+				done; \
+			fi; \
+			${ECHO} "@exec ${INSTALL-INFO} $${_INFOSECTION} $${_INFOENTRY} %D/$${_INFOPAGE} ${INFOCATALOG}"; \
+			${ECHO} "@unexec ${INSTALL-INFO} --delete %D/$${_INFOPAGE} ${INFOCATALOG}") >> ${TMPPLIST}; \
+		fi; \
+	done
+.endif
 .for _PREFIX in ${PREFIX}
 .if ${_TMLINKS:M${_PREFIX}*}x != x
 	@for i in ${_TMLINKS:M${_PREFIX}*:S,^${_PREFIX}/,,}; do \

--------------239CF5AD19B6422BF091997A--



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A23C53C.67C84A71>