Skip to content

[MacOS] Installing man pages install: illegal option -- D #1439

@eliocapelati

Description

@eliocapelati

Following the installation of man pages on MacOS isn't working.

The error

➜  man git:(main) ✗ sudo make install
install -Dm644 rio.1 /usr/local/share/man/man1/rio.1
install: illegal option -- D
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 file2
       install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 ... fileN directory
       install -d [-v] [-g group] [-m mode] [-o owner] directory ...
make: *** [install] Error 64

Troubleshooting

This is happening because the shipped install version doesn't comes with the -D flag on it.

➜  man git:(main) ✗ install
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 file2
       install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 ... fileN directory
       install -d [-v] [-g group] [-m mode] [-o owner] directory ...

Ultimately the -D options is to insure that parent directory exists.

coreutils

With coreutils installed I can get gnu-install but it came named ginstall. But will make it not portable.

This worked for me:

install: all
     ginstall -Dm644 rio.1 $(DESTDIR)$(MANDIR)/man1/rio.1
     ginstall -Dm644 rio.5 $(DESTDIR)$(MANDIR)/man5/rio.5
     ginstall -Dm644 rio-bindings.5 $(DESTDIR)$(MANDIR)/man5/rio-bindings.5

I'm using MacOS 13.7.8 Ventura.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions