|
404.
|
|
|
You will need to adjust the <filename>changelog</filename>slightly in this case to reflect that this package is named <application>hello-debhelper</application> rather than just <application>hello</application>:
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/basic.xml:816(para)
|
|
405.
|
|
|
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
represents a space character.
Enter a space in the equivalent position in the translation.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/basic.xml:822(screen)
|
|
406.
|
|
|
By using <application>debhelper</application>, the only things we need to change in <filename>control</filename> are the name (substituting <application>hello</application> for <application>hello-debhelper</application>) and adding <application>debhelper (>= 4.0.0)</application> to the <emphasis>Build-Depends</emphasis> field for the source package. The <phrase>Ubuntu</phrase> package for <application>hello-debhelper</application> looks like:
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/basic.xml:829(para)
|
|
407.
|
|
|
Source: hello-debhelper
Section: devel
Priority: extra
Maintainer: Capitan Packager <packager@coolness.com>
Standards-Version: 3.6.1
Build-Depends: debhelper (>= 4)
Package: hello-debhelper
Architecture: any
Depends: ${shlibs:Depends}
Conflicts: hello
Provides: hello
Replaces: hello
Description: The classic greeting, and a good example
The GNU hello program produces a familiar, friendly greeting. It
allows non-programmers to use a classic computer science tool which
would otherwise be unavailable to them.
.
Seriously, though: this is an example of how to do a Debian package.
It is the Debian version of the GNU Project's `hello world' program
(which is itself an example for the GNU Project).
.
This is the same as the hello package, except it uses debhelper to
make the deb. Please see debhelper as to what it is.
[tab] [tab]
|
|
|
[tab] represents a tab character.
Please write it exactly the same way, [tab] , in your
translation.
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
represents a space character.
Enter a space in the equivalent position in the translation.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/basic.xml:838(screen)
|
|
408.
|
|
|
We can copy the <filename>copyright</filename> file and the <filename>postinst</filename> and <filename>prerm</filename> scripts from the <phrase>Ubuntu</phrase><application>hello-debhelper</application> package, as they have not changed since <xref linkend="basic-scratch"/>. We will also copy the <filename>rules</filename> file so we can inspect it.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/basic.xml:865(para)
|
|
409.
|
|
|
cp ../../ubuntu/hello-debhelper-2.1.1/debian/copyright .
cp ../../ubuntu/hello-debhelper-2.1.1/debian/postinst .
cp ../../ubuntu/hello-debhelper-2.1.1/debian/prerm .
cp ../../ubuntu/hello-debhelper-2.1.1/debian/rules.
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/basic.xml:873(screen)
|
|
410.
|
|
|
The last file we need to look at is <filename>rules</filename>, where the power of <application>debhelper</application> scripts can be seen. The <application>debhelper</application> version of <filename>rules</filename> is somewhat smaller (54 lines as opposed to 72 lines in the version from <xref linkend="basic-scratch-rules"/>).
|
|
|
|
我们需要检查的最后一个文件是 <filename>rules</filename>,在这里可以看到 <application>debhelper</application> 脚本的威力。<application>debhelper</application> 版本的 <filename>rules</filename> 文件更小(只有54行,而 <xref linkend="basic-scratch-rules"/> 中的版本有72行)。
|
|
Translated and reviewed by
stone_unix
|
|
|
|
Located in
C/basic.xml:879(para)
|
|
411.
|
|
|
The <application>debhelper</application> version looks like:
|
|
|
|
<application>debhelper</application> 版的看起来像这样:
|
|
Translated and reviewed by
stone_unix
|
|
|
|
Located in
C/basic.xml:886(para)
|
|
412.
|
|
|
#!/usr/bin/make -f
package = hello-debhelper
CC = gcc
CFLAGS = -g -Wall
ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O2
endif
#export DH_VERBOSE=1
clean:
dh_testdir
dh_clean
rm -f build
-$(MAKE) -i distclean
install: build
dh_clean
dh_installdirs
$(MAKE) prefix=$(CURDIR)/debian/$(package)/usr \
mandir=$(CURDIR)/debian/$(package)/usr/share/man \
infodir=$(CURDIR)/debian/$(package)/usr/share/info \
install
build:
./configure --prefix=/usr
$(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)"
touch build
binary-indep: install
# There are no architecture-independent files to be uploaded
# generated by this package. If there were any they would be
# made here.
binary-arch: install
dh_testdir -a
dh_testroot -a
dh_installdocs -a NEWS
dh_installchangelogs -a ChangeLog
dh_strip -a
dh_compress -a
dh_fixperms -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: binary binary-arch binary-indep clean checkroot
[tab] [tab] [tab]
|
|
|
[tab] represents a tab character.
Please write it exactly the same way, [tab] , in your
translation.
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
represents a space character.
Enter a space in the equivalent position in the translation.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/basic.xml:888(screen)
|
|
413.
|
|
|
Notice that tasks like testing if you are in the right directory (<application>dh_testdir</application>), making sure you are building the package with root privileges (<application>dh_testroot</application>), installing documentation (<application>dh_installdocs</application> and <application>dh_installchangelogs</application>), and cleaning up after the build (<application>dh_clean</application>) are handled automatically. Many packages much more complicated than <application>hello</application> have <filename>rules</filename> files no bigger because the <application>debhelper</application> scripts handle most of the tasks. For a complete list of <application>debhelper</application> scripts, please see <xref linkend="appendix-debhelper"/>. They are also well documented in their respective <application>man</application> pages. It is a useful exercise to read the man page (they are well written and not lengthy) for each helper script used in the above <filename>rules</filename> file.
|
|
|
|
请注意测试你的任务是不是在正确的目录(<application>dh_testdir</application>),确定你是在root权限下打包 (<application>dh_testroot</application>), 安装的目录 (<application>dh_installdocs</application> 和<application>dh_installchangelogs</application>), 并且在任务完成后自动清空(<application>dh_clean</application>). Many packages much more complicated than <application>hello</application> have <filename>rules</filename> files no bigger because the <application>debhelper</application> scripts handle most of the tasks. For a complete list of <application>debhelper</application> scripts, please see <xref linkend="appendix-debhelper"/>. They are also well documented in their respective <application>man</application> pages. It is a useful exercise to read the man page (they are well written and not lengthy) for each helper script used in the above <filename>rules</filename> file.
|
|
Translated by
ctqucl
|
|
Reviewed by
stone_unix
|
|
|
|
Located in
C/basic.xml:944(para)
|