个人工具

“UbuntuHelp:DevelopingPreparation”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/DevelopingPreparation}} {{Languages|UbuntuHelp:DevelopingPreparation}} == Preparing your Ubuntu system for software development == A fresh Ubuntu...)
 
第5行: 第5行:
 
A fresh Ubuntu install lacks most things to do any form of development. You can not even start building packages from source.  So you will need a few packages installed to get started.
 
A fresh Ubuntu install lacks most things to do any form of development. You can not even start building packages from source.  So you will need a few packages installed to get started.
  
All of the primary development packages are in main, so no extra repositories are required (the exception was mono in Hoary, but this is no longer the case in Breezy). So,
+
All of the primary development packages are in main, so no extra repositories are required (the exception was mono in Hoary, but this is no longer the case in Breezy).  
  
<pre><nowiki>
+
Install the '''build-essential''' package which will install most of the tools that you will need to compile most packages, as well as write your own.
sudo apt-get install build-essential
+
</nowiki></pre>
+
 
+
will install most of the tools that you will need to compile most packages, as well as write your own.
+
  
 
=== CVS ===
 
=== CVS ===
 
==== Installing CVS ====
 
==== Installing CVS ====
Much of the latest software can only be downloaded using CVS. Installing it is simple:
+
Much of the latest software can only be downloaded using CVS. Install the '''cvs''' package then to start working with it, create a build area
 
+
<pre><nowiki>
+
sudo apt-get install cvs
+
</nowiki></pre>
+
 
+
To start working with it, create a build area
+
  
 
<pre><nowiki>
 
<pre><nowiki>
第36行: 第26行:
  
 
==== Using CVS ====
 
==== Using CVS ====
The initial checkout of the code from a CVS repository is fairly simple, and is made up of three commands. The first is used to tell CVS where the repository is situated, and how it should connect to it. This is generally done with
+
The initial checkout of the code from a CVS repository is fairly simple, and is made up of three commands.  
 +
 
 +
* The first is used to tell CVS where the repository is situated, and how it should connect to it. This is generally done with
  
 
<pre><nowiki>
 
<pre><nowiki>
第42行: 第34行:
 
</nowiki></pre>
 
</nowiki></pre>
  
replacing <user> with the username (generally anonymous for read-only access), <server> with the name of the server, and <directory> with the directory of the repository on the server.
+
replacing <user> with the username (generally anonymous for read-only access), <server> with the name of the server, and              
 +
<directory> with the directory of the repository on the server.
  
Next, we log on to the server. When you are only reading the repository (ie. most of the time), you will log on as anonymous, generally with no password, although some projects may be different. The login is performed with the command <code><nowiki>cvs login</nowiki></code> and entering the password when prompted.
+
* Next, we log on to the server. When you are only reading the repository (ie. most of the time), you will log on as anonymous, generally with no password, although some projects may be different. The login is performed with the command <code><nowiki>cvs login</nowiki></code> and entering the password when prompted.
  
You can now finally get the code! Change to the directory you want the code in, and issue {{[cvs -z3 co <somemodule></nowiki></pre>. The -z[n] parameter tells CVS to use compression, with 0 being no compression and 9 being the most. 3 is the most commonly used. 'co' means check-out, and <somemodule> needs to be replaced with the name of the module you wish to check-out.
+
* You can now finally get the code! Change to the directory you want the code in, and issue {{[cvs -z3 co <somemodule></nowiki></pre>. The -z[n] parameter tells CVS to use compression, with 0 being no compression and 9 being the most. 3 is the most commonly used. 'co' means check-out, and <somemodule> needs to be replaced with the name of the module you wish to check-out.
  
When the repository changes, you are likely to want the latest version again. This can be achieved with <code><nowiki>cvs update -dP</nowiki></code> in the directory of the local copy. The d parameter creates new directories, and the P deletes the old ones.
+
* When the repository changes, you are likely to want the latest version again. This can be achieved with <code><nowiki>cvs update -dP</nowiki></code> in the directory of the local copy. The d parameter creates new directories, and the P deletes the old ones.
  
 
More information on CVS usage can be found with <code><nowiki>man cvs</nowiki></code>.
 
More information on CVS usage can be found with <code><nowiki>man cvs</nowiki></code>.
第54行: 第47行:
 
=== Subversion ===
 
=== Subversion ===
 
==== Installing Subversion ====
 
==== Installing Subversion ====
Subversion (often known as SVN), while not as widely known/used as CVS, is rapidly gaining use in the source code management field. Many major software projects use it, as it has many distinct advantages over the older CVS. It is much easier to use, and has features that make administering the 'repositories' of code much easier. It is very easily installed in Ubuntu, with a simple
+
Subversion (often known as SVN), while not as widely known/used as CVS, is rapidly gaining use in the source code management field. Many major software projects use it, as it has many distinct advantages over the older CVS. It is much easier to use, and has features that make administering the 'repositories' of code much easier. Just install the '''subversion''' package.
 
+
<pre><nowiki>
+
sudo apt-get install subversion
+
</nowiki></pre>
+
 
+
getting you ready to download the latest source code.
+
  
 
==== Using Subversion ====
 
==== Using Subversion ====
第84行: 第71行:
 
or at http://www.svnbook.org/.
 
or at http://www.svnbook.org/.
  
=== Notes ===
 
 
'''Note:''' We need other version control systems as well.
 
  
[[category:CategoryDocumentation]] [[category:CategoryCleanup]]
+
[[category:CategoryDocumentation]]  
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年11月22日 (四) 12:20的版本

Preparing your Ubuntu system for software development

A fresh Ubuntu install lacks most things to do any form of development. You can not even start building packages from source. So you will need a few packages installed to get started.

All of the primary development packages are in main, so no extra repositories are required (the exception was mono in Hoary, but this is no longer the case in Breezy).

Install the build-essential package which will install most of the tools that you will need to compile most packages, as well as write your own.

CVS

Installing CVS

Much of the latest software can only be downloaded using CVS. Install the cvs package then to start working with it, create a build area

mkdir cvs

This will give you a nice place to work

cd cvs

and that's all there's to it.

Using CVS

The initial checkout of the code from a CVS repository is fairly simple, and is made up of three commands.

  • The first is used to tell CVS where the repository is situated, and how it should connect to it. This is generally done with
export CVSROOT=:pserver:<user>@<server>:<directory>

replacing <user> with the username (generally anonymous for read-only access), <server> with the name of the server, and <directory> with the directory of the repository on the server.

  • Next, we log on to the server. When you are only reading the repository (ie. most of the time), you will log on as anonymous, generally with no password, although some projects may be different. The login is performed with the command cvs login and entering the password when prompted.
  • You can now finally get the code! Change to the directory you want the code in, and issue {{[cvs -z3 co <somemodule></nowiki></pre>. The -z[n] parameter tells CVS to use compression, with 0 being no compression and 9 being the most. 3 is the most commonly used. 'co' means check-out, and <somemodule> needs to be replaced with the name of the module you wish to check-out.
  • When the repository changes, you are likely to want the latest version again. This can be achieved with cvs update -dP in the directory of the local copy. The d parameter creates new directories, and the P deletes the old ones.

More information on CVS usage can be found with man cvs.

Subversion

Installing Subversion

Subversion (often known as SVN), while not as widely known/used as CVS, is rapidly gaining use in the source code management field. Many major software projects use it, as it has many distinct advantages over the older CVS. It is much easier to use, and has features that make administering the 'repositories' of code much easier. Just install the subversion package.

Using Subversion

Just as it is easy to install, Subversion is easy to use, with

cd someproject
svn checkout http://<server>/<directory>

getting the latest source code (when <server> is replaced with the server of the repository, and <directory> with the directory on the server in which the repository is situated), and putting it in the current directory. Further updates can be retrieved with

svn update

making sure that you are in the directory that you checked it out to.

Further information on Subversion can be found at http://subversion.tigris.org/, and help can be got with

svn help

or at http://www.svnbook.org/.