个人工具

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

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/DevelopingPreparation}} {{Languages|UbuntuHelp:DevelopingPreparation}} == Preparing your Ubuntu system for software development == A fresh Ubuntu...)
 
 
(未显示同一用户的5个中间版本)
第2行: 第2行:
 
{{Languages|UbuntuHelp:DevelopingPreparation}}
 
{{Languages|UbuntuHelp:DevelopingPreparation}}
 
== Preparing your Ubuntu system for software development ==
 
== 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.
 
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).  
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,
+
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.
 
+
<pre><nowiki>
+
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>
 
mkdir cvs
 
mkdir cvs
 
</nowiki></pre>
 
</nowiki></pre>
 
 
This will give you a nice place to work
 
This will give you a nice place to work
 
 
<pre><nowiki>
 
<pre><nowiki>
 
cd cvs
 
cd cvs
 
</nowiki></pre>
 
</nowiki></pre>
 
 
and that's all there's to it.
 
and that's all there's to it.
 
 
==== 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.  
 +
<ol><li>The first is used to tell CVS where the repository is situated, and how it should connect to it. This is generally done with</li></ol>
  
 
<pre><nowiki>
 
<pre><nowiki>
 
export CVSROOT=:pserver:<user>@<server>:<directory>
 
export CVSROOT=:pserver:<user>@<server>:<directory>
</nowiki></pre>
+
    </nowiki></pre>
 
+
replacing <user> with the username (generally anonymous for read-only access), <server> with the name of the server, and              
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.
+
<directory> with the directory of the repository on the server.
 
+
<ol><li>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.
+
</li><li>You can now finally get the code! Change to the directory you want the code in, and issue {{[cvs -z3 co <somemodule>}}}. 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.
 
+
</li><li>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.</li></ol>
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.
+
  
 
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>.
 
 
=== 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 ====
 
Just as it is easy to install, Subversion is easy to use, with
 
Just as it is easy to install, Subversion is easy to use, with
 
 
<pre><nowiki>
 
<pre><nowiki>
 
cd someproject
 
cd someproject
 
svn checkout http://<server>/<directory>
 
svn checkout http://<server>/<directory>
 
</nowiki></pre>
 
</nowiki></pre>
 
 
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
 
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
 
 
<pre><nowiki>
 
<pre><nowiki>
 
svn update
 
svn update
 
</nowiki></pre>
 
</nowiki></pre>
 
 
making sure that you are in the directory that you checked it out to.
 
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  
 
Further information on Subversion can be found at http://subversion.tigris.org/, and help can be got with  
 
<pre><nowiki>
 
<pre><nowiki>
第83行: 第49行:
 
</nowiki></pre>  
 
</nowiki></pre>  
 
or at http://www.svnbook.org/.
 
or at http://www.svnbook.org/.
 
+
----
=== Notes ===
+
[[category:CategoryProgramming]]
 
+
'''Note:''' We need other version control systems as well.
+
 
+
[[category:CategoryDocumentation]] [[category:CategoryCleanup]]
+
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2008年12月16日 (二) 18:15的最新版本

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.

  1. 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.

  1. 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.
  2. You can now finally get the code! Change to the directory you want the code in, and issue {{[cvs -z3 co <somemodule>}}}. 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.
  3. 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/.