Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 52.44 KB | None | 0 0
  1. Better to know this:
  2.  
  3. 1. Compiling
  4. 2. Linking
  5. 3. Building
  6.  
  7. Compiling:
  8.  
  9. Compiling is the act of turning source code into object code.
  10.  
  11. Linking is the act of combining object code with libraries into a raw executable.
  12.  
  13. Building is the sequence composed of compiling and linking, with possibly other tasks such as installer creation.
  14.  
  15. Many compilers handle the linking step automatically after compiling source code
  16.  
  17. So we want to learn today the 3rd part - Building or in easier terms "how to build the .DEB packages""
  18.  
  19.  
  20.  
  21. Let's start with Hello World tarball. Say, I have Hello world pre-compiled source code and now I want to build DEB Package out of it.
  22.  
  23. http://santi-bassett.blogspot.in/2014/07/how-to-create-debian-package.html
  24.  
  25.  
  26. 1. Download Hello World pre-compiled source code:
  27.  
  28.  
  29. root@dell-virtual-machine:~# wget http://ftp.gnu.org/gnu/hello/hello-2.1.0.tar.gz
  30. --2015-10-29 23:22:31-- http://ftp.gnu.org/gnu/hello/hello-2.1.0.tar.gz
  31. Connecting to 10.116.2.242:80... connected.
  32. Proxy request sent, awaiting response... 200 OK
  33. Length: 389049 (380K) [application/x-gzip]
  34. Saving to: ‘hello-2.1.0.tar.gz’
  35.  
  36. 100%[======================================>] 389,049 185KB/s in 2.0s
  37.  
  38. 2015-10-29 23:22:34 (185 KB/s) - ‘hello-2.1.0.tar.gz’ saved [389049/389049]
  39.  
  40.  
  41. 1. The package creation process:
  42.  
  43. There are several tools involved in this process, used to build, check and sign the package. Debuild is a wrapper that will call them appropriately, so we don't need to do it manually. Here is a brief description of the tools it invokes:
  44.  
  45. dpkg-buildpackage: It creates a temporary directory with the package files, building later the .deb package with its content. To work properly, it heavily relies on the files in the special debian subdirectory: control, rules, changelog, etc.
  46.  
  47.  
  48. lintian: Dissects Debian packages trying to find bugs or policy violations.
  49. debsign: Signs packages (.dsc and .changes files) using GPG or PGP.
  50.  
  51. 2. Installing necessary software to build our packages:
  52.  
  53. root@dell-virtual-machine:~# apt-get install dh-make build-essential
  54. Reading package lists... Done
  55. Building dependency tree
  56. Reading state information... Done
  57. build-essential is already the newest version.
  58. dh-make is already the newest version.
  59. dh-make set to manually installed.
  60. 0 upgraded, 0 newly installed, 0 to remove and 135 not upgraded.
  61.  
  62. root@dell-virtual-machine:~# apt-get install devscripts fakeroot debootstrap pbuilder
  63. Reading package lists... Done
  64. Building dependency tree
  65. Reading state information... Done
  66. fakeroot is already the newest version.
  67. debootstrap is already the newest version.
  68. debootstrap set to manually installed.
  69. devscripts is already the newest version.
  70. devscripts set to manually installed.
  71. pbuilder is already the newest version.
  72. 0 upgraded, 0 newly installed, 0 to remove and 135 not upgraded.
  73.  
  74. 3. Setting up Environmental Variables:
  75.  
  76. root@dell-virtual-machine:~# export DEBEMAIL="Ajeet_Raina@dell.com"
  77. root@dell-virtual-machine:~# export DEBFULLNAME="Ajeet"
  78.  
  79.  
  80. 4. Uncompressing our source code (format of the tar.gz file is software-version.tar.gz)
  81. In my case, for the purpose of this little how-to, I will build the Debian package for a simple "hello world" program written in C.
  82.  
  83. root@dell-virtual-machine:~# tar xvfz hello-2.1.0.tar.gz
  84. hello-2.1.0/
  85. hello-2.1.0/intl/
  86. hello-2.1.0/intl/ChangeLog
  87. hello-2.1.0/intl/Makefile.in
  88. hello-2.1.0/intl/config.charset
  89. hello-2.1.0/intl/locale.alias
  90. hello-2.1.0/intl/ref-add.sin
  91. hello-2.1.0/intl/ref-del.sin
  92. hello-2.1.0/intl/gmo.h
  93. hello-2.1.0/intl/gettextP.h
  94. hello-2.1.0/intl/hash-string.h
  95. hello-2.1.0/intl/plural-exp.h
  96. hello-2.1.0/intl/eval-plural.h
  97. hello-2.1.0/intl/os2compat.h
  98. hello-2.1.0/intl/libgnuintl.h
  99. hello-2.1.0/intl/loadinfo.h
  100. hello-2.1.0/intl/bindtextdom.c
  101. hello-2.1.0/intl/dcgettext.c
  102. hello-2.1.0/intl/dgettext.c
  103. hello-2.1.0/intl/gettext.c
  104. hello-2.1.0/intl/finddomain.c
  105. hello-2.1.0/intl/loadmsgcat.c
  106. hello-2.1.0/intl/localealias.c
  107. hello-2.1.0/intl/textdomain.c
  108. hello-2.1.0/intl/l10nflist.c
  109. hello-2.1.0/intl/explodename.c
  110. hello-2.1.0/intl/dcigettext.c
  111. hello-2.1.0/intl/dcngettext.c
  112. hello-2.1.0/intl/dngettext.c
  113. hello-2.1.0/intl/ngettext.c
  114. hello-2.1.0/intl/plural.y
  115. hello-2.1.0/intl/plural-exp.c
  116. hello-2.1.0/intl/localcharset.c
  117. hello-2.1.0/intl/localename.c
  118. hello-2.1.0/intl/osdep.c
  119. hello-2.1.0/intl/os2compat.c
  120. hello-2.1.0/intl/intl-compat.c
  121. hello-2.1.0/intl/plural.c
  122. hello-2.1.0/intl/VERSION
  123. hello-2.1.0/po/
  124. hello-2.1.0/po/Makefile.in.in
  125. hello-2.1.0/po/Makevars
  126. hello-2.1.0/po/remove-potcdate.sin
  127. hello-2.1.0/po/quot.sed
  128. hello-2.1.0/po/boldquot.sed
  129. hello-2.1.0/po/en@quot.header
  130. hello-2.1.0/po/en@boldquot.header
  131. hello-2.1.0/po/insert-header.sin
  132. hello-2.1.0/po/Rules-quot
  133. hello-2.1.0/po/POTFILES.in
  134. hello-2.1.0/po/hello.pot
  135. hello-2.1.0/po/ca.po
  136. hello-2.1.0/po/da.po
  137. hello-2.1.0/po/de.po
  138. hello-2.1.0/po/de_DE.po
  139. hello-2.1.0/po/el.po
  140. hello-2.1.0/po/eo.po
  141. hello-2.1.0/po/es.po
  142. hello-2.1.0/po/et.po
  143. hello-2.1.0/po/fi.po
  144. hello-2.1.0/po/fr.po
  145. hello-2.1.0/po/gl.po
  146. hello-2.1.0/po/he.po
  147. hello-2.1.0/po/hr.po
  148. hello-2.1.0/po/hu.po
  149. hello-2.1.0/po/id.po
  150. hello-2.1.0/po/it.po
  151. hello-2.1.0/po/ja.po
  152. hello-2.1.0/po/ko.po
  153. hello-2.1.0/po/lv.po
  154. hello-2.1.0/po/nb.po
  155. hello-2.1.0/po/nl.po
  156. hello-2.1.0/po/nn.po
  157. hello-2.1.0/po/pl.po
  158. hello-2.1.0/po/pt.po
  159. hello-2.1.0/po/pt_BR.po
  160. hello-2.1.0/po/ru.po
  161. hello-2.1.0/po/sk.po
  162. hello-2.1.0/po/sl.po
  163. hello-2.1.0/po/sv.po
  164. hello-2.1.0/po/tr.po
  165. hello-2.1.0/po/uk.po
  166. hello-2.1.0/po/ca.gmo
  167. hello-2.1.0/po/da.gmo
  168. hello-2.1.0/po/de.gmo
  169. hello-2.1.0/po/de_DE.gmo
  170. hello-2.1.0/po/el.gmo
  171. hello-2.1.0/po/eo.gmo
  172. hello-2.1.0/po/es.gmo
  173. hello-2.1.0/po/et.gmo
  174. hello-2.1.0/po/fi.gmo
  175. hello-2.1.0/po/fr.gmo
  176. hello-2.1.0/po/gl.gmo
  177. hello-2.1.0/po/he.gmo
  178. hello-2.1.0/po/hr.gmo
  179. hello-2.1.0/po/hu.gmo
  180. hello-2.1.0/po/id.gmo
  181. hello-2.1.0/po/it.gmo
  182. hello-2.1.0/po/ja.gmo
  183. hello-2.1.0/po/ko.gmo
  184. hello-2.1.0/po/lv.gmo
  185. hello-2.1.0/po/nb.gmo
  186. hello-2.1.0/po/nl.gmo
  187. hello-2.1.0/po/nn.gmo
  188. hello-2.1.0/po/pl.gmo
  189. hello-2.1.0/po/pt.gmo
  190. hello-2.1.0/po/pt_BR.gmo
  191. hello-2.1.0/po/ru.gmo
  192. hello-2.1.0/po/sk.gmo
  193. hello-2.1.0/po/sl.gmo
  194. hello-2.1.0/po/sv.gmo
  195. hello-2.1.0/po/tr.gmo
  196. hello-2.1.0/po/uk.gmo
  197. hello-2.1.0/po/ChangeLog
  198. hello-2.1.0/po/LINGUAS
  199. hello-2.1.0/README
  200. hello-2.1.0/ABOUT-NLS
  201. hello-2.1.0/AUTHORS
  202. hello-2.1.0/COPYING
  203. hello-2.1.0/ChangeLog
  204. hello-2.1.0/INSTALL
  205. hello-2.1.0/Makefile.am
  206. hello-2.1.0/Makefile.in
  207. hello-2.1.0/NEWS
  208. hello-2.1.0/THANKS
  209. hello-2.1.0/TODO
  210. hello-2.1.0/aclocal.m4
  211. hello-2.1.0/config.guess
  212. hello-2.1.0/config.h.in
  213. hello-2.1.0/config.rpath
  214. hello-2.1.0/config.sub
  215. hello-2.1.0/configure
  216. hello-2.1.0/configure.ac
  217. hello-2.1.0/depcomp
  218. hello-2.1.0/install-sh
  219. hello-2.1.0/missing
  220. hello-2.1.0/mkinstalldirs
  221. hello-2.1.0/BUGS
  222. hello-2.1.0/ChangeLog.O
  223. hello-2.1.0/contrib/
  224. hello-2.1.0/contrib/ChangeLog
  225. hello-2.1.0/contrib/Makefile.am
  226. hello-2.1.0/contrib/Makefile.in
  227. hello-2.1.0/contrib/de_franconian_po.txt
  228. hello-2.1.0/contrib/evolution.txt
  229. hello-2.1.0/contrib/hello.1
  230. hello-2.1.0/doc/
  231. hello-2.1.0/doc/gpl.texi
  232. hello-2.1.0/doc/ChangeLog
  233. hello-2.1.0/doc/Makefile.am
  234. hello-2.1.0/doc/Makefile.in
  235. hello-2.1.0/doc/mdate-sh
  236. hello-2.1.0/doc/stamp-vti
  237. hello-2.1.0/doc/texinfo.tex
  238. hello-2.1.0/doc/version.texi
  239. hello-2.1.0/doc/hello.texi
  240. hello-2.1.0/doc/hello.info
  241. hello-2.1.0/src/
  242. hello-2.1.0/src/ChangeLog
  243. hello-2.1.0/src/Makefile.am
  244. hello-2.1.0/src/Makefile.in
  245. hello-2.1.0/src/alloca.c
  246. hello-2.1.0/src/hello.c
  247. hello-2.1.0/src/version.c
  248. hello-2.1.0/src/getopt.c
  249. hello-2.1.0/src/getopt1.c
  250. hello-2.1.0/src/getopt.h
  251. hello-2.1.0/src/system.h
  252. hello-2.1.0/man/
  253. hello-2.1.0/man/ChangeLog
  254. hello-2.1.0/man/Makefile.am
  255. hello-2.1.0/man/Makefile.in
  256. hello-2.1.0/man/hello.1
  257. hello-2.1.0/man/help2man
  258. hello-2.1.0/m4/
  259. hello-2.1.0/m4/README
  260. hello-2.1.0/m4/ChangeLog
  261. hello-2.1.0/m4/Makefile.am
  262. hello-2.1.0/m4/Makefile.in
  263. hello-2.1.0/m4/codeset.m4
  264. hello-2.1.0/m4/gettext.m4
  265. hello-2.1.0/m4/glibc21.m4
  266. hello-2.1.0/m4/iconv.m4
  267. hello-2.1.0/m4/isc-posix.m4
  268. hello-2.1.0/m4/lcmessage.m4
  269. hello-2.1.0/m4/lib-ld.m4
  270. hello-2.1.0/m4/lib-link.m4
  271. hello-2.1.0/m4/lib-prefix.m4
  272. hello-2.1.0/m4/progtest.m4
  273. hello-2.1.0/tests/
  274. hello-2.1.0/tests/ChangeLog
  275. hello-2.1.0/tests/Makefile.am
  276. hello-2.1.0/tests/Makefile.in
  277. hello-2.1.0/tests/hello-1
  278. hello-2.1.0/tests/world-1
  279. hello-2.1.0/tests/nothing-1
  280.  
  281.  
  282. 5. Change directory to hello-2.1.0
  283.  
  284. root@dell-virtual-machine:~# cd hello-2.1.0
  285.  
  286. 6. Displaying the contents of the files and driectories
  287.  
  288.  
  289. root@dell-virtual-machine:~/hello-2.1.0# ls
  290. ABOUT-NLS config.guess contrib intl mkinstalldirs THANKS
  291. aclocal.m4 config.h.in COPYING m4 NEWS TODO
  292. AUTHORS config.rpath depcomp Makefile.am po
  293. BUGS config.sub doc Makefile.in README
  294. ChangeLog configure INSTALL man src
  295. ChangeLog.O configure.ac install-sh missing tests
  296.  
  297. root@dell-virtual-machine:~/hello-2.1.0# ls -la
  298. total 632
  299. drwxrwxrwx 10 270 users 4096 May 29 2002 .
  300. drwx------ 11 root root 4096 Oct 29 23:23 ..
  301. -rw-r--r-- 1 270 users 22132 May 22 2002 ABOUT-NLS
  302. -rw-r--r-- 1 270 users 93990 May 25 2002 aclocal.m4
  303. -rw-r--r-- 1 270 users 401 Jun 2 2001 AUTHORS
  304. -rw-r--r-- 1 270 users 71 Jun 2 2001 BUGS
  305. -rw-r--r-- 1 270 users 17760 May 25 2002 ChangeLog
  306. -rw-r--r-- 1 270 users 5605 Jun 2 2001 ChangeLog.O
  307. -rwxr-xr-x 1 270 users 38657 May 22 2002 config.guess
  308. -rw-r--r-- 1 270 users 5869 May 25 2002 config.h.in
  309. -rwxr-xr-x 1 270 users 14108 May 22 2002 config.rpath
  310. -rwxr-xr-x 1 270 users 28962 May 22 2002 config.sub
  311. -rwxr-xr-x 1 270 users 235695 May 25 2002 configure
  312. -rw-r--r-- 1 270 users 1671 May 25 2002 configure.ac
  313. drwxrwxrwx 2 270 users 4096 May 29 2002 contrib
  314. -rw-r--r-- 1 270 users 17992 May 22 2002 COPYING
  315. -rwxr-xr-x 1 270 users 12509 May 22 2002 depcomp
  316. drwxrwxrwx 2 270 users 4096 May 29 2002 doc
  317. -rw-r--r-- 1 270 users 9414 May 22 2002 INSTALL
  318. -rwxr-xr-x 1 270 users 5561 May 22 2002 install-sh
  319. drwxrwxrwx 2 270 users 4096 May 29 2002 intl
  320. drwxrwxrwx 2 270 users 4096 May 29 2002 m4
  321. -rw-r--r-- 1 270 users 2497 May 25 2002 Makefile.am
  322. -rw-r--r-- 1 270 users 15892 May 25 2002 Makefile.in
  323. drwxrwxrwx 2 270 users 4096 May 29 2002 man
  324. -rwxr-xr-x 1 270 users 10280 May 22 2002 missing
  325. -rwxr-xr-x 1 270 users 1858 May 22 2002 mkinstalldirs
  326. -rw-r--r-- 1 270 users 1999 May 25 2002 NEWS
  327. drwxrwxrwx 2 270 users 4096 May 29 2002 po
  328. -rw-r--r-- 1 270 users 777 May 25 2002 README
  329. drwxrwxrwx 2 270 users 4096 May 29 2002 src
  330. drwxrwxrwx 2 270 users 4096 May 29 2002 tests
  331. -rw-r--r-- 1 270 users 765 May 22 2002 THANKS
  332. -rw-r--r-- 1 270 users 1470 Jun 2 2001 TODO
  333. root@dell-virtual-machine:~/hello-2.1.0# vi Makefile.
  334. root@dell-virtual-machine:~/hello-2.1.0# vi Makefile.
  335. Makefile.am Makefile.in
  336. root@dell-virtual-machine:~/hello-2.1.0# vi Makefile.
  337. Makefile.am Makefile.in
  338. root@dell-virtual-machine:~/hello-2.1.0# vi Makefile.am
  339.  
  340.  
  341. There are a two interesting things that we can see in our Makefile:
  342.  
  343. It uses DESTDIR variable to support the DESTDIR convention.
  344. Dpkg-buildflags is used to get C compiler options (CFLAGS) as well as linker options (LDFLAGS). This complies with the hardening requirements described in Debian documentation.
  345. On the other hand, if your software has any external dependencies, you would need to install those, so you can compile it successfully. Typically you would be able to install them using apt-get.
  346.  
  347. 6. Building the Debian files skeleton
  348.  
  349. root@dell-virtual-machine:~/hello-2.1.0# dh_make -f ../hello-2.1.0.tar.gz
  350.  
  351. Type of package: single binary, indep binary, multiple binary, library, kernel module, kernel patch?
  352. [s/i/m/l/k/n] s
  353.  
  354. Maintainer name : Ajeet
  355. Email-Address : Ajeet_Raina@dell.com
  356. Date : Thu, 29 Oct 2015 23:24:22 -0400
  357. Package Name : hello
  358. Version : 2.1.0
  359. License : blank
  360. Type of Package : Single
  361. Hit <enter> to confirm:
  362. Done. Please edit the files in the debian/ subdirectory now. hello
  363. uses a configure script, so you probably don't have to edit the Makefiles.
  364. root@dell-virtual-machine:~/hello-2.1.0# ls
  365. ABOUT-NLS config.guess contrib install-sh missing tests
  366. aclocal.m4 config.h.in COPYING intl mkinstalldirs THANKS
  367. AUTHORS config.rpath debian m4 NEWS TODO
  368. BUGS config.sub depcomp Makefile.am po
  369. ChangeLog configure doc Makefile.in README
  370. ChangeLog.O configure.ac INSTALL man src
  371. root@dell-virtual-machine:~/hello-2.1.0# cd ..
  372. root@dell-virtual-machine:~# ls
  373. Desktop hello-2.1.0 hello_2.1.0.orig.tar.gz hello-2.1.0.tar.gz test123
  374. root@dell-virtual-machine:~# cd -
  375. /root/hello-2.1.0
  376. root@dell-virtual-machine:~/hello-2.1.0# ls
  377. ABOUT-NLS config.guess contrib install-sh missing tests
  378. aclocal.m4 config.h.in COPYING intl mkinstalldirs THANKS
  379. AUTHORS config.rpath debian m4 NEWS TODO
  380. BUGS config.sub depcomp Makefile.am po
  381. ChangeLog configure doc Makefile.in README
  382. ChangeLog.O configure.ac INSTALL man src
  383. root@dell-virtual-machine:~/hello-2.1.0# cd debian/
  384. root@dell-virtual-machine:~/hello-2.1.0/debian# ls
  385. changelog hello.cron.d.ex manpage.1.ex postrm.ex rules
  386. compat hello.default.ex manpage.sgml.ex preinst.ex source
  387. control hello.doc-base.EX manpage.xml.ex prerm.ex watch.ex
  388. copyright info menu.ex README.Debian
  389. docs init.d.ex postinst.ex README.source
  390. root@dell-virtual-machine:~/hello-2.1.0/debian# ls -la
  391. total 116
  392. drwxr-xr-x 3 root root 4096 Oct 29 23:24 .
  393. drwxrwxrwx 11 270 users 4096 Oct 29 23:24 ..
  394. -rw-r--r-- 1 root root 180 Oct 29 23:24 changelog
  395. -rw-r--r-- 1 root root 2 Oct 29 23:24 compat
  396. -rw-r--r-- 1 root root 518 Oct 29 23:24 control
  397. -rw-r--r-- 1 root root 1666 Oct 29 23:24 copyright
  398. -rw-r--r-- 1 root root 34 Oct 29 23:24 docs
  399. -rw-r--r-- 1 root root 125 Oct 29 23:24 hello.cron.d.ex
  400. -rw-r--r-- 1 root root 229 Oct 29 23:24 hello.default.ex
  401. -rw-r--r-- 1 root root 493 Oct 29 23:24 hello.doc-base.EX
  402. -rw-r--r-- 1 root root 15 Oct 29 23:24 info
  403. -rw-r--r-- 1 root root 4574 Oct 29 23:24 init.d.ex
  404. -rw-r--r-- 1 root root 1620 Oct 29 23:24 manpage.1.ex
  405. -rw-r--r-- 1 root root 4646 Oct 29 23:24 manpage.sgml.ex
  406. -rw-r--r-- 1 root root 10999 Oct 29 23:24 manpage.xml.ex
  407. -rw-r--r-- 1 root root 120 Oct 29 23:24 menu.ex
  408. -rw-r--r-- 1 root root 955 Oct 29 23:24 postinst.ex
  409. -rw-r--r-- 1 root root 928 Oct 29 23:24 postrm.ex
  410. -rw-r--r-- 1 root root 688 Oct 29 23:24 preinst.ex
  411. -rw-r--r-- 1 root root 875 Oct 29 23:24 prerm.ex
  412. -rw-r--r-- 1 root root 170 Oct 29 23:24 README.Debian
  413. -rw-r--r-- 1 root root 255 Oct 29 23:24 README.source
  414. -rwxr-xr-x 1 root root 135 Oct 29 23:24 rules
  415. drwxr-xr-x 2 root root 4096 Oct 29 23:24 source
  416. -rw-r--r-- 1 root root 769 Oct 29 23:24 watch.ex
  417.  
  418.  
  419. As we only want to build a single binary package, I chose that option. Multiple binary package option would in fact, build multiple .deb packages.
  420.  
  421. Now we have a new directory, called "debian", with all the necessary Debian files that we need to build our package, including examples. This includes important files like:
  422.  
  423. control: includes meta data about the package
  424. rules: specifies how the package is going to be built
  425. changelog: history of the debian package
  426. copyright: copyright information
  427. As well, some other example files are created by dh_make, that we won't use at this point and can be deleted safely.
  428.  
  429. Control FILE:
  430.  
  431. The control file has two sections, the first part refers to the source package and the second to the binary one. More information about the different fields can be found in deb-control manual page.
  432.  
  433.  
  434.  
  435. root@dell-virtual-machine:~/hello-2.1.0/debian# vi control
  436.  
  437. Source: hello
  438. Section: unknown
  439. Priority: optional
  440. Maintainer: Ajeet <Ajeet_Raina@dell.com>
  441. Build-Depends: debhelper (>= 8.0.0), autotools-dev
  442. Standards-Version: 3.9.4
  443. Homepage: <insert the upstream URL, if relevant>
  444. #Vcs-Git: git://git.debian.org/collab-maint/hello.git
  445. #Vcs-Browser: http://git.debian.org/?p=collab-maint/hello.git;a=summary
  446.  
  447. Package: hello
  448. Architecture: any
  449. Depends: ${shlibs:Depends}, ${misc:Depends}
  450. Description: <insert up to 60 chars description>
  451. <insert long description, indented with spaces>
  452.  
  453. The variable ${shlibs:Depends} will be substituted by the shared library dependencies needed to build our binary package. Those are calculated automatically by dh_shlibdeps, one of the tools of the debhelper suite.
  454.  
  455.  
  456. root@dell-virtual-machine:~/hello-2.1.0/debian# rm -f *.e *.EX README.*
  457. root@dell-virtual-machine:~/hello-2.1.0/debian# ls
  458. changelog docs init.d.ex menu.ex prerm.ex
  459. compat hello.cron.d.ex manpage.1.ex postinst.ex rules
  460. control hello.default.ex manpage.sgml.ex postrm.ex source
  461. copyright info manpage.xml.ex preinst.ex watch.ex
  462.  
  463.  
  464.  
  465. root@dell-virtual-machine:~/hello-2.1.0/debian# vi rules
  466. root@dell-virtual-machine:~/hello-2.1.0/debian# vi control
  467.  
  468. Changelog:
  469.  
  470. hello (2.1.0-1ubuntu1) UNRELEASED; urgency=medium
  471.  
  472. *
  473.  
  474. -- Ajeet S Raina <Ajeet_Raina@dell.com> Thu, 29 Oct 2015 23:27:20 -0400
  475.  
  476. hello (2.1.0-1) unstable; urgency=low
  477.  
  478. * Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>
  479.  
  480. -- Ajeet <Ajeet_Raina@dell.com> Thu, 29 Oct 2015 23:24:22 -0400
  481.  
  482.  
  483. ITP stands for Intend to Package and, for our package to be included in a Debian distribution, the changelog file should close an existing bug. For our example we closed bug #100, this way we won't see lintian warnings requiring for this number later.
  484.  
  485. Note: We can use "dch -i" command to edit our changelog file.
  486.  
  487.  
  488. root@dell-virtual-machine:~/hello-2.1.0/debian# cat changelog
  489. hello (2.1.0-1) unstable; urgency=low
  490.  
  491. * Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>
  492.  
  493. -- Ajeet <Ajeet_Raina@dell.com> Thu, 29 Oct 2015 23:24:22 -0400
  494. root@dell-virtual-machine:~/hello-2.1.0/debian# dch -i
  495. Addijg
  496. Select an editor. To change later, run 'select-editor'.
  497. 1. /bin/ed
  498. 2. /bin/nano <---- easiest
  499. 3. /usr/bin/vim.tiny
  500.  
  501. Choose 1-3 2
  502. Choose 1-3 [2]:
  503. root@dell-virtual-machine:~/hello-2.1.0/debian# cat changelog
  504. hello (2.1.0-1ubuntu1) UNRELEASED; urgency=medium
  505.  
  506. *
  507.  
  508. -- Ajeet S Raina <Ajeet_Raina@dell.com> Thu, 29 Oct 2015 23:27:20 -0400
  509.  
  510. hello (2.1.0-1) unstable; urgency=low
  511.  
  512. * Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>
  513.  
  514. -- Ajeet <Ajeet_Raina@dell.com> Thu, 29 Oct 2015 23:24:22 -0400
  515. root@dell-virtual-machine:~/hello-2.1.0/debian# cat copyright
  516. Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
  517. Upstream-Name: hello
  518. Source: <url://example.com>
  519.  
  520. Files: *
  521. Copyright: <years> <put author's name and email here>
  522. <years> <likewise for another author>
  523. License: <special license>
  524. <Put the license of the package here indented by 1 space>
  525. <This follows the format of Description: lines in control file>
  526. .
  527. <Including paragraphs>
  528.  
  529. # If you want to use GPL v2 or later for the /debian/* files use
  530. # the following clauses, or change it to suit. Delete these two lines
  531. Files: debian/*
  532. Copyright: 2015 Ajeet <Ajeet_Raina@dell.com>
  533. License: GPL-2+
  534. This package is free software; you can redistribute it and/or modify
  535. it under the terms of the GNU General Public License as published by
  536. the Free Software Foundation; either version 2 of the License, or
  537. (at your option) any later version.
  538. .
  539. This package is distributed in the hope that it will be useful,
  540. but WITHOUT ANY WARRANTY; without even the implied warranty of
  541. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  542. GNU General Public License for more details.
  543. .
  544. You should have received a copy of the GNU General Public License
  545. along with this program. If not, see <http://www.gnu.org/licenses/>
  546. .
  547. On Debian systems, the complete text of the GNU General
  548. Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
  549.  
  550. # Please also look if there are files or directories which have a
  551. # different copyright/license attached and list them here.
  552. # Please avoid to pick license terms that are more restrictive than the
  553. # packaged work, as it may make Debian's contributions unacceptable upstream.
  554. root@dell-virtual-machine:~/hello-2.1.0/debian# q!
  555. q!: command not found
  556. root@dell-virtual-machine:~/hello-2.1.0/debian# cd ..
  557.  
  558.  
  559. Rules files:
  560.  
  561. Rules file
  562. The rules file invokes the original software Makefile script, as well as the debhelper suite of tools (with the prefix "dh_). These tools handle different tasks, including the creation of the .deb file (dh_builddeb).
  563.  
  564. #!/usr/bin/make -f
  565. # -*- makefile -*-
  566.  
  567. # Uncomment this to turn on verbose mode.
  568. #export DH_VERBOSE=1
  569.  
  570. %:
  571. dh $@ --with autotools-dev
  572.  
  573. The rules file can be run with different targets: clean (invokes make clean), build (invokes make) and binary (invokes make install). Usage of fakeroot command is recommended so you don't need to build your packages as root
  574.  
  575. root@dell-virtual-machine:~/hello-2.1.0# fakeroot debian/rules clean
  576. dh clean --with autotools-dev
  577. dh_testdir
  578. dh_auto_clean
  579. dh_autotools-dev_restoreconfig
  580. dh_clean
  581. root@dell-virtual-machine:~/hello-2.1.0# fakeroot debian/rules build
  582. dh build --with autotools-dev
  583. dh_testdir
  584. dh_autotools-dev_updateconfig
  585. dh_auto_configure
  586. checking for a BSD-compatible install... /usr/bin/install -c
  587. checking whether build environment is sane... yes
  588. checking for gawk... no
  589. checking for mawk... mawk
  590. checking whether make sets ${MAKE}... yes
  591. checking for gcc... gcc
  592. checking for C compiler default output... a.out
  593. checking whether the C compiler works... yes
  594. checking whether we are cross compiling... no
  595. checking for suffix of executables...
  596. checking for suffix of object files... o
  597. checking whether we are using the GNU C compiler... yes
  598. checking whether gcc accepts -g... yes
  599. checking for style of include used by make... GNU
  600. checking dependency style of gcc... none
  601. checking for strerror in -lcposix... no
  602. checking how to run the C preprocessor... gcc -E
  603. checking for ANSI C header files... yes
  604. checking for sys/types.h... yes
  605. checking for sys/stat.h... yes
  606. checking for stdlib.h... yes
  607. checking for string.h... yes
  608. checking for memory.h... yes
  609. checking for strings.h... yes
  610. checking for inttypes.h... yes
  611. checking for stdint.h... yes
  612. checking for unistd.h... yes
  613. checking for string.h... (cached) yes
  614. checking fcntl.h usability... yes
  615. checking fcntl.h presence... yes
  616. checking for fcntl.h... yes
  617. checking sys/file.h usability... yes
  618. checking sys/file.h presence... yes
  619. checking for sys/file.h... yes
  620. checking sys/param.h usability... yes
  621. checking sys/param.h presence... yes
  622. checking for sys/param.h... yes
  623. checking for working alloca.h... yes
  624. checking for alloca... yes
  625. checking for struct stat.st_blksize... yes
  626. checking for msgfmt... /usr/bin/msgfmt
  627. checking for gmsgfmt... /usr/bin/msgfmt
  628. checking for xgettext... /usr/bin/xgettext
  629. checking for msgmerge... /usr/bin/msgmerge
  630. checking build system type... x86_64-pc-linux-gnu
  631. checking host system type... x86_64-pc-linux-gnu
  632. checking for ranlib... ranlib
  633. checking for gcc option to accept ANSI C... none needed
  634. checking for an ANSI C-conforming const... yes
  635. checking for inline... inline
  636. checking for off_t... yes
  637. checking for size_t... yes
  638. checking for stdlib.h... (cached) yes
  639. checking for unistd.h... (cached) yes
  640. checking for getpagesize... yes
  641. checking for working mmap... yes
  642. checking whether we are using the GNU C Library 2.1 or newer... yes
  643. checking for ld used by GCC... /usr/bin/ld
  644. checking if the linker (/usr/bin/ld) is GNU ld... yes
  645. checking for shared library run path origin... done
  646. checking for iconv... yes
  647. checking argz.h usability... yes
  648. checking argz.h presence... yes
  649. checking for argz.h... yes
  650. checking limits.h usability... yes
  651. checking limits.h presence... yes
  652. checking for limits.h... yes
  653. checking locale.h usability... yes
  654. checking locale.h presence... yes
  655. checking for locale.h... yes
  656. checking nl_types.h usability... yes
  657. checking nl_types.h presence... yes
  658. checking for nl_types.h... yes
  659. checking malloc.h usability... yes
  660. checking malloc.h presence... yes
  661. checking for malloc.h... yes
  662. checking stddef.h usability... yes
  663. checking stddef.h presence... yes
  664. checking for stddef.h... yes
  665. checking for stdlib.h... (cached) yes
  666. checking for string.h... (cached) yes
  667. checking for unistd.h... (cached) yes
  668. checking for sys/param.h... (cached) yes
  669. checking for feof_unlocked... yes
  670. checking for fgets_unlocked... yes
  671. checking for getc_unlocked... yes
  672. checking for getcwd... yes
  673. checking for getegid... yes
  674. checking for geteuid... yes
  675. checking for getgid... yes
  676. checking for getuid... yes
  677. checking for mempcpy... yes
  678. checking for munmap... yes
  679. checking for putenv... yes
  680. checking for setenv... yes
  681. checking for setlocale... yes
  682. checking for stpcpy... yes
  683. checking for strcasecmp... yes
  684. checking for strdup... yes
  685. checking for strtoul... yes
  686. checking for tsearch... yes
  687. checking for __argz_count... yes
  688. checking for __argz_stringify... yes
  689. checking for __argz_next... yes
  690. checking for iconv declaration...
  691. extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
  692. checking for nl_langinfo and CODESET... yes
  693. checking for LC_MESSAGES... yes
  694. checking for bison... no
  695. checking whether NLS is requested... yes
  696. checking whether included gettext is requested... no
  697. checking for GNU gettext in libc... yes
  698. checking for perl... perl
  699. configure: creating ./config.status
  700. config.status: creating Makefile
  701. config.status: creating contrib/Makefile
  702. config.status: creating doc/Makefile
  703. config.status: creating intl/Makefile
  704. config.status: creating man/Makefile
  705. config.status: creating po/Makefile.in
  706. config.status: creating m4/Makefile
  707. config.status: creating src/Makefile
  708. config.status: creating tests/Makefile
  709. config.status: creating config.h
  710. config.status: executing depfiles commands
  711. config.status: executing default-1 commands
  712. config.status: creating po/POTFILES
  713. config.status: creating po/Makefile
  714. config.status: executing default commands
  715. dh_auto_build
  716. make[1]: Entering directory `/root/hello-2.1.0'
  717. make all-recursive
  718. make[2]: Entering directory `/root/hello-2.1.0'
  719. Making all in contrib
  720. make[3]: Entering directory `/root/hello-2.1.0/contrib'
  721. make[3]: Nothing to be done for `all'.
  722. make[3]: Leaving directory `/root/hello-2.1.0/contrib'
  723. Making all in doc
  724. make[3]: Entering directory `/root/hello-2.1.0/doc'
  725. make[3]: Nothing to be done for `all'.
  726. make[3]: Leaving directory `/root/hello-2.1.0/doc'
  727. Making all in intl
  728. make[3]: Entering directory `/root/hello-2.1.0/intl'
  729. make[3]: Nothing to be done for `all'.
  730. make[3]: Leaving directory `/root/hello-2.1.0/intl'
  731. Making all in po
  732. make[3]: Entering directory `/root/hello-2.1.0/po'
  733. make[3]: Nothing to be done for `all'.
  734. make[3]: Leaving directory `/root/hello-2.1.0/po'
  735. Making all in src
  736. make[3]: Entering directory `/root/hello-2.1.0/src'
  737. gcc -DLOCALEDIR=\"/usr/share/locale\" -DHAVE_CONFIG_H -I. -I. -I.. -I. -I. -I.. -I../intl -I../intl -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -c `test -f 'hello.c' || echo './'`hello.c
  738. gcc -DLOCALEDIR=\"/usr/share/locale\" -DHAVE_CONFIG_H -I. -I. -I.. -I. -I. -I.. -I../intl -I../intl -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -c `test -f 'version.c' || echo './'`version.c
  739. gcc -DLOCALEDIR=\"/usr/share/locale\" -DHAVE_CONFIG_H -I. -I. -I.. -I. -I. -I.. -I../intl -I../intl -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -c `test -f 'getopt.c' || echo './'`getopt.c
  740. gcc -DLOCALEDIR=\"/usr/share/locale\" -DHAVE_CONFIG_H -I. -I. -I.. -I. -I. -I.. -I../intl -I../intl -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -c `test -f 'getopt1.c' || echo './'`getopt1.c
  741. gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -o hello hello.o version.o getopt.o getopt1.o
  742. make[3]: Leaving directory `/root/hello-2.1.0/src'
  743. Making all in man
  744. make[3]: Entering directory `/root/hello-2.1.0/man'
  745. perl help2man --name="Friendly Greeting Program" ../src/hello >hello.1
  746. make[3]: Leaving directory `/root/hello-2.1.0/man'
  747. Making all in m4
  748. make[3]: Entering directory `/root/hello-2.1.0/m4'
  749. make[3]: Nothing to be done for `all'.
  750. make[3]: Leaving directory `/root/hello-2.1.0/m4'
  751. Making all in tests
  752. make[3]: Entering directory `/root/hello-2.1.0/tests'
  753. make[3]: Nothing to be done for `all'.
  754. make[3]: Leaving directory `/root/hello-2.1.0/tests'
  755. make[3]: Entering directory `/root/hello-2.1.0'
  756. make[3]: Leaving directory `/root/hello-2.1.0'
  757. make[2]: Leaving directory `/root/hello-2.1.0'
  758. make[1]: Leaving directory `/root/hello-2.1.0'
  759. dh_auto_test
  760. make[1]: Entering directory `/root/hello-2.1.0'
  761. Making check in contrib
  762. make[2]: Entering directory `/root/hello-2.1.0/contrib'
  763. make[2]: Nothing to be done for `check'.
  764. make[2]: Leaving directory `/root/hello-2.1.0/contrib'
  765. Making check in doc
  766. make[2]: Entering directory `/root/hello-2.1.0/doc'
  767. make[2]: Nothing to be done for `check'.
  768. make[2]: Leaving directory `/root/hello-2.1.0/doc'
  769. Making check in intl
  770. make[2]: Entering directory `/root/hello-2.1.0/intl'
  771. make[2]: Nothing to be done for `check'.
  772. make[2]: Leaving directory `/root/hello-2.1.0/intl'
  773. Making check in po
  774. make[2]: Entering directory `/root/hello-2.1.0/po'
  775. make[2]: Nothing to be done for `check'.
  776. make[2]: Leaving directory `/root/hello-2.1.0/po'
  777. Making check in src
  778. make[2]: Entering directory `/root/hello-2.1.0/src'
  779. make[2]: Nothing to be done for `check'.
  780. make[2]: Leaving directory `/root/hello-2.1.0/src'
  781. Making check in man
  782. make[2]: Entering directory `/root/hello-2.1.0/man'
  783. make[2]: Nothing to be done for `check'.
  784. make[2]: Leaving directory `/root/hello-2.1.0/man'
  785. Making check in m4
  786. make[2]: Entering directory `/root/hello-2.1.0/m4'
  787. make[2]: Nothing to be done for `check'.
  788. make[2]: Leaving directory `/root/hello-2.1.0/m4'
  789. Making check in tests
  790. make[2]: Entering directory `/root/hello-2.1.0/tests'
  791. make check-TESTS
  792. make[3]: Entering directory `/root/hello-2.1.0/tests'
  793. PASS: hello-1
  794. PASS: world-1
  795. PASS: nothing-1
  796. ==================
  797. All 3 tests passed
  798. ==================
  799. make[3]: Leaving directory `/root/hello-2.1.0/tests'
  800. make[2]: Leaving directory `/root/hello-2.1.0/tests'
  801. make[2]: Entering directory `/root/hello-2.1.0'
  802. make[2]: Leaving directory `/root/hello-2.1.0'
  803. make[1]: Leaving directory `/root/hello-2.1.0'
  804. root@dell-virtual-machine:~/hello-2.1.0# ls
  805. ABOUT-NLS config.h.in COPYING Makefile.am stamp-h
  806. aclocal.m4 config.log debian Makefile.in stamp-h1
  807. AUTHORS config.rpath depcomp man tests
  808. BUGS config.status doc missing THANKS
  809. ChangeLog config.sub INSTALL mkinstalldirs TODO
  810. ChangeLog.O config.sub.dh-orig install-sh NEWS
  811. config.guess configure intl po
  812. config.guess.dh-orig configure.ac m4 README
  813. config.h contrib Makefile src
  814. root@dell-virtual-machine:~/hello-2.1.0# fakeroot debian/rules binary
  815. dh binary --with autotools-dev
  816. dh_testroot
  817. dh_prep
  818. dh_auto_install
  819. make[1]: Entering directory `/root/hello-2.1.0'
  820. Making install in contrib
  821. make[2]: Entering directory `/root/hello-2.1.0/contrib'
  822. make[3]: Entering directory `/root/hello-2.1.0/contrib'
  823. make[3]: Nothing to be done for `install-exec-am'.
  824. make[3]: Nothing to be done for `install-data-am'.
  825. make[3]: Leaving directory `/root/hello-2.1.0/contrib'
  826. make[2]: Leaving directory `/root/hello-2.1.0/contrib'
  827. Making install in doc
  828. make[2]: Entering directory `/root/hello-2.1.0/doc'
  829. make[3]: Entering directory `/root/hello-2.1.0/doc'
  830. make[3]: Nothing to be done for `install-exec-am'.
  831. /bin/bash ../mkinstalldirs /root/hello-2.1.0/debian/hello/usr/share/info
  832. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/info
  833. /usr/bin/install -c -m 644 ./hello.info /root/hello-2.1.0/debian/hello/usr/share/info/hello.info
  834. install-info --info-dir=/root/hello-2.1.0/debian/hello/usr/share/info /root/hello-2.1.0/debian/hello/usr/share/info/hello.info
  835. This is not dpkg install-info anymore, but GNU install-info
  836. See the man page for ginstall-info for command line arguments
  837. make[3]: Leaving directory `/root/hello-2.1.0/doc'
  838. make[2]: Leaving directory `/root/hello-2.1.0/doc'
  839. Making install in intl
  840. make[2]: Entering directory `/root/hello-2.1.0/intl'
  841. if test "hello" = "gettext" \
  842. && test '' = 'intl-compat.o'; then \
  843. /bin/sh `case "./mkinstalldirs" in /*) echo "./mkinstalldirs" ;; *) echo ".././mkinstalldirs" ;; esac` /root/hello-2.1.0/debian/hello/usr/lib/x86_64-linux-gnu /root/hello-2.1.0/debian/hello/usr/include; \
  844. /usr/bin/install -c -m 644 libintl.h /root/hello-2.1.0/debian/hello/usr/include/libintl.h; \
  845. @LIBTOOL@ --mode=install \
  846. /usr/bin/install -c -m 644 libintl.a /root/hello-2.1.0/debian/hello/usr/lib/x86_64-linux-gnu/libintl.a; \
  847. else \
  848. : ; \
  849. fi
  850. if test 'no' = yes; then \
  851. test yes != no || /bin/sh `case "./mkinstalldirs" in /*) echo "./mkinstalldirs" ;; *) echo ".././mkinstalldirs" ;; esac` /root/hello-2.1.0/debian/hello/usr/lib/x86_64-linux-gnu; \
  852. temp=/root/hello-2.1.0/debian/hello/usr/lib/x86_64-linux-gnu/t-charset.alias; \
  853. dest=/root/hello-2.1.0/debian/hello/usr/lib/x86_64-linux-gnu/charset.alias; \
  854. if test -f /root/hello-2.1.0/debian/hello/usr/lib/x86_64-linux-gnu/charset.alias; then \
  855. orig=/root/hello-2.1.0/debian/hello/usr/lib/x86_64-linux-gnu/charset.alias; \
  856. sed -f ref-add.sed $orig > $temp; \
  857. /usr/bin/install -c -m 644 $temp $dest; \
  858. rm -f $temp; \
  859. else \
  860. if test yes = no; then \
  861. orig=charset.alias; \
  862. sed -f ref-add.sed $orig > $temp; \
  863. /usr/bin/install -c -m 644 $temp $dest; \
  864. rm -f $temp; \
  865. fi; \
  866. fi; \
  867. /bin/sh `case "./mkinstalldirs" in /*) echo "./mkinstalldirs" ;; *) echo ".././mkinstalldirs" ;; esac` /root/hello-2.1.0/debian/hello/usr/share/locale; \
  868. test -f /root/hello-2.1.0/debian/hello/usr/share/locale/locale.alias \
  869. && orig=/root/hello-2.1.0/debian/hello/usr/share/locale/locale.alias \
  870. || orig=./locale.alias; \
  871. temp=/root/hello-2.1.0/debian/hello/usr/share/locale/t-locale.alias; \
  872. dest=/root/hello-2.1.0/debian/hello/usr/share/locale/locale.alias; \
  873. sed -f ref-add.sed $orig > $temp; \
  874. /usr/bin/install -c -m 644 $temp $dest; \
  875. rm -f $temp; \
  876. else \
  877. : ; \
  878. fi
  879. if test "hello" = "gettext"; then \
  880. /bin/sh `case "./mkinstalldirs" in /*) echo "./mkinstalldirs" ;; *) echo ".././mkinstalldirs" ;; esac` /root/hello-2.1.0/debian/hello/usr/share/gettext/intl; \
  881. /usr/bin/install -c -m 644 VERSION /root/hello-2.1.0/debian/hello/usr/share/gettext/intl/VERSION; \
  882. /usr/bin/install -c -m 644 ChangeLog.inst /root/hello-2.1.0/debian/hello/usr/share/gettext/intl/ChangeLog; \
  883. dists="COPYING.LIB-2.0 COPYING.LIB-2.1 Makefile.in config.charset locale.alias ref-add.sin ref-del.sin gmo.h gettextP.h hash-string.h plural-exp.h eval-plural.h os2compat.h libgnuintl.h loadinfo.h bindtextdom.c dcgettext.c dgettext.c gettext.c finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y plural-exp.c localcharset.c localename.c osdep.c os2compat.c intl-compat.c"; \
  884. for file in $dists; do \
  885. /usr/bin/install -c -m 644 ./$file \
  886. /root/hello-2.1.0/debian/hello/usr/share/gettext/intl/$file; \
  887. done; \
  888. chmod a+x /root/hello-2.1.0/debian/hello/usr/share/gettext/intl/config.charset; \
  889. dists="plural.c"; \
  890. for file in $dists; do \
  891. if test -f $file; then dir=.; else dir=.; fi; \
  892. /usr/bin/install -c -m 644 $dir/$file \
  893. /root/hello-2.1.0/debian/hello/usr/share/gettext/intl/$file; \
  894. done; \
  895. dists="xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c COPYING.LIB-2 gettext.h libgettext.h plural-eval.c"; \
  896. for file in $dists; do \
  897. rm -f /root/hello-2.1.0/debian/hello/usr/share/gettext/intl/$file; \
  898. done; \
  899. else \
  900. : ; \
  901. fi
  902. make[2]: Leaving directory `/root/hello-2.1.0/intl'
  903. Making install in po
  904. make[2]: Entering directory `/root/hello-2.1.0/po'
  905. /bin/sh `case "./mkinstalldirs" in /*) echo "./mkinstalldirs" ;; *) echo ".././mkinstalldirs" ;; esac` /root/hello-2.1.0/debian/hello/usr/share
  906. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/ca/LC_MESSAGES
  907. installing ca.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/ca/LC_MESSAGES/hello.mo
  908. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/da/LC_MESSAGES
  909. installing da.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/da/LC_MESSAGES/hello.mo
  910. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/de/LC_MESSAGES
  911. installing de.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/de/LC_MESSAGES/hello.mo
  912. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/de_DE/LC_MESSAGES
  913. installing de_DE.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/de_DE/LC_MESSAGES/hello.mo
  914. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/el/LC_MESSAGES
  915. installing el.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/el/LC_MESSAGES/hello.mo
  916. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/eo/LC_MESSAGES
  917. installing eo.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/eo/LC_MESSAGES/hello.mo
  918. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/es/LC_MESSAGES
  919. installing es.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/es/LC_MESSAGES/hello.mo
  920. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/et/LC_MESSAGES
  921. installing et.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/et/LC_MESSAGES/hello.mo
  922. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/fi/LC_MESSAGES
  923. installing fi.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/fi/LC_MESSAGES/hello.mo
  924. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/fr/LC_MESSAGES
  925. installing fr.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/fr/LC_MESSAGES/hello.mo
  926. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/gl/LC_MESSAGES
  927. installing gl.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/gl/LC_MESSAGES/hello.mo
  928. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/he/LC_MESSAGES
  929. installing he.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/he/LC_MESSAGES/hello.mo
  930. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/hr/LC_MESSAGES
  931. installing hr.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/hr/LC_MESSAGES/hello.mo
  932. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/hu/LC_MESSAGES
  933. installing hu.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/hu/LC_MESSAGES/hello.mo
  934. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/id/LC_MESSAGES
  935. installing id.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/id/LC_MESSAGES/hello.mo
  936. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/it/LC_MESSAGES
  937. installing it.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/it/LC_MESSAGES/hello.mo
  938. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/ja/LC_MESSAGES
  939. installing ja.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/ja/LC_MESSAGES/hello.mo
  940. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/ko/LC_MESSAGES
  941. installing ko.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/ko/LC_MESSAGES/hello.mo
  942. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/lv/LC_MESSAGES
  943. installing lv.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/lv/LC_MESSAGES/hello.mo
  944. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/nb/LC_MESSAGES
  945. installing nb.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/nb/LC_MESSAGES/hello.mo
  946. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/nl/LC_MESSAGES
  947. installing nl.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/nl/LC_MESSAGES/hello.mo
  948. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/nn/LC_MESSAGES
  949. installing nn.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/nn/LC_MESSAGES/hello.mo
  950. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/pl/LC_MESSAGES
  951. installing pl.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/pl/LC_MESSAGES/hello.mo
  952. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/pt/LC_MESSAGES
  953. installing pt.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/pt/LC_MESSAGES/hello.mo
  954. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/pt_BR/LC_MESSAGES
  955. installing pt_BR.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/pt_BR/LC_MESSAGES/hello.mo
  956. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/ru/LC_MESSAGES
  957. installing ru.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/ru/LC_MESSAGES/hello.mo
  958. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/sk/LC_MESSAGES
  959. installing sk.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/sk/LC_MESSAGES/hello.mo
  960. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/sl/LC_MESSAGES
  961. installing sl.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/sl/LC_MESSAGES/hello.mo
  962. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/sv/LC_MESSAGES
  963. installing sv.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/sv/LC_MESSAGES/hello.mo
  964. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/tr/LC_MESSAGES
  965. installing tr.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/tr/LC_MESSAGES/hello.mo
  966. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/locale/uk/LC_MESSAGES
  967. installing uk.gmo as /root/hello-2.1.0/debian/hello/usr/share/locale/uk/LC_MESSAGES/hello.mo
  968. if test "hello" = "gettext"; then \
  969. /bin/sh `case "./mkinstalldirs" in /*) echo "./mkinstalldirs" ;; *) echo ".././mkinstalldirs" ;; esac` /root/hello-2.1.0/debian/hello/usr/share/gettext/po; \
  970. for file in Makefile.in.in Makevars remove-potcdate.sin quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot ; do \
  971. /usr/bin/install -c -m 644 ./$file \
  972. /root/hello-2.1.0/debian/hello/usr/share/gettext/po/$file; \
  973. done; \
  974. else \
  975. : ; \
  976. fi
  977. make[2]: Leaving directory `/root/hello-2.1.0/po'
  978. Making install in src
  979. make[2]: Entering directory `/root/hello-2.1.0/src'
  980. make[3]: Entering directory `/root/hello-2.1.0/src'
  981. /bin/bash ../mkinstalldirs /root/hello-2.1.0/debian/hello/usr/bin
  982. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/bin
  983. /usr/bin/install -c hello /root/hello-2.1.0/debian/hello/usr/bin/hello
  984. make[3]: Nothing to be done for `install-data-am'.
  985. make[3]: Leaving directory `/root/hello-2.1.0/src'
  986. make[2]: Leaving directory `/root/hello-2.1.0/src'
  987. Making install in man
  988. make[2]: Entering directory `/root/hello-2.1.0/man'
  989. make[3]: Entering directory `/root/hello-2.1.0/man'
  990. make[3]: Nothing to be done for `install-exec-am'.
  991. /bin/bash ../mkinstalldirs /root/hello-2.1.0/debian/hello/usr/share/man/man1
  992. mkdir -p -- /root/hello-2.1.0/debian/hello/usr/share/man/man1
  993. /usr/bin/install -c -m 644 ./hello.1 /root/hello-2.1.0/debian/hello/usr/share/man/man1/hello.1
  994. make[3]: Leaving directory `/root/hello-2.1.0/man'
  995. make[2]: Leaving directory `/root/hello-2.1.0/man'
  996. Making install in m4
  997. make[2]: Entering directory `/root/hello-2.1.0/m4'
  998. make[3]: Entering directory `/root/hello-2.1.0/m4'
  999. make[3]: Nothing to be done for `install-exec-am'.
  1000. make[3]: Nothing to be done for `install-data-am'.
  1001. make[3]: Leaving directory `/root/hello-2.1.0/m4'
  1002. make[2]: Leaving directory `/root/hello-2.1.0/m4'
  1003. Making install in tests
  1004. make[2]: Entering directory `/root/hello-2.1.0/tests'
  1005. make[3]: Entering directory `/root/hello-2.1.0/tests'
  1006. make[3]: Nothing to be done for `install-exec-am'.
  1007. make[3]: Nothing to be done for `install-data-am'.
  1008. make[3]: Leaving directory `/root/hello-2.1.0/tests'
  1009. make[2]: Leaving directory `/root/hello-2.1.0/tests'
  1010. make[2]: Entering directory `/root/hello-2.1.0'
  1011. make[3]: Entering directory `/root/hello-2.1.0'
  1012. make[3]: Nothing to be done for `install-exec-am'.
  1013. make[3]: Nothing to be done for `install-data-am'.
  1014. make[3]: Leaving directory `/root/hello-2.1.0'
  1015. make[2]: Leaving directory `/root/hello-2.1.0'
  1016. make[1]: Leaving directory `/root/hello-2.1.0'
  1017. dh_installdocs
  1018. dh_installchangelogs
  1019. dh_installman
  1020. dh_installinfo
  1021. dh_perl
  1022. dh_link
  1023. dh_compress
  1024. dh_fixperms
  1025. dh_strip
  1026. dh_makeshlibs
  1027. dh_shlibdeps
  1028. dh_installdeb
  1029. dh_gencontrol
  1030. dh_md5sums
  1031. dh_builddeb
  1032. dpkg-deb: building package `hello' in `../hello_2.1.0-1ubuntu1_amd64.deb'.
  1033. root@dell-virtual-machine:~/hello-2.1.0# ls
  1034. ABOUT-NLS config.h.in COPYING Makefile.am stamp-h
  1035. aclocal.m4 config.log debian Makefile.in stamp-h1
  1036. AUTHORS config.rpath depcomp man tests
  1037. BUGS config.status doc missing THANKS
  1038. ChangeLog config.sub INSTALL mkinstalldirs TODO
  1039. ChangeLog.O config.sub.dh-orig install-sh NEWS
  1040. config.guess configure intl po
  1041. config.guess.dh-orig configure.ac m4 README
  1042. config.h contrib Makefile src
  1043. root@dell-virtual-machine:~/hello-2.1.0# cd ..
  1044. root@dell-virtual-machine:~# ls
  1045. Desktop hello_2.1.0-1ubuntu1_amd64.deb hello-2.1.0.tar.gz
  1046. hello-2.1.0 hello_2.1.0.orig.tar.gz test123
  1047. root@dell-virtual-machine:~# dpkg -i hello_2.1.0-1ubuntu1_amd64.deb
  1048. Selecting previously unselected package hello.
  1049. (Reading database ... 176742 files and directories currently installed.)
  1050. Preparing to unpack hello_2.1.0-1ubuntu1_amd64.deb ...
  1051. Unpacking hello (2.1.0-1ubuntu1) ...
  1052. Setting up hello (2.1.0-1ubuntu1) ...
  1053. Processing triggers for install-info (5.2.0.dfsg.1-2) ...
  1054. Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
  1055. root@dell-virtual-machine:~# hel
  1056. hello help helpztags
  1057. root@dell-virtual-machine:~# hel
  1058. hello help helpztags
  1059. root@dell-virtual-machine:~# hello
  1060. Hello, world!
  1061. root@dell-virtual-machine:~#
  1062.  
  1063.  
  1064. At this point we have already our .deb file created!. We can see the shared libraries needed to build our program (in this case libc6, because of the stdio.h include) listed in our debian/hello.substvars file:
  1065.  
  1066. root@dell-virtual-machine:~/hello-2.1.0/debian# cat hello.substvars
  1067. shlibs:Depends=libc6 (>= 2.3.4)
  1068. misc:Depends=
  1069.  
  1070.  
  1071. Inspecting package contents:
  1072.  
  1073. root@dell-virtual-machine:~/hello-2.1.0# find debian/hello
  1074. debian/hello
  1075. debian/hello/usr
  1076. debian/hello/usr/bin
  1077. debian/hello/usr/bin/hello
  1078. debian/hello/usr/share
  1079. debian/hello/usr/share/doc
  1080. debian/hello/usr/share/doc/hello
  1081. debian/hello/usr/share/doc/hello/README
  1082. debian/hello/usr/share/doc/hello/NEWS.gz
  1083. debian/hello/usr/share/doc/hello/TODO
  1084. debian/hello/usr/share/doc/hello/copyright
  1085. debian/hello/usr/share/doc/hello/ChangeLog.O.gz
  1086. debian/hello/usr/share/doc/hello/BUGS
  1087. debian/hello/usr/share/doc/hello/changelog.Debian.gz
  1088. debian/hello/usr/share/locale
  1089. debian/hello/usr/share/locale/tr
  1090. debian/hello/usr/share/locale/tr/LC_MESSAGES
  1091. debian/hello/usr/share/locale/tr/LC_MESSAGES/hello.mo
  1092. debian/hello/usr/share/locale/ru
  1093. debian/hello/usr/share/locale/ru/LC_MESSAGES
  1094. debian/hello/usr/share/locale/ru/LC_MESSAGES/hello.mo
  1095. debian/hello/usr/share/locale/fr
  1096. debian/hello/usr/share/locale/fr/LC_MESSAGES
  1097. debian/hello/usr/share/locale/fr/LC_MESSAGES/hello.mo
  1098. debian/hello/usr/share/locale/hr
  1099. debian/hello/usr/share/locale/hr/LC_MESSAGES
  1100. debian/hello/usr/share/locale/hr/LC_MESSAGES/hello.mo
  1101. debian/hello/usr/share/locale/nb
  1102. debian/hello/usr/share/locale/nb/LC_MESSAGES
  1103. debian/hello/usr/share/locale/nb/LC_MESSAGES/hello.mo
  1104. debian/hello/usr/share/locale/ja
  1105. debian/hello/usr/share/locale/ja/LC_MESSAGES
  1106. debian/hello/usr/share/locale/ja/LC_MESSAGES/hello.mo
  1107. debian/hello/usr/share/locale/fi
  1108. debian/hello/usr/share/locale/fi/LC_MESSAGES
  1109. debian/hello/usr/share/locale/fi/LC_MESSAGES/hello.mo
  1110. debian/hello/usr/share/locale/hu
  1111. debian/hello/usr/share/locale/hu/LC_MESSAGES
  1112. debian/hello/usr/share/locale/hu/LC_MESSAGES/hello.mo
  1113. debian/hello/usr/share/locale/es
  1114. debian/hello/usr/share/locale/es/LC_MESSAGES
  1115. debian/hello/usr/share/locale/es/LC_MESSAGES/hello.mo
  1116. debian/hello/usr/share/locale/da
  1117. debian/hello/usr/share/locale/da/LC_MESSAGES
  1118. debian/hello/usr/share/locale/da/LC_MESSAGES/hello.mo
  1119. debian/hello/usr/share/locale/he
  1120. debian/hello/usr/share/locale/he/LC_MESSAGES
  1121. debian/hello/usr/share/locale/he/LC_MESSAGES/hello.mo
  1122. debian/hello/usr/share/locale/ca
  1123. debian/hello/usr/share/locale/ca/LC_MESSAGES
  1124. debian/hello/usr/share/locale/ca/LC_MESSAGES/hello.mo
  1125. debian/hello/usr/share/locale/pt_BR
  1126. debian/hello/usr/share/locale/pt_BR/LC_MESSAGES
  1127. debian/hello/usr/share/locale/pt_BR/LC_MESSAGES/hello.mo
  1128. debian/hello/usr/share/locale/de
  1129. debian/hello/usr/share/locale/de/LC_MESSAGES
  1130. debian/hello/usr/share/locale/de/LC_MESSAGES/hello.mo
  1131. debian/hello/usr/share/locale/eo
  1132. debian/hello/usr/share/locale/eo/LC_MESSAGES
  1133. debian/hello/usr/share/locale/eo/LC_MESSAGES/hello.mo
  1134. debian/hello/usr/share/locale/pt
  1135. debian/hello/usr/share/locale/pt/LC_MESSAGES
  1136. debian/hello/usr/share/locale/pt/LC_MESSAGES/hello.mo
  1137. debian/hello/usr/share/locale/it
  1138. debian/hello/usr/share/locale/it/LC_MESSAGES
  1139. debian/hello/usr/share/locale/it/LC_MESSAGES/hello.mo
  1140. debian/hello/usr/share/locale/de_DE
  1141. debian/hello/usr/share/locale/de_DE/LC_MESSAGES
  1142. debian/hello/usr/share/locale/de_DE/LC_MESSAGES/hello.mo
  1143. debian/hello/usr/share/locale/sv
  1144. debian/hello/usr/share/locale/sv/LC_MESSAGES
  1145. debian/hello/usr/share/locale/sv/LC_MESSAGES/hello.mo
  1146. debian/hello/usr/share/locale/sl
  1147. debian/hello/usr/share/locale/sl/LC_MESSAGES
  1148. debian/hello/usr/share/locale/sl/LC_MESSAGES/hello.mo
  1149. debian/hello/usr/share/locale/sk
  1150. debian/hello/usr/share/locale/sk/LC_MESSAGES
  1151. debian/hello/usr/share/locale/sk/LC_MESSAGES/hello.mo
  1152. debian/hello/usr/share/locale/id
  1153. debian/hello/usr/share/locale/id/LC_MESSAGES
  1154. debian/hello/usr/share/locale/id/LC_MESSAGES/hello.mo
  1155. debian/hello/usr/share/locale/uk
  1156. debian/hello/usr/share/locale/uk/LC_MESSAGES
  1157. debian/hello/usr/share/locale/uk/LC_MESSAGES/hello.mo
  1158. debian/hello/usr/share/locale/nl
  1159. debian/hello/usr/share/locale/nl/LC_MESSAGES
  1160. debian/hello/usr/share/locale/nl/LC_MESSAGES/hello.mo
  1161. debian/hello/usr/share/locale/gl
  1162. debian/hello/usr/share/locale/gl/LC_MESSAGES
  1163. debian/hello/usr/share/locale/gl/LC_MESSAGES/hello.mo
  1164. debian/hello/usr/share/locale/el
  1165. debian/hello/usr/share/locale/el/LC_MESSAGES
  1166. debian/hello/usr/share/locale/el/LC_MESSAGES/hello.mo
  1167. debian/hello/usr/share/locale/nn
  1168. debian/hello/usr/share/locale/nn/LC_MESSAGES
  1169. debian/hello/usr/share/locale/nn/LC_MESSAGES/hello.mo
  1170. debian/hello/usr/share/locale/et
  1171. debian/hello/usr/share/locale/et/LC_MESSAGES
  1172. debian/hello/usr/share/locale/et/LC_MESSAGES/hello.mo
  1173. debian/hello/usr/share/locale/ko
  1174. debian/hello/usr/share/locale/ko/LC_MESSAGES
  1175. debian/hello/usr/share/locale/ko/LC_MESSAGES/hello.mo
  1176. debian/hello/usr/share/locale/pl
  1177. debian/hello/usr/share/locale/pl/LC_MESSAGES
  1178. debian/hello/usr/share/locale/pl/LC_MESSAGES/hello.mo
  1179. debian/hello/usr/share/locale/lv
  1180. debian/hello/usr/share/locale/lv/LC_MESSAGES
  1181. debian/hello/usr/share/locale/lv/LC_MESSAGES/hello.mo
  1182. debian/hello/usr/share/info
  1183. debian/hello/usr/share/info/dir.gz
  1184. debian/hello/usr/share/info/hello.info.gz
  1185. debian/hello/usr/share/man
  1186. debian/hello/usr/share/man/man1
  1187. debian/hello/usr/share/man/man1/hello.1.gz
  1188. debian/hello/DEBIAN
  1189. debian/hello/DEBIAN/control
  1190. debian/hello/DEBIAN/md5sums
  1191. root@dell-virtual-machine:~/hello-2.1.0#
  1192.  
  1193.  
  1194. Package maintenance scripts
  1195.  
  1196. It is possible to supply scripts that will run when the package is installed, upgraded or removed. These scripts are the control information files: preinst, postinst, prerm, postrm. And in some cases, may prompt the user if necessary, typically through a program such as debconf. More information on how to create this scripts can be found at the Debian Policy Manual.
  1197.  
  1198. <TBD>
  1199.  
  1200. Debuild:
  1201.  
  1202. As mentioned before, we can use debuild to build the Debian binary and source packages, check it with lintian, and sign it with debsign. We can use "debuild -us -uc" to build the packages without signing the .changes file. More information can be found with "man debuild
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement