macOS doesn‘t automagically organize /usr/local
for you.
You can do one of the following, depending on the actual need:
- Put the binaries or scripts directly into
/usr/local/bin
, - Put the package into its own directory (under
/opt
,/usr/local/opt
or wherever you prefer), and runcd /usr/local/bin; sudo ln -s /path/to/package/bin/* .
(Finder aliases are not symlinks and can't be used here). This only works if the binaries introduced by the package have unique names, but has the advantage that you don't need to redo the symlinks if the package gets updated unless/path/to/package
includes a version number, - Add the whole package to
/opt
and the additional bin directories to/etc/paths.d/name-of-package
.
PS: Finder aliases areUnless the package name/directory includes a version number, symlinking not symlinks and can‘t(option 2) or editing /etc/paths.d/name-of-package
(option 3) need to be used heredone only once.
PPSPS: The second option is basically what Homebrew does.