Search code examples
linuxdebianpackagingfpm

how to create a man page using fpm?


I am using fpm to generate my debian package from a directory which contains my bash script.

The directory has only this bash script. I want to add a man page to the package so that I can view the man page using man command after installing my deb package . how to do so ?

What's the fpm option or command to include the created manpage in the package ?


Solution

  • Add usr/share/man with your man pages to the option on fpm

    In my makefile which runs fpm I have ronn which creates man.5 pages from markdown.

    @mkdir -p pkg/tmp/usr/share/man/man5
    @ronn -r README.md --pipe > pkg/tmp/usr/share/man/man5/example.5
    
    (cd pkg && \
    fpm -s dir -t deb -C tmp ---other-stuff usr/share/man)
    

    See the docs example: https://fpm.readthedocs.io/en/latest/use-cases/make-install.html#package-up-the-manpages-create-nodejs-doc