Setting up CVS on Mac OS X

gryntekaj

Registered
I've been using around a day on finding information about setting up CVS under MacOS X.
Now I finally managed to get it up and running, so you can log on using a client from
MacOS, Linux, Windows, BeOS or whatever you want.
There is a misleading thing in almost all other directions on how to do this.
People say that you should edit the /etc/services file. Do *not*, I repeat: *NOT* do that!
-You *have* to use NetInfoManager. As long as your custom-line is in services, you can't
get CVS running correctly. Follow my directions, and you'll be up and running in no time.

General tips:
1: Use a static IP address for your CVS-server.
2: Register the domain name on a local Domain Name Service.
3: Keep the server up and running always.
4: Use your slow computer for being CVS server, the fast one for work.
5: Having the CVS on the internet is neat if the sources are not secret,
but beware! If you do not use secure login, other people can easily rip
your password and mess with your server.


Here's a step-by-step (detailed) guide on how to setup CVS on MacOS X.
Everything in parantheses are things you should do and not enter directly.
Lines starting with "#" are comment lines.
Server used: MacOS X
Client used: MacOS 9.1
Editor used: Emacs

---8<-----8<-----8<-----
su
(enter password)
cvs -d /CVS init
chmod 777 /CVS
cd /CVS
htpasswd -c passwd yourname
(enter password)
(enter password again for verification)
cd /etc/
emacs inetd.conf
(insert the next line above the "finger" line...)
cvs stream tcp nowait root /usr/bin/cvs cvs --allow-root=/CVS pserver
(hint: use TAB instead of spaces, other hint: There is only one line above!)
(save by pressing control-x, then control-s)
(quit by pressing control-x, then control-c)
(Do *NOT* edit /etc/services! -If you do, you will *NOT* get CVS up and running!)
exit
(you are no longer root)

(start NetInfoManager from the Finder)
(click the lock and enter your password)
(click "services")
(duplicate the "finger" entry)
(click the name "finger copy", rename it to "cvs")
(click the port number "79", change it to "2401")
(save by pressing Command-S)
(restart your computer)

cd $home
mkdir dev
cd dev
mkdir cvstest
cd cvstest
echo "Hello world!" > readme.txt
setenv CVSROOT /CVS
cvs import -m "Import from sources" Module Main rel_0_01
# "Module" is the name of the module you will be creating on CVS
# "Main" is the branch name
# "rel_0_01" is a release tag
(now your sources are in the repository, let's go and get them...)
cd ..
mkdir junk
cd junk
cvs checkout Module
--->8----->8----->8-----
If you had no errors so far, it's great.
The above has been tested with a freshly installed version of MacOS X (10.0.1),
and works!
Now you should be ready for using the CVS client on your work-computer.
Startup the CVS-GUI thing. In the preference box, enter something like...
yourname@serverHostName:/CVS
for instance:
don@cvs.doe.org:/CVS
(remember the colon before /CVS)
Click OK (or press return)

[Macintosh section]
I don't know how to solve this on other systems, but I'll provide a solution
for Mac users...
If you try to enter the IP number directly instead of a host name, you'll get
another nice problem. But I'll help you through that as well, since I'm at it
anyway...
If you have a HOSTS file already, great, open it!
If not, open your favorite TEXT editor. Create a file called "Hosts" in your
Preferences folder.
Add a line to the bottom of this file:

cvs.doe.yea A 192.168.1.71

(it can be any wild domain, I just choose "yes" because it usually won't conflict
with anything)

Open the TCP/IP control panel, switch usermode (in the "Edit" menu) to "Administration"
or "Advanced", then click the "Select Hosts File" button. Now choose the new Hosts file
you created. Close the window, and answer "yep, you wanna save it"...
The line you type in your CVS preferences should then look like:
don@cvs.doe.yea:/CVS ;Don's CVS server

[End of Macintosh section]

Now in the "Cvs Admin" menu, click "Login..."
Type in your cvs-password.
In the "Cvs Admin" menu, click "Checkout module..."
Choose the Disk where you want the folder "Module" to be created.
You will see another dialog-box asking for Module name and path on the server.
Type "Module" in this box.
Now click OK.
You should receive the sources

If you got this far without errors, congratulations on your new CVS server!
-Otherwise examine the paths, watch out for missing colons. You may have to
type :pserver: in front of the servername (in your CVS-GUI).
Also... You may have to re-enter your password in the login-box, even though
CVS-GUI remembers it.
 
What version of CVS server did you install and where did you find it? Were there specific instructions for its installation or was it a 'standard' install?
Thanks for the above outline, though - I can't wait to make use of it!
Tim
 
I used the CVS that installs with the developer CDs.

You get 2 CDs, the one installs MacOS X, the other one installs the developer tools, such as InterphaseBuilder, ProjectBuilder, etc.
CVS is included on the developer tools.

A good thing to do is to give your MacOS X partition at least 2GB, I prefer 3GB for MacOSX + dev. tools + CodeWarrior (CW: only because I *have* to, as it's work-related..)

Also a hint: Do not format as a unix partition, use MacOS Extended.
A few unix gurus wanted a *real* unix partition and they have a bunch of problems with things like MindVision's installer not working right.

Happy CVS'ing. :)
-Hopefully we'll see a bunch of new public CVS servers on the net. :)
 
Oh, almost forgot...

The install is a standard install. There is only one install, that
is to install the development tools. Nothing should go wrong here.

-And to those people wondering if CVS would be of any use to them:

If you are more than one person editing the same text-file, you would benefit from using CVS.
Try searching the net for CVS, if you do not know what it is yet.

:eek: Web-masters and programmers are recommended to use CVS.

-A single person would benefit from using CVS when he wants to go back and forward in history of his files. ("undo"-history) -This would probably be most useful for programmers.
 
Back
Top