Let's move to talk about the target responsible for installing procedures, named install. Here it is how install target looks like:


install: build 
dh_clean -k 

Add here commands to install the package into debian/foo.
$(MAKE) DESTDIR=$(CURDIR)/debian/foo install 

Install target depends on build target, explained above. Let's get closer to the commands listed in the previous example:


dh_clean -k

In this case, dh_clean specifies the -k option, that prevent debian/dirs file to get deleted. This is necessary to be used anytime you have a debian/rules that has 2 binary targets that build different .deb packages. (e.g packaging libraries, one build target packages the shared libraries, other one -dev package.)



This command (part of debhelper) perform the creation of subdirectories in package build directories.


Note: dh_destdir and dh_testroot are explained above.


After executing this commands, the developer will be free to add any other command to install the package after the specified comment:


Add here commands to install the package into debian/foo.

In our case, by default is specified that the package will be installed inside debian/foo, taking foo as the name of the package we are creating. It will make install all files previously configured by the configure/config.status target and compiled by the build target into DESTDIR variable, that can be modified by the developer to suit his needs. Like the clean target, the folder that contains sources files need to be specified not using the local uri, e.g /home/bar/foo/debian/foo but using the $(CURDIR) variable, recognized universally by build systems like pbuilder.


Install target allows the developer to launch debhelper's scripts that will install and place every file in the correct location. I suggest you to check debhelper or dh_- scripts man page available by running man command in a terminal followed by man page section (1-8) and application name (e.g man 1 dh_-).

installターゲットでは、すべてのファイルを正しい場所にインストールするためにdebhelperスクリプトを使うことができます。debhelperやdh_-スクリプトのmanページを確認することを提案します。端末でmanページのセクション番号とアプリケーションの名前を指定して実行することで、閲覧できます(例、man 1 dh_-)。






UbuntuJapaneseWiki: UbuntuPackagingGuideJa/ch04s06 (最終更新日時 2012-01-10 11:49:20 更新者 匿名)