Newbie question about CLI apps

Discussion in 'Mac Apps and Mac App Store' started by DesertFox, Sep 2, 2007.

  1. DesertFox macrumors member

    Joined:
    Nov 25, 2004
    #1
    Hello,

    Could someone please explain where Command Line (CLI) apps are saved on the system. I have installed several apps by running "./configure" and then "make" and "make install". Where is the app moved to after these commands are run? Also, some apps only work in the folder where I did "./configure" and then "make" and "make install" and use it in there. How can I make it so that I can use the app from any folder in the terminal?

    Is there some sort of an organizer for CLI tools? Kinda like an Applications folder?

    Hopefully someone can clarify these points.

    What the proper way to uninstall CLI apps?
     
  2. Nugget macrumors 65816

    Nugget

    Joined:
    Nov 24, 2002
    Location:
    Houston Texas USA
    #2
    There is no real standard for command line unix apps. When you do the "make install" part it will indicate what files it's installing and where they've went. Well-behaved apps will have installed themselves to directories somewhere inside /usr/local/ (like /usr/local/bin/ for the binaries). In most cases this means several locations.

    Potentially an app can install to four or five directories, for each of its various file types. The man page text will go into /usr/local/man/ and the binaries will go into /usr/local/bin/ and libraries into /usr/local/lib/ and so on.

    If it's a simple app it may just be a single file, but complex applications can be hundreds of files spread out across many locations.

    There's rarely a clean way to remove the applications once they're installed. If you know all the various files it's safe to just delete them, but it's the rare app that has any sort of un-install script.

    Applications installed via darwin ports or fink or an equivalent package management system are much more likely to have a clean uninstall process, which is an argument in favor of using a more formalized system like that.
     
  3. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #3
    When you use the ./configure command it often has the option of specifying where the utility is installed. As has been posted above most default to a subdirectory of /usr/local though.

    Which options did you specify when you used the ./configure command? What did you actually compile?

    There is no defined way to uninstall a command line application. The only way is to manually delete all the files that it created. This can be dangerous if you do not know exactly what files it did install as it is very easy to make a mistake.
     
  4. DesertFox thread starter macrumors member

    Joined:
    Nov 25, 2004
    #4
    I didnt specify any options. I compiled RubyGems. If I was to use something like MacPorts or Fink, would I see a performance drop? Im on a G4 PowerBook and these things get hot even on a small load.

    Thanks for the replies guys.
     
  5. Nugget macrumors 65816

    Nugget

    Joined:
    Nov 24, 2002
    Location:
    Houston Texas USA
    #5
    No, there's no performance impact from using fink or darwinports. Those frameworks do basically three things:

    1. Maintain an infrastructure that keeps track of dependancies, so that it will be smart enough to install other libraries and applications that are required. (e.g. you need to install libfrobble first because the gnufrotzbotz application you want requires it)

    2. Keep track of what files are installed for an application so that it can be more easily removed or upgraded later.

    3. Adjust the configure/build options where necessary in order to work as well as possible in OS X.

    Under the covers, they're not doing anything different than the "./configure && make install" you did by hand.
     
  6. DesertFox thread starter macrumors member

    Joined:
    Nov 25, 2004
    #6
    I want to get MacPorts on my system, but Im confused about installation part 3 where they talk about setting up the shell environment:
    http://trac.macosforge.org/projects/macports/wiki/InstallingMacPorts

    They say to make the .profile file look like this:
    Code:
    export PATH=/opt/local/bin:/opt/local/sbin:$PATH
    export DISPLAY=:0.0
    
    My .profile looks like this:
    Code:
    ##
    # DELUXE-USR-LOCAL-BIN-INSERT
    # (do not remove this comment)
    ##
    echo $PATH | grep -q -s "/usr/local/bin"
    if [ $? -eq 1 ] ; then
        PATH=$PATH:/usr/local/bin
        export PATH
    fi
    
    And my .bash_login looks like this:
    Code:
    export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
    
    They also say to merge .profile and .bash_login if both exist.
    So, here is my situation:
    I have ruby, rails, svn installed as my development environment and I would like to keep using the setup i have at the moment. But I would like MacPorts to handle stuff that I directly install using MacPorts.
    Also, can I delete the stuff in my .profile file and replace it with what the MacPorts wiki says? Will my rails setup still work after that? Can I completely remove .bash_login? What do you guys recommend?
     
  7. Nugget macrumors 65816

    Nugget

    Joined:
    Nov 24, 2002
    Location:
    Houston Texas USA
    #7
    In order to make sure that your ruby stuff continues to work you'll want to combine the two different PATH variables. I'd recommend removing the .bash_login and then setting .profile to this:

    Code:
    export PATH=/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:$PATH
    export DISPLAY=:0.0
    
    That gets you both the /opt/local/ stuff that MacPorts wants as well as the /usr/local/ stuff that rails appears to want.

    You can safely ignore the echo and the if/fi block and all that from the current .profile. Just stuff it all in the PATH as shown above and you'll be all set.

    You'll need to exit terminal and open a new window for the changes to take effect.
     
  8. DesertFox thread starter macrumors member

    Joined:
    Nov 25, 2004
    #8
    Thanks Nugget!
    This code worked. Im now using MacPorts and finding many goodies :D :D
    btw is there an online catalog of all macports?
     

Share This Page