Packages containing .info-files usually have to perform installation in %post section and uninstallation in %preun section. Using macros can significantly simplify this procedure, reducing it to smth like that: %post devel %install_info %name.info %preun devel %uninstall_info %name.info Yes I've seen mandrake's macros doing this job, but I'd suggest more universal and more easy to use ones. Here is a patch to rpm-current (two lines have been broken into 2 pieces each by the browser, but all the rest is right): Index: configure.in =================================================================== RCS file: /cvs/devel/rpm/configure.in,v retrieving revision 1.227 diff -u -r1.227 configure.in --- configure.in 2000/11/02 17:57:26 1.227 +++ configure.in 2000/11/13 00:31:49 @@ -181,6 +181,7 @@ AC_SUBST(__ID_U) AC_PATH_PROG(__INSTALL, install, /usr/bin/install, $MYPATH) + AC_PATH_PROG(__INSTALL_INFO, install-info, /sbin/install-info, $MYPATH) AC_PATH_PROG(__MAKE, make, /usr/bin/make, $MYPATH) AC_PATH_PROG(__MKDIR, mkdir, /bin/mkdir, $MYPATH) AC_PATH_PROG(__MV, mv, /bin/mv, $MYPATH) Index: macros.in =================================================================== RCS file: /cvs/devel/rpm/macros.in,v retrieving revision 1.69 diff -u -r1.69 macros.in --- macros.in 2000/11/02 17:57:26 1.69 +++ macros.in 2000/11/13 00:31:51 @@ -42,6 +42,7 @@ %__gzip %{_gzipbin} %__id @__ID@ %__install @__INSTALL@ +%__install_info @__INSTALL_INFO@ %__ln_s @LN_S@ %__make @__MAKE@ %__mkdir @__MKDIR@ @@ -650,3 +651,32 @@ # %files -f %{name}.lang # %find_lang @RPMCONFIGDIR@/find-lang.sh %{buildroot} + +#------------------------------------------------------------------------ +# Use these macros to install and uninstall info files. +# +# For example: +# +# %post devel +# %install_info %name.info +# +# %preun devel +# %uninstall_info %name.info + +%install_info() \ +for f in %*; do \ + if [ "$f" = "${f%/*}" ]; then \ + f="%{_infodir}/$f" \ + fi \ + %{__install_info} --dir-file="${f%/*}/dir" --info-file="$f" \ +done + +%uninstall_info() \ +if [ $1 = 0 ]; then \ + for f in %*; do \ + if [ "$f" = "${f%/*}" ]; then \ + f="%{_infodir}/$f" \ + fi \ + %{__install_info} --delete --dir-file="${f%/*}/dir" --info-file="$f" \ + done \ +fi
The problem is not all info-files have DIR-ENTRY/DIR-SECTION tags so you must enter them manually at the /sbin/install-info call. I prefer a macro definition like %__install_info /sbin/install-info --info-dir=%{_infodir} So you can use %{__install_info} %{_infodir}/my_info.info --entry=foo --section=bar But there are existing other problems related with install-info still: - `PreReq: /sbin/install-info' and the `if [ "$0" = 0 ] ... fi' clause in the %preun stage must be entered manually - when using /usr/share in %netsharedpath install-info tries to modify the dir-file
Well, it is Right Thing (tm), or, better say, subject for Build Policy, to build packages with all-sufficient texinfo documentation, with necessary dircategory and direntry records fixed/added in .texi-files Example from real life: --- util-linux-2.10q-orig/sys-utils/ipc.texi Fri Jul 9 06:56:41 1999 +++ util-linux-2.10q/sys-utils/ipc.texi Tue Nov 14 22:32:48 2000 @@ -2,6 +2,10 @@ @comment %**start of header (This is for running Texinfo on a region.) @setfilename ipc.info @settitle Inter Process Communication. +@dircategory Development/C +@direntry +* IPC: (ipc). System V style Inter Process Communication primitives. +@end direntry @setchapternewpage odd @comment %**end of header (This is for running Texinfo on a region.) About 'if..fi' clause in %preun: It's already added in %uninstall_info. About netshared /usr/share: Whether rpm should care about it, or maybe /sbin/install-info, or even both? If netshared path stored in standart variable, simple check could be added to %(un)install_info macros to skip netshared files and/or skip index rebuilding (if /sbin/install-info will support that).
Changing component.
Closing bugs on older, no longer supported, releases. Apologies for any lack of response. For RPM issues, please try a current release such as Fedora Core 4; if bugs persist, please open a new issue.