I'm writing an install script for some software that depends on libUSB being installed however I need to check if macports or fink is installed, if they are not install homebrew. How can I check to see if the macports or fink are installed in a shell script?
1 Answer
Macports will have /opt/local/lib/port as the executable that does all the work.
Fink's main executable is fink - I think it is in /sw/bin/fink but as I don't have fink installed I cannot confirm
You also need to see if there is anything in /usr/local that could conflict with home-brew.
A better alternative, as you are using a package manager, is write your installs a script in all of the package managers, rather than introduce yet another installer
The usual OSX way is to create an app with all the required shared libraries inside the app bundle so there is no need for a special install just copy the app.
-
That would be an option but the people installing the software might not be aware of how to use a package management system.– DeanApr 26, 2014 at 12:06
-
@Dean then they won;'t have Macports etc installed, if they are using command line then they know enough to use a package manager. If not command line then it does not matter– mmmmmmApr 26, 2014 at 19:55