HOWTO setup your system for using KDevelop 3.x and SourceForge CVS
Updated 6.8.2004Introduction
This HOWTO describes, how-to setup your system for developing with KDevelop on SourceForge. When I tried setup my system, I found that this is very difficult task for beginner.
I hope, that this document will be useful for you. If you have any suggestion or ideas, please contact me.
Some fundamentals
KDevelop is IDE, that allow easy developing applications for KDE.
SourceForge is a free service to Open Source developers offering easy access to CVS and more ...
CVS is a version control system. Using it, you can record the history of your source files. It is ideal system fo cooperative developing.
OpenSSH is a FREE version of the SSH protocol, that allow secure access over Internet.
SSH
I assume, that you have OpenSSH client installed on your system. SourceForge provide access to CVS over SSH, for security reasons. Access to CVS require, that you must use version 1 of SSH protocol.
Configuration
Here is part of my /etc/ssh/ssh_config
contents. Alternatively you may add this configuration to
~/.ssh/config
, where ~ is your home directory.
Host * ForwardX11 yes Protocol 1 Host sf HostName myprojectname.sourceforge.net User myusername IdentityFile ~/.ssh/identity Protocol 1 Host otherHost HostName www.xxx.cz User myusername IdentityFile ~/.ssh/identity Protocol 2
As you may see, default protocol version for all hosts is 1. This force CVS over SSH use this version. If you have any other servers, specify appropriate protocol version. Of course, change "myprojectname" and "myusername" with appropriate strings.
RSA Keys
Use ssh-keygen
for generating your keys. Choose any good passphrase. Public key will be stored
to ~/.ssh/identity.pub
, private key to file ~/.ssh/identity
.
Store public key to SourceForge
To access SourceForge using RSA, public key must be stored on their server. Log on SourceForge, and click on
Account Maintenance
and Edit Keys
. Open public key file ~/.ssh/identity.pub
with simple text
editor, select all
and copy
contents and paste it into edit control in browser. Click on Update
. Now,
your public key is stored in SourceForge, and you may connect with CVS over SSH using RSA authentication.
Testing SSH
Now you may test SSH connection to shell server. Start terminal, and type:
ssh sf
where sf
is host name from /etc/ssh/ssh_config
or ~/.ssh/config
. During first connection, you will be
queried about storing servers keys. Reply yes
. You will be prompted for your shell account password (not RSA key passphrase !).
If all is OK, you will be connected to shell server. If not, check your configuration or use:
ssh -v sf
command.
BTW, you are not connected using RSA authentication, but using password authentication.
Placing public key through web interface allow only CVS access using RSA authentication. If you can use RSA on shell server,
you must connect (SSH) using password, create .ssh
directory in your home directory on server and then copy (using scp
)
public key ~/.ssh/identity.pub
here as file authorized_keys
.
CVS
Setting CVS
CVS setting is simple, you must set two environment variables. Add two lines into ~/.profile
or ~/.bash_profile
export CVS_RSH=ssh export CVSROOT=myusername@cvs.sourceforge.net:/cvsroot/myprojectname
Of course, change "myprojectname" and "myusername" with appropriate strings. Logout and logon, to take effect.
Testing CVS
Now you may test CVS over SSH. There is two possibilites: checkout existing SourceForge project (created by project admin),
or import your own project into SourceForge (you are admin). Type:
cvs checkout myprojectname
or
cvs import myprojectname vendorname start
cvs -z3 checkout myprojectname
During first connection, you will be queried about storing servers keys. Also you will be prompted for RSA key passphrasse.
SSH Agent
Now, you are prompted for RSA key passphrasse before every CVS command. For using KDevelop CVS integration, and for your comfort with manual CVS commands, you must use SSH Agent, that store RSA key passphrasse. You will prompted only once.
Every application, that use SSH Agent must run as their child process. Because KDevelop is KDE application, SSH Agent must be configured with your XWindow configuration.
Starting SSH Agent as XWindow process parent
It this possible configure XWindow to run as SSH Agent child. Edit file /usr/X11R6/bin/startx
(on SuSE 8, on other distros may be different) and add following line to top of this file:
eval `ssh-agent`; ssh-add
Starting SSH Agent as terminal child
Second way is here. Type following commands under KDE terminal:
ssh-agent csh
ssh-add
kdevelop
First command start SSH Agent, and new shell as their child process. Second command add RSA passphrasse to SSH Agent.
Third, run KDevelop. KDevelop run as SSH Agent child, and you may use KDevelop CVS integration.
KDevelop project
Moving from local CVS to SourceForge
If you have created existing project that use local CVS repository, you must make some changes. Every directory named CVS in your project contain file named Root. This file contain info about project CVS root, such as:
/home/myusername/cvsroot
Change all lines in CVS/Root files to:
myusername@cvs.sourceforge.net:/cvsroot/myprojectname