https://wiki.ubuntu.org.cn/index.php?title=Deb%E5%8C%85%E7%AE%A1%E7%90%86%E5%90%91%E5%AF%BC&feed=atom&action=history
Deb包管理向导 - 版本历史
2024-03-29T10:35:49Z
本wiki的该页面的版本历史
MediaWiki 1.26.3
https://wiki.ubuntu.org.cn/index.php?title=Deb%E5%8C%85%E7%AE%A1%E7%90%86%E5%90%91%E5%AF%BC&diff=149531&oldid=prev
Manbuzhe:/* debian/rules示例 */
2013-01-18T02:18:18Z
<p><span dir="auto"><span class="autocomment">debian/rules示例</span></span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='zh-Hans'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">←上一版本</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">2013年1月18日 (五) 02:18的版本</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l162" >第162行:</td>
<td colspan="2" class="diff-lineno">第162行:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> rm -rf debian/xorg</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> rm -rf debian/xorg</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>.PHONY: build clean binary-indep binary-arch binary install  </div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>.PHONY: build clean binary-indep binary-arch binary install  </div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>
Manbuzhe
https://wiki.ubuntu.org.cn/index.php?title=Deb%E5%8C%85%E7%AE%A1%E7%90%86%E5%90%91%E5%AF%BC&diff=149530&oldid=prev
124.205.131.209:/* 准备编译环境 */
2013-01-18T02:16:47Z
<p><span dir="auto"><span class="autocomment">准备编译环境</span></span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='zh-Hans'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">←上一版本</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">2013年1月18日 (五) 02:16的版本</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l119" >第119行:</td>
<td colspan="2" class="diff-lineno">第119行:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>po4a 依赖关系:TermReadKey-2.14</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>po4a 依赖关系:TermReadKey-2.14</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">== 准备编译环境 ==</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">在开始之前,建议你把如下软件包安装到系统中</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"><pre></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">sudo apt-get install build-essential debhelper make autoconf automake patch dpkg-dev</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></pre></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">如果需要更多的功能,请把这些也安装上</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"><pre></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">sudo apt-get install fakeroot pbuilder gnupg</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></pre></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">相应的软件包功能简介</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"><pre></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">gcc      GNU C语言编译器</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">g++    GNU C++语言编译器</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">make  GNU自动化构建工具 </del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">autoconf 和 automake 很多新的程序在这一类工具的帮助下来配置脚本文件并对Makefiles进行预处理。(参考“info autoconf”和“info automake”)</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">dpkg-dev  这个软件包包括了在解开、制作、上传Debian源文件包时需要用到的工具</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">diff/patch  源码补丁制作与补丁管理工具</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">fakeroot    模拟变成root用户,这在创建软件包的过程的一些部分是必要的</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">pbuilder 这个软件包中包含了用于创建和维护chroot环境的程序。在此chroot环境中构建Debian可以检查构建软件包的依赖关系的正确性并防止FTBFS错误发生。</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">libc6-dev gnupg</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></pre> </del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>== 首次 "Debian" ==</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>== 首次 "Debian" ==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>
124.205.131.209
https://wiki.ubuntu.org.cn/index.php?title=Deb%E5%8C%85%E7%AE%A1%E7%90%86%E5%90%91%E5%AF%BC&diff=149529&oldid=prev
124.205.131.209:以内容'== dpkg的编译安装 == 核心软件包的编译: dpkg的编译: <pre> git clone http://anonscm.debian.org/git/dpkg/dpkg.git cd dpkg ./configure --prefix=/usr --wit…'创建新页面
2013-01-18T02:16:00Z
<p>以内容'== dpkg的编译安装 == 核心软件包的编译: dpkg的编译: <pre> git clone http://anonscm.debian.org/git/dpkg/dpkg.git cd dpkg ./configure --prefix=/usr --wit…'创建新页面</p>
<p><b>新页面</b></p><div>== dpkg的编译安装 ==<br />
<br />
核心软件包的编译: <br />
dpkg的编译:<br />
<pre><br />
git clone http://anonscm.debian.org/git/dpkg/dpkg.git<br />
cd dpkg<br />
./configure --prefix=/usr --with-admindir=/var/lib/dpkg <br />
make && make install <br />
</pre><br />
编译完成后,需要手动配置dpkg:<br />
mkdir -pv /var/lib/dpkg/touch /var/lib/dpkg/status <br />
<br />
dpkg打包相关的一些命令会依赖如下Perl模块<br />
==== TimeDate Perl模块 ====<br />
<pre><br />
wget http://mirrors.btte.net/CPAN/authors/id/G/GB/GBARR/TimeDate-1.20.tar.gz<br />
tar -xvpf TimeDate-1.20.tar.gz<br />
cd TimeDate-1.20<br />
perl Makefile.PL && make && make install<br />
</pre><br />
<br />
==== 安装TermReadKey-2.14 ====<br />
<br />
ln -sv /usr/bin/gcc /usr/bin/cc<br />
<br />
<pre><br />
wget http://mirrors.xmu.edu.cn/CPAN/authors/id/J/JS/JSTOWE/TermReadKey-2.30.tar.gz<br />
tar -xvpf TermReadKey-2.30.tar.gz<br />
cd TermReadKey-2.30<br />
perl Makefile.PL && make && make install <br />
</pre><br />
<br />
==== 安装 libxml2-2.9.0 ====<br />
<pre><br />
wget http://xmlsoft.org/sources/libxml2-2.9.0.tar.gz<br />
tar -xvpf libxml2-2.9.0.tar.gz<br />
cd libxml2-2.9.0<br />
./configure --prefix=/usr --disable-static &&<br />
make<br />
make install<br />
</pre><br />
<br />
==== 安装libxslt ====<br />
<pre><br />
wget http://xmlsoft.org/sources/libxslt-1.1.27.tar.gz<br />
tar -xvpf libxslt-1.1.27.tar.gz<br />
cd libxslt-1.1.27<br />
./configure --prefix=/usr --disable-static &&<br />
make<br />
make install<br />
</pre><br />
<br />
==== 安装gettext ====<br />
<pre><br />
wget http://mirrors.163.com/cpan/authors/id/P/PV/PVANDRY/gettext-1.05.tar.gz<br />
tar -xvpf Gettext-0.01.tar.gz<br />
cd Gettext-0.01<br />
perl Makefile.PL && make && make install<br />
</pre><br />
<br />
==== SGMLSpm ====<br />
<pre><br />
wget http://ftp.cuhk.edu.hk/pub/packages/perl/CPAN/authors/id/R/RA/RAAB/SGMLSpm-1.1.tar.gz<br />
tar -xvpf SGMLSpm-1.1.tar.gz<br />
cd SGMLSpm-1.1<br />
perl Makefile.PL && make && make install<br />
</pre><br />
<br />
==== Text-WrapI18N-0.06 ====<br />
<pre><br />
wget http://mirrors.ustc.edu.cn/CPAN/authors/id/K/KU/KUBOTA/Text-WrapI18N-0.06.tar.gz<br />
tar -xvpf Text-WrapI18N-0.06.tar.gz<br />
cd Text-WrapI18N-0.06<br />
perl Makefile.PL && make && make install <br />
</pre><br />
<br />
== dpkg-dev的编译安装 ==<br />
<br />
==== File-FcntlLock-0.14 ====<br />
<pre><br />
wget http://mirrors.btte.net/CPAN/authors/id/J/JT/JTT/File-FcntlLock-0.14.tar.gz<br />
tar -xvpf File-FcntlLock-0.14.tar.gz<br />
cd File-FcntlLock-0.14<br />
perl Makefile.PL && make && make install <br />
</pre><br />
==== Unicode-LineBreak ====<br />
<pre><br />
wget http://mirrors.btte.net/CPAN/authors/id/N/NE/NEZUMI/Unicode-LineBreak-2012.10.tar.gz<br />
tar -xvpf Unicode-LineBreak-2012.10.tar.gz<br />
cd Unicode-LineBreak-2012.10<br />
perl Makefile.PL && make && make install <br />
</pre><br />
<br />
==== dh-make ====<br />
<pre><br />
git clone git://anonscm.debian.org/collab-maint/dh-make.git<br />
cd dh-make<br />
dpkg-buildpackage<br />
</pre><br />
<br />
==== 安装 po4a ====<br />
<pre><br />
wget http://alioth.debian.org/frs/download.php/3786/po4a-0.44.tar.gz<br />
tar -xvpf po4a-0.44.tar.gz<br />
cd po4a-0.44<br />
dpkg-buildpackage<br />
</pre><br />
<br />
==== 安装 debhelper ==== <br />
<pre><br />
git clone git://git.debian.org/git/debhelper/debhelper.git<br />
cd debhelper<br />
</pre><br />
<br />
<br />
dpkg依赖关系:LFS额外的软件包:TimeDate <br />
debhelper 依赖关系: perl , po4a-0.41 <br />
po4a 依赖关系:TermReadKey-2.14<br />
<br />
== 准备编译环境 ==<br />
<br />
在开始之前,建议你把如下软件包安装到系统中<br />
<pre><br />
sudo apt-get install build-essential debhelper make autoconf automake patch dpkg-dev<br />
</pre><br />
如果需要更多的功能,请把这些也安装上<br />
<pre><br />
sudo apt-get install fakeroot pbuilder gnupg<br />
</pre><br />
相应的软件包功能简介<br />
<pre><br />
gcc GNU C语言编译器<br />
g++ GNU C++语言编译器<br />
make GNU自动化构建工具 <br />
autoconf 和 automake 很多新的程序在这一类工具的帮助下来配置脚本文件并对Makefiles进行预处理。(参考“info autoconf”和“info automake”)<br />
dpkg-dev 这个软件包包括了在解开、制作、上传Debian源文件包时需要用到的工具<br />
diff/patch 源码补丁制作与补丁管理工具<br />
fakeroot 模拟变成root用户,这在创建软件包的过程的一些部分是必要的<br />
pbuilder 这个软件包中包含了用于创建和维护chroot环境的程序。在此chroot环境中构建Debian可以检查构建软件包的依赖关系的正确性并防止FTBFS错误发生。<br />
libc6-dev gnupg<br />
</pre> <br />
== 首次 "Debian" ==<br />
<br />
所谓的“Debian化”是指:当我们获取上游社区发布的软件包后,需要对软件包里面的内容进行调整,以适应deb打包的需要,所幸的是现在这个工作不需要过多的手动操作,我们可以使用 dh-make 这个工具可以很简单地帮助您作“Debian化”。<br />
<br />
我们以GNU官方的tar-1.2.6.tar.gz为例子来演示如何使用dh-make “Debian化”一个上游源码包,获取源码:<br />
<pre><br />
wget http://ftp.gnu.org/gnu/tar/tar-1.26.tar.bz2<br />
</pre><br />
将源码解后进入源码目录,执行命令:<br />
<pre><br />
tar -xvpf tar-1.26.tar.bz2<br />
cd tar-1.26<br />
dh_make -e regulus_cn@163.com -f ../tar-1.26.tar.bz2<br />
...<br />
</pre><br />
<br />
== debian/rules示例 ==<br />
rules文件本质上是一个Makefile文件,这个Makefile文件定义了创建deb格式软件包的规则。打包工具按照rules文件指定的规则,完成编译,将软件安装到临时安装目录,清理编译目录等操作,并依据安装到临时目录的文件来生成deb格式的软件包。<br />
<br />
rules文件一般会包含,”binary-arch”, ”binary-indep”,”binary”,”build”, ”clean”, ”install”, 等targets。<br />
<br />
debian/rules 示例:<br />
<pre><br />
#!/usr/bin/make -f<br />
<br />
binary:build install<br />
dh_makeshlibs<br />
dh_shlibdeps<br />
dh_installdeb<br />
dh_gencontrol<br />
dh_md5sums <br />
dh_builddeb <br />
binary-indep: binary<br />
binary-arch: binary<br />
build:<br />
./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --localstatedir=/var <br />
make -j16<br />
install:<br />
dh_auto_install<br />
clean:<br />
dh_auto_clean<br />
rm -rf debian/xorg<br />
.PHONY: build clean binary-indep binary-arch binary install <br />
<br />
</pre><br />
<br />
== dh命令简要解析 ==<br />
<br />
dh是debhelper包中的命令序列,dh开头的命令主要用于简化rules文件的编写,把一些通用的重复的操作用perl命令来代替。<br />
<br />
下面是一些dh命令和实际对应执行的操作的简要介绍<br />
<pre><br />
dh_auto_clean make distclean<br />
dh_auto_configure ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var ...<br />
dh_auto_build make<br />
dh_auto_test make test<br />
dh_auto_install make install DESTDIR=/path/to/package_version-revision/debian/package <br />
</pre><br />
以上的targets 如果需要 fakeroot 操作,则需要加上dh_testroot,下面还有一些功能性的操作<br />
<pre><br />
dh_makeshlibs <br />
dh_shlibdeps 自动生成软件包的依赖关系<br />
dh_installdeb<br />
</pre><br />
<br />
== deb包的执行脚本 ==<br />
<br />
许多软件安装前或安装后都需要进行一些设置工作,deb格式的软件安装过程执行的操作是由如下脚本来控制的<br />
<pre><br />
debian/preinst 安装前执行脚本<br />
debian/postinst 安装后执行脚本<br />
debian/prerm 卸载前执行脚本<br />
debian/postrm 卸载后执行脚本<br />
</pre><br />
<br />
=== debian/preinst ===<br />
<pre><br />
#!/bin/sh<br />
if [ "$1" = "upgrade" ] || [ "$1" = "install" ];then<br />
需要执行的脚本<br />
fi<br />
</pre><br />
<br />
=== debian/postinst ===<br />
<pre><br />
#!/bin/sh<br />
set -e<br />
if [ "$1" = "configure" ]; then<br />
ldconfig<br />
fi<br />
</pre><br />
<br />
=== debian/prerm ===<br />
<pre><br />
if [ "$1" = "remove" -o "$1" = "deconfigure" ]; then<br />
需要执行的脚本<br />
fi<br />
</pre><br />
<br />
=== debian/postrm ===<br />
<pre><br />
#!/bin/sh<br />
if [ "$1" = "purge" ] ; then<br />
需要执行的脚本<br />
fi<br />
</pre><br />
== dsc源码包格式 ==<br />
<br />
在 man dpkg-source 中包含 deb 源代码新格式的一些介绍,也许有的朋友会感兴趣。<br />
* 一.新格式的优点<br />
支持 bzip2、lzma (估计就是 7z 格式)、gzip 压缩格式<br />
支持多个上游 tarballs<br />
支持包含二进制文件,旧格式使用 diff 文件(diff.gz)来存储打包过程中对源代码的改变,而 diff 文件是处理文本文件的,所以如果想添加一个二进制文件(比如 png 图标),就需要使用 uuencode 把二进制文件转换为文本文件,比较麻烦不需要因为 strip debian 目录而重新打包上游 tarball(debian 目录在 deb 源代码包解压缩的时候自动被.debian.tar.{gz,bz2,lzma}里面的设为首页内容取代)Debian-specific 的改变现在不是保存在单一的 .diff.gz 文件里面而是保存在 debian/patches/ 下的多个 patch 文件里。这种处理方式和 quilt 的处理方式兼容但不需要使用 quilt,因为 dpkg-source 可以处理所有的事情,它在解压缩过程中使用 patch 文件,在构建二进制包的过程中更新 patch series<br />
NMU workflow is now really: unpack, hack, rebuild (for all 3.0 (quilt) packages).<br />
* 二.新格式的种类<br />
<pre><br />
Format:1.0<br />
Format:2.0<br />
Format:3.0 (native)<br />
Format:3.0 (quilt)<br />
Format:3.0 (git)<br />
Format:3.0 (bzr)<br />
</pre><br />
* 三.Format:1.0 格式介绍<br />
这个是原来的格式:一个 .dsc 文件,一个 .orig.tar.gz 文件,一个 .diff.gz 文件<br />
* 四.Format:2.0 格式介绍<br />
这个格式不建议广泛使用,是个过渡格式<br />
* 五.Format:3.0 (native) 格式介绍<br />
这个格式是 Format:1.0 的扩展,可以支持多种压缩方式{gz,bz2,lzma}<br />
* 六.Format:3.0 (quilt) 格式介绍<br />
这个格式可能被 debian 的下一个版本采用,它是 Format:2.0 的扩展,因为它补丁的处理方式和 quilt 兼容,所以如此命名<br />
源代码包的组成:<br />
一个 .orig.tar.{gz,bz2,lzma}压缩包,这个包是上游源代码更名后得到的<br />
一个 .debian.tar.{gz,bz2,lzma}压缩包,这个包包含了 debian 化的所有更改<br />
零个或者多个 .orig-.tar.{gz,bz2,lzma},比如:.orig-hello.tar. {gz,bz2,lzma} 或 .orig-world.tar.{gz,bz2,lzma}。这是为了支持多个上游 tarball<br />
一个 .dsc 文件<br />
源代码包的解压缩:orig 包首先解压缩,产生一个目录,比如:helloworld_0.1.1.orig.tar.gz 就会生成 helloworld-0.1.1 这个包含上游源代码的目录所有 orig- 解压缩,产生一个目录,比如:helloworld_0.1.1.orig-toy.tar.gz 就会生成 helloworld-0.1.1/toy/ 目录,这个目录包含 helloworld_0.1.1.orig-toy.tar.gz 里面所有的内容,原来存在的 helloworld-0.1.1/toy/ 将被取代 (man dpkg-source 这一段没有看懂,可能理解有误。)<br />
debian 包解压缩,生成 debian 目录,比如:helloworld_0.1.1.debian.tar.gz 就会生成 helloworld-0.1.1/debian/ 目录,原来存在的这个目录在这个过程中将被删除….注意:debian.tar.{gz,bz2,lzma}里面必须包含一个 debian 目录,它也可以包含二进制文件。<br />
应用补丁:文件 debian/patches/debian.series 或者 debian/patches/series 里面罗列的补丁。补丁必须是 patch -p1 的。补丁也可以删除文件。如果在解压缩过程中应用了某些补丁,那么 debian/patch/.dpkg-source-applied 文件会记录它们。<br />
和 quilt 的默认相似,这里使用补丁也可以删除文件<br />
源代码包的构建:<br />
更新 debian-changes- 补丁:当前目录中所有的源代码包 (orig 包,component 包) 都会解压缩到一个临时目录中,然后 debian 目录也拷贝到这个临时目录最后打上除 debian-changes- 补丁外的所有补丁,比较临时目录和源代码所得补丁(如果不同),会保存为 debian/patches/ 补丁文件,任何二进制文件的变化都不会出现在 diff 中,否则会导致构建失败,除非维护人员决定在 debian 包中包含二进制文件 (相对于源代码目录,在 debian/source/include-binaries 中列出添加或更改的二进制文件的文件名) 如果发现 debian 子目录中有二进制文件,构建也会失败,除非文件名已经在 debian/source/include-binaries 中列出。<br />
更新 debian.tar.{gz,bz2,lzma}:通过更新的 debian 目录和更改过的二进制文件 (列出的) 会重新生成 debian 包<br />
注意:自动生成的 diff 不包含 VCS 描述文件和许多临时文件 (参照 -i 选项) 的变化,例如:quilt 使用的 .pc 目录在生成自动补丁时就会被忽略。<br />
* 七.Format:3.0 (git)<br />
这个源代码格式是实验性质的,也许会在 debian 的下下或者下下下个版本采用,也许永远不会采用……这是源代码包和版本控制系统 (git) 的结合,具体细节请:man dpkg-source。<br />
* 八.Format:3.0 (bzr)<br />
这个源代码格式是实验性质的,也许会在 debian 的下下或者下下下个版本采用,也许永远不会采用………这是源代码包和版本控制系统 (bzr) 的结合,具体细节请:man dpkg-source。<br />
== deb仓库管理 ==<br />
=== 创建配置文件 ===<br />
<pre><br />
cat > conf/distributions << "EOF" <br />
Origin: regulus<br />
Label: regulus<br />
Codename: rongshu <br />
Architectures: i386 amd64 source <br />
Components: main <br />
Version:2012 <br />
Description: linux-regulus 2012<br />
EOF<br />
</pre><br />
<br />
=== 示例 ===<br />
<pre><br />
reprepro includedeb rongshu deb/*.deb<br />
for file in deb/*.dsc; do reprepro includedsc rongshu $file; done<br />
</pre><br />
<br />
=== 仓库地址 ===<br />
<pre><br />
deb file:///localdir/regulus rongshu main<br />
deb http://localhost/regulus rongshu main<br />
</pre></div>
124.205.131.209