Fixing up man pages

Paul Schmehl pauls at utdallas.edu
Sat Jul 30 20:04:02 GMT 2005


--On July 30, 2005 11:26:05 AM +0200 Roman Neuhauser <neuhauser at sigpipe.cz> 
wrote:

># pauls at utdallas.edu / 2005-07-29 19:10:59 -0500:
>> I'm working on updating the x11-toolkits/iwidgets port, and I've run
>> into a  problem.  The man pages install fine, but they aren't formatted
>> correctly.
>
>     What does "formatted correctly" mean? Can you paste the output, and
>     what you want it to look like instead?
>
>> In the Makefile for the source, there is a section that deals with the
>> man  pages like this:
>>
>> @cd $(TOP_DIR)/doc; for i in *.n; \
>>            do \
>>            rm -f $(MAN_INSTALL_DIR)/`basename $$i`; \
>>            rm -f $(MAN_INSTALL_DIR)/`basename iwidgets_$$i`; \
>>            sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
>>                $$i > $(MAN_INSTALL_DIR)/`basename iwidgets_$$i`; \
>>            chmod 444 $(MAN_INSTALL_DIR)/`basename iwidgets_$$i`; \
>>            done;
>>
>> How can I incorporate this into the port Makefile so that the man pages
>> will be properly formatted?
>
>     The only "formatting" this does is replace the first occurrence
>     of "man.macros" on any line with the contents of
>     $(TOP_DIR)/doc/man.macros. Is that's what you mean?
>
I posted a question about the sed script in questions, and once I 
understood the guy's answer (which took a while), I got it working.

Here's the working version:

@${SED} -e '/man\.macros/r ${WRKSRC}/doc/man.macros' \
               -e '/man\.macros/d' ${WRKSRC}/doc/${f} > ${WRKDIR}/${f}

What this does is parse man.macros for the string man\.macros and, if 
found, use it as input to the second part that removes the string 
man\.macros from the input stream and then feeds it to the file ${f}, which 
is the manpage in the source.  Once the macro is in the manpage, man can 
display it properly.

Now I have a "philosophical" question.  The iwidgets source creates the 
manpages with the name "iwidgets_{manpage name}" (e.g. toolbar.n becomes 
iwidgets_toolbar.n).  In the source, the manpages are named "toolbar", and 
the src Makefile changes the name to iwidgets_toolbar.

Should I  create the man pages with the same names?  Or prefix the 
iwidgets_ to them?

One final question.  Do I submit this as patches to the existing port?  Or 
just submit it as if it's a new port?  (It's completely different from the 
existing port in the way it handles the install.)

Paul Schmehl (pauls at utdallas.edu)
Adjunct Information Security Officer
University of Texas at Dallas
AVIEN Founding Member
http://www.utdallas.edu/


More information about the freebsd-ports mailing list