ville.skytta(a)iki.fi (Ville Skyttä) writes:
Regarding the case at hand, in case someone's thinking about
submitting
an RFE somewhere, FWIW Mandriva has had macros for installing and
removing info files for a long time, they're defined as:
%__install_info /sbin/install-info
%_extension .bz2
install-info is smart enough to add at least '.gz' when needed. Hence
the %_extension macro is not needed.
%_install_info() if [[ -f %{_infodir}/%{1}%{_extension}
]];then %{__install_info} %{_infodir}/%{1}%{_extension} --dir=%{_infodir}/dir;fi \
%{nil}
%_remove_install_info() if [ "$1" = "0" ]; then if [[ -f
%{_infodir}/%{1}%{_extension} ]];then %{__install_info} %{_infodir}/%{1}%{_extension}
--dir=%{_infodir}/dir --remove ;fi; fi \
%{nil}
I used
| %__install_info /sbin/install-info --info-dir=%_infodir
| %__install_info_post g() { %__install_info "$@" || :; }; g
| %__install_info_preun g() { %__install_info --delete "$@" || :; };
test "$1" != 0 || g
some time ago. I do not see much sense in the test-for-existence check;
when a packager uses
| %__install_info_post %_infodir/zsh.info
he knows that 'zsh.info' exists there (else, package would be broken).
I am not sure about automatic detection of pre/postun requires; perhaps
a similar approach like for fedora-usermgmt can be chosen and
| %FE_INSTALL_INFO_REQ \
| Requires(pre): %__install_info \
| Requires(postun): %__install_info
defined which is applied like
| BuildRequires: package-with-these-macros
| %{?FE_INSTALL_INFO_REQ}
Enrico