Mac How to install Tag?

nelly22

macrumors 6502
Original poster
Sep 29, 2009
355
5
I would like to use Tag.

https://github.com/jdberry/tag

I don't have MacPorts or Homebrew and i would prefer not to install these.

Is there any way to install this without MacPorts or Homebrew? I have Xcode installed.

Prebuilt Packages

You may install tag using the following package managers:

MacPorts: sudo port install tag

Homebrew: brew install tag

Building and Installing:

You must have Xcode or the Command Line Tools installed to build/install.

To build without installing:

make

This will build tag into ./bin/tag

To build and install onto your system:

make && sudo make install

This will install tag at /usr/local/bin/tag
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
I have never done this type of things. I presume if i type that to Terminal app, then it just works? Thanks
From the instructions, that's how it should work yes. You would only need to be in the same directory as the makefile as far as I can tell. I haven't attempted to install this however, but if all works as expected that's what should happen.
 
Comment

nelly22

macrumors 6502
Original poster
Sep 29, 2009
355
5
From the instructions, that's how it should work yes. You would only need to be in the same directory as the makefile as far as I can tell. I haven't attempted to install this however, but if all works as expected that's what should happen.
Thanks.

I did this:

Code:
home:~ Nelly$ cd /Applications/Tag
home:Tag Nelly$ make
xcrun: error: active developer path ("/Volumes/BackUps/Applications/Xcode.app/Contents/Developer") does not exist, use `xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools (or see `man xcode-select`)
At this point i opened Xcode and found out that preferences>Locations>Command Line Tools preference was empty so i clicked it and there was Xcode 6.1.1 so i selected it.

Code:
home:Tag Nelly$ make
make: *** No targets specified and no makefile found.  Stop.
I had wrong path so i changed it below twice:

Code:
home:Tag Nelly$ cd /Applications/Tag/tag-master/Tag
home:Tag Nelly$ make
make: *** No targets specified and no makefile found.  Stop.
home:Tag Nelly$ cd /Applications/Tag/tag-master
home:tag-master Nelly$ make && sudo make install
mkdir -p bin
cc  Tag/main.m Tag/Tag.m Tag/TagName.m -framework Foundation -framework CoreServices -o bin/tag

WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.

To proceed, enter your password, or type Ctrl-C to abort.

Password:
/usr/bin/install -o root -g admin -m 0755 bin/tag /usr/local/bin
home:tag-master Nelly$
Now in /usr/local folder is "bin" which is Unix Executable File size 45 KB.

According to Time Machine this is new file. I repaired persmissions and booted but it's still there.

Tag works if i point to it this way: Applications/Tag/tag-master/bin/tag

But i wonder if this bin (Unix Executable File) is okay or did i broke something, because instructions say "This will install tag at /usr/local/bin/tag" so that sounds like bin should be folder??

If i want to put tag to correct folder which most likely is /usr/local/bin/, then how i do that?
 
Last edited by a moderator:
Comment

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
Now in /usr/local folder is "bin" which is Unix Executable File size 45 KB.

According to Time Machine this is new file. I repaired persmissions and booted but it's still there.

Tag works if i point to it this way: Applications/Tag/tag-master/bin/tag

But i wonder if this bin (Unix Executable File) is okay or did i broke something, because instructions say "This will install tag at /usr/local/bin/tag" so that sounds like bin should be folder??

If i want to put tag to correct folder which most likely is /usr/local/bin/, then how i do that?
/usr/local/bin should be a directory, are you sure it's a file? You can try: file /usr/local/bin
It should result in: /usr/local/bin: directory

If i want to put tag to correct folder which most likely is /usr/local/bin/, then how i do that?
You should be able to just move it there manually, the only thing the make file does is compile the program and move it to /usr/local/bin. Did you have a /usr/local/bin directory previously? I mean have you added it yourself at some point?
 
Last edited:
Comment

nelly22

macrumors 6502
Original poster
Sep 29, 2009
355
5
/usr/local/bin should be a directory, are you sure it's a file? You can try: file /usr/local/bin
It should result in: /usr/local/bin: directory
Result is: Mach-O 64-bit executable x86_64

Kind column in Finder: Unix Executable File
 
Comment

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
Result is: Mach-O 64-bit executable x86_64

Kind column in Finder: Unix Executable File
Right, it may be that this is tag, that got named bin. You can try:

Code:
shasum /Applications/Tag/tag-master/bin/tag
shasum /usr/local/bin
If that result in the same string, it is.
 
Comment

nelly22

macrumors 6502
Original poster
Sep 29, 2009
355
5
Right, it may be that this is tag, that got named bin. You can try:

Code:
shasum /Applications/Tag/tag-master/bin/tag
shasum /usr/local/bin
If that result in the same string, it is.
/usr/local/bin directory creation date is today and i didn't do it manually.

You are correct both SHA codes are same, so it's tag.
 
Comment

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
/usr/local/bin directory creation date is today and i didn't do it manually.

You are correct both SHA codes are same, so it's tag.
Edit: Wait. Are you saying that /usr/local/bin is a directory or not?
 
Comment

nelly22

macrumors 6502
Original poster
Sep 29, 2009
355
5
Edit: Wait. Are you saying that /usr/local/bin is a directory or not?
Both SHA codes are same. So it must be tag, but it has black square icon with green "exec" text. It is not directory

I just noticed that first i did "make" then after it "make && sudo make install". Dunno what's the difference.

Maybe that is the problem because i did "make" twice.

/bin/ folder don't have tag file.

Like below instructions say, "make" installs to ./bin/tag and "make && sudo make install" installs to /usr/local/bin/tag. I opened ./bin/tag and it don't have tag.

To build without installing:

make

This will build tag into ./bin/tag

To build and install onto your system:

make && sudo make install

This will install tag at /usr/local/bin/tag
 
Comment

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
Both SHA codes are same. So it must be tag, but it has black square icon with green "exec" text. It is not directory.
Yes, but you said in the sentence above that the bin directory did not exist before, so I just wanted to make sure.

I just noticed that first i did "make" then after it "make && sudo make install". Dunno what's the difference.

Maybe that is the problem because i did "make" twice.

/bin/ folder don't have tag file.

Like below instructions say, "make" installs to ./bin/tag and "make && sudo make install" installs to /usr/local/bin/tag. I opened ./bin/tag and it don't have tag.
Don't worry about it, all you need to do is rename /usr/local/bin to /usr/local/tag, create a bin directory and move it there. You can do this in Finder if you want, or:

Code:
mv /usr/local/bin /usr/local/tag
mkdir /usr/local/bin
mv /usr/local/tag /usr/local/bin/tag
Since you did not have a bin directory before, also try: echo $PATH.
 
Comment

nelly22

macrumors 6502
Original poster
Sep 29, 2009
355
5
Yes, but you said in the sentence above that the bin directory did not exist before, so I just wanted to make sure.



Don't worry about it, all you need to do is rename /usr/local/bin to /usr/local/tag, create a bin directory and move it there. You can do this in Finder if you want, or:

Code:
mv /usr/local/bin /usr/local/tag
mkdir /usr/local/bin
mv /usr/local/tag /usr/local/bin/tag
Since you did not have a bin directory before, also try: echo $PATH.
It works now!!

I did move tag and rename it manually in Finder.

Then typed "echo $PATH" to terminal. Result: /usr/local/bin: /usr/bin: /bin: /usr/sbin: /sbin:

Only thing which still might be wrong is permissions of /usr/local/bin/ and /usr/local/bin/tag. Currently i can read and write. Maybe these should be owned by System?
 
Comment

chown33

Moderator
Staff member
Aug 9, 2009
8,720
5,038
vertical
Here's the problem. It's this command (the result of 'make install'):
Code:
/usr/bin/install -o root -g admin -m 0755 bin/tag /usr/local/bin
If /usr/local/bin doesn't exist before this command executes, then the file (bin/tag) will be copied to a file named /usr/local/bin. The reason this happens is because this is exactly how /usr/bin/install works. Read the man page.

Since /usr/local/bin doesn't exist by default on OS X, there is no directory to copy 'tag' into. The net result is that 'install' does its file1 file2 action, not its file1 ... fileN directory action.

The best solution to this bug in the installation process is to use /usr/bin/install with the -d option to create the directory. This will also allow the use of the -u -g and -m options. It will have to be run with 'sudo' if the directory is to be owned by root.
 
Comment

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
If /usr/local/bin doesn't exist before this command executes, then the file (bin/tag) will be copied to a file named /usr/local/bin.
Well, that has already been established.

----------

Only thing which still might be wrong is permissions of /usr/local/bin/ and /usr/local/bin/tag. Currently i can read and write. Maybe these should be owned by System?
You can try: stat -x on both of these, I think "tag" should be root, admin from the install step previously. But try it and see.
 
Comment

nelly22

macrumors 6502
Original poster
Sep 29, 2009
355
5
Here's the problem. It's this command (the result of 'make install'):
Code:
/usr/bin/install -o root -g admin -m 0755 bin/tag /usr/local/bin
Thanks.

So i should run this code to fix permissions?
 
Comment

chown33

Moderator
Staff member
Aug 9, 2009
8,720
5,038
vertical
Thanks.

So i should run this code to fix permissions?
You don't understand. That's the command you already executed. I copied it from what you posted in post #5. Search for bin/install on that page and you'll see it.

I was simply explaining why that command (which you already executed) failed to do the right thing. It's because whoever made the makefile didn't take into account the possibility that /usr/local/bin didn't already exist.
 
Comment

nelly22

macrumors 6502
Original poster
Sep 29, 2009
355
5
No, you should establish what the current permissions, owner and group are.
/usr/local/bin: 0755/drwxr--xr-x Uid: 501/Nelly/wheel

/usr/local/bin/tag: 0755/-rwxr--xr-x Uid: 501/Nelly/wheel
 
Comment

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
/usr/local/bin: 0755/drwxr--xr-x Uid: 501/Nelly/wheel

/usr/local/bin/tag: 0755/-rwxr--xr-x Uid: 501/Nelly/wheel
To change owner and group you can do this, to set it to root, admin like in the install step (not sure why that did not change).

Code:
sudo chown root:admin /usr/local/bin
sudo chown root:admin /usr/local/bin/tag
 
Comment

nelly22

macrumors 6502
Original poster
Sep 29, 2009
355
5
To change owner and group you can do this, to set it to root, admin like in the install step (not sure why that did not change).

Code:
sudo chown root:admin /usr/local/bin
sudo chown root:admin /usr/local/bin/tag
Tons of thanks to both of you. Permissions look okay now. I tested it in Script Editor and it works as long i use do shell script "/usr/local/bin/tag" not just do shell script "tag".
 
Comment

Similar threads

Register on MacRumors! This sidebar will go away, and you'll see fewer ads.