<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux ABC &#187; 编译</title>
	<atom:link href="http://www.linuxabc.net.cn/tag/%e7%bc%96%e8%af%91/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linuxabc.net.cn</link>
	<description>那些人/那些事...</description>
	<lastBuildDate>Tue, 09 Feb 2010 14:09:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>如何在Debian中制作deb包（以安装n2n为例）？</title>
		<link>http://www.linuxabc.net.cn/debian/how-to-rebuild-package-within-debian.html</link>
		<comments>http://www.linuxabc.net.cn/debian/how-to-rebuild-package-within-debian.html#comments</comments>
		<pubDate>Sat, 18 Apr 2009 04:41:23 +0000</pubDate>
		<dc:creator>alfie</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[编译]]></category>

		<guid isPermaLink="false">http://www.linuxabc.net.cn/debian/how-to-rebuild-package-within-debian.html/</guid>
		<description><![CDATA[n2n是一个二层VPN软件，主要用于实现两个位于防火墙后面的主机之间的互联，就像OpenVPN将SSL从https协议层剥离开来一样，n2n将p2p从应用层（BT、skype、eMule）剥离从来，放在网络层实现。它是由ntop的作者开发的一个新软件，官方网页：http://www.ntop.org/n2n。
n2n诞生时间不长，所以还没有进入debian的源，不过已经有人把它放到mentors.debian.org里面了。
说明：mentors.debian.org是一个新手练习场，怎么说呢，大家知道，debian由一群自发组织的软件包开发者（Debian developer，简称DD）维护，他们遵循Debian的契约，维护着一个非常庞大的软件群。每个进入debian源的软件都要经历长时间的测试才能进入，而且必须由DD才有权限上传。如果某个新手（可能是某个linux爱好者，也可能是其它发行版的维护者，总之不是DD）制作了一款好用的软件，而又想惠及广大的debian用户，这个时候他就需要找一个DD帮你上传，这位DD因为热心的帮助新手，因此也被称之为mentors（导师）。所以debian社区专门成立了mentors.debian.org，以便让更多的linux爱好者发展成为DD。
上传到mentors.debian.org的软件包以源代码的形式存在，不是预编译好的deb包，因此需要Debian用户下载源代码后自行编译。
Debian中的二进制软件包是deb，其编译过程跟其它发行版有很大的不同，下面就以n2n为例讲述如何下载源代码、编译deb和安装。
1、在sources.list中加入mentors.debian.org

alfie:~# vim /etc/apt/sources.list
deb-src http://mentors.debian.org/debian/ unstable main contrib non-free
:wq
&#160;
alfie:~# aptitude update

2、下载&#38;编译

alfie:~# apt-get source n2n
;从mentors中下载n2n的源代码
&#160;
alfie:~# apt-get install fakeroot build-essential devscripts
;安装编译环境所需的组件，debuild是devscripts软件包中的一个脚本，编译的时候需要用到
&#160;
alfie:~# apt-get build-dep n2n
;编译n2n的过程可能需要一些lib的支持，该步骤就是让debian判断并下载安装相关的lib
&#160;
alfie:~# cd n2n_1.2.2~svn3653
alfie:~# debuild -us -uc
;如果不是Debian的维护者，需要打上-us和-uc这两个标签，避免编译完后签名

3、安装 

alfie:~# cd ..
alfie:~# dpkg --install n2n_1.2.2~svn3653_i386.deb

参考：http://www.debian-administration.org/articles/20
]]></description>
			<content:encoded><![CDATA[<p>n2n是一个二层VPN软件，主要用于实现两个位于防火墙后面的主机之间的互联，就像OpenVPN将SSL从https协议层剥离开来一样，n2n将p2p从应用层（BT、skype、eMule）剥离从来，放在网络层实现。它是由ntop的作者开发的一个新软件，官方网页：<a href="http://www.ntop.org/n2n。">http://www.ntop.org/n2n。</a></p>
<p>n2n诞生时间不长，所以还没有进入debian的源，不过已经有人把它放到mentors.debian.org里面了。</p>
<p>说明：mentors.debian.org是一个新手练习场，怎么说呢，大家知道，debian由一群自发组织的软件包开发者（Debian developer，简称DD）维护，他们遵循Debian的契约，维护着一个非常庞大的软件群。每个进入debian源的软件都要经历长时间的测试才能进入，而且必须由DD才有权限上传。如果某个新手（可能是某个linux爱好者，也可能是其它发行版的维护者，总之不是DD）制作了一款好用的软件，而又想惠及广大的debian用户，这个时候他就需要找一个DD帮你上传，这位DD因为热心的帮助新手，因此也被称之为mentors（导师）。所以debian社区专门成立了mentors.debian.org，以便让更多的linux爱好者发展成为DD。</p>
<p>上传到mentors.debian.org的软件包以源代码的形式存在，不是预编译好的deb包，因此需要Debian用户下载源代码后自行编译。</p>
<p>Debian中的二进制软件包是deb，其编译过程跟其它发行版有很大的不同，下面就以n2n为例讲述如何下载源代码、编译deb和安装。</p>
<h5>1、在sources.list中加入mentors.debian.org</h5>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">alfie:~<span style="color: #666666; font-style: italic;"># vim /etc/apt/sources.list</span>
deb-src http:<span style="color: #000000; font-weight: bold;">//</span>mentors.debian.org<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span> unstable main contrib non-free
:wq
&nbsp;
alfie:~<span style="color: #666666; font-style: italic;"># aptitude update</span></pre></div></div>

<h5>2、下载&amp;编译</h5>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">alfie:~<span style="color: #666666; font-style: italic;"># apt-get source n2n</span>
;从mentors中下载n2n的源代码
&nbsp;
alfie:~<span style="color: #666666; font-style: italic;"># apt-get install fakeroot build-essential devscripts</span>
;安装编译环境所需的组件，debuild是devscripts软件包中的一个脚本，编译的时候需要用到
&nbsp;
alfie:~<span style="color: #666666; font-style: italic;"># apt-get build-dep n2n</span>
;编译n2n的过程可能需要一些lib的支持，该步骤就是让debian判断并下载安装相关的lib
&nbsp;
alfie:~<span style="color: #666666; font-style: italic;"># cd n2n_1.2.2~svn3653</span>
alfie:~<span style="color: #666666; font-style: italic;"># debuild -us -uc</span>
;如果不是Debian的维护者，需要打上-us和-uc这两个标签，避免编译完后签名</pre></div></div>

<h5>3、安装 </h5>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">alfie:~<span style="color: #666666; font-style: italic;"># cd ..</span>
alfie:~<span style="color: #666666; font-style: italic;"># dpkg --install n2n_1.2.2~svn3653_i386.deb</span></pre></div></div>

<p>参考：<a href="http://www.debian-administration.org/articles/20">http://www.debian-administration.org/articles/20</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxabc.net.cn/debian/how-to-rebuild-package-within-debian.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
