[Fedora-packaging] installation of info files

Enrico Scholz enrico.scholz at informatik.tu-chemnitz.de
Thu Jul 13 19:28:26 UTC 2006


ville.skytta at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 480 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-packaging/attachments/20060713/06d21578/attachment.sig>


More information about the Fedora-packaging mailing list