README.howto 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. README (English)
  2. ##################################################
  3. DEB Package tools
  4. ##################################################
  5. This directory contains files used by makepack-dolibarr.pl
  6. script to build a package, ready to be distributed,
  7. with format .DEB (for Debian, Ubuntu, ...).
  8. ##### Prepare linux env to work
  9. # To build a debian package, you need first
  10. # With Ubuntu 12.04
  11. # apt-get install debhelper dpkg-source gpg lintian git-buildpackage pkg-php-tools schroot sbuild dh-linktree dh-make-php
  12. # With Ubuntu 14.04 ou Debian 7
  13. # apt-get install debhelper dpkg gnupg lintian git-buildpackage pkg-php-tools schroot sbuild dh-linktree dh-make-php packaging-dev
  14. # To generate gpg key for email used into changelog
  15. * Check your existing keys/emails
  16. > gpg --list-key
  17. * Generate a new one, if none exists for email you use as author
  18. > gpg --gen-key Generate a GPG key (-> pubring.gpg + secring.gpg)
  19. Files are saved int .gnupg directory
  20. * Create a file ~/.gpb.conf by
  21. > cat >~/.gbp.conf <<END
  22. [DEFAULT]
  23. pristine-tar = True
  24. [buildpackage]
  25. ignore-branch = True
  26. [git-buildpackage]
  27. sign-tags = True
  28. export-dir = ../build-area/
  29. [git-import-orig]
  30. filter-pristine-tar = True
  31. END
  32. # Complete .bashrc with DEBEMAIL and DEBFULLNAME
  33. Example:
  34. export DEBFULLNAME="Laurent Destailleur (eldy)"
  35. export DEBEMAIL=eldy@users.sourceforge.net
  36. Other example:
  37. export DEBFULLNAME="Laurent Destailleur"
  38. export DEBEMAIL="eldy@destailleur.fr"
  39. export QUILT_PATCHES=debian/patches
  40. # Note: alioth.debian.org is outdated --> https://alioth-archive.debian.org/ --> https://salsa.debian.org/public
  41. * Create an account login
  42. * Update your ~/.ssh/config file to add:
  43. Host svn.debian.org git.debian.org bzr.debian.org hg.debian.org darcs.debian.org arch.debian.org
  44. User eldy-guest
  45. IdentityFile ~/.ssh/id_rsa
  46. * Check login on page https://alioth.debian.org/users/login
  47. Ex: https://alioth.debian.org/users/eldy-guest
  48. * Setup your ssh as described into page: http://wiki.debian.org/Alioth/SSH
  49. * Ask to be included into project collab-maint: http://alioth.debian.org/projects/collab-maint/
  50. ##### Some interesting command to know
  51. # To translate .po files
  52. # debconf-updatepo To run into po dir to regenate templates.pot
  53. # podebconf-report-po --from email@email.com To send email to ask translations
  54. # Edit manually file XX.po and remove all lines "#, fuzzy" when translation is complete
  55. # msgfmt -v -c -o /dev/null XX.po To have status of translation for language XX
  56. # To check package integrity
  57. # lintian --pedantic -E -I package.deb To test a binary package
  58. # lintian --pedantic -E -I package.dsc To test a source package
  59. # To manipulate packages
  60. # dpkg -l List all packages
  61. # dpkg -b To build binary only package
  62. # dpkg -c package.deb List content of package
  63. # dpkg -I package.deb Give informations on package
  64. # dpkg -i package.deb Install a package
  65. # dpkg-reconfigure -plow package Reconfigure package
  66. # dpkg -L packagename List content of installed package
  67. # dpkg -r packagename Remove config files and interactive saved answers
  68. # dpkg -s packagename Give status of installed package
  69. # dpkg --purge Remove config files and interactive saved answers
  70. #
  71. # dpkg-buildpackage -us -uc Build a source and binary package
  72. #
  73. # gdebi package.deb Install a package + dependencies
  74. ##### Global view of submit new package to Debian:
  75. - Post an ITP with reportbugs :
  76. > reportbug -B debian --email username@domain.tld wnpp
  77. See page https://www.debian.org/devel/wnpp/#l1 for example of ITP requests contents.
  78. - Wait until you received bug number.
  79. For first ITP submission of Dolibarr, bug id was 634783.
  80. - Check bug is into database by searching with id on
  81. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634783
  82. - Add a line for upstream into file changelog with bug number
  83. - Call for a mentor on ML debian-mentors to upload packages
  84. - Once package is uploaded, following URL are available:
  85. https://packages.qa.debian.org/package.html
  86. https://bugs.debian.org/package
  87. ##### Modify severity of a bug ticket
  88. - Send this email to control@bugs.debian.org and wait 10 minutes
  89. severity 123 xxx
  90. ##### Update bug tracker system
  91. To set status of a bug to "pending"
  92. > bts --smtp-host=yoursmtpserver tag 999999 +pending
  93. or replay to email 999999@bugs.debian.org + submitter of bug
  94. With a message starting with:
  95. Control: tag -1 +pending
  96. Thanks. Fixed into git.
  97. or replay to email control@bugs.debian.org
  98. With only message
  99. tag 729538 +pending
  100. To remove status of a bug without "moreinfo" (bug can be processed)
  101. or replay to email 999999@bugs.debian.org + submitter of bug
  102. With a message starting with:
  103. Control: tag -1 -moreinfo
  104. Thanks. Fixed into git.
  105. or replay to email control@bugs.debian.org
  106. With only message
  107. tag 729538 -moreinfo
  108. ##### Testing a package into a chroot environment
  109. Check you have a mysql server available from another interface than "localhost".
  110. Set line in /etc/mysql/my.cnf if required and restart mysql
  111. [mysqld]
  112. bind-address = *
  113. Create a chroot called "jessie" or "unstable".
  114. Chroot env is stored into /srv/chroot directory.
  115. > sudo sbuild-createchroot --keyring=unstable /srv/chroot/unstable http://ftp.uk.debian.org/debian
  116. or
  117. > sudo sbuild-createchroot jessie /srv/chroot/jessie http://ftp.uk.debian.org/debian
  118. Pour lister les env chroot
  119. > schroot -l
  120. or
  121. > ls /srv/chroot
  122. Puis pour se connecter et préparer l'environnement
  123. > schroot -c name_of_chroot (exemple schroot -c unstable-amd64-sbuild)
  124. > cat /etc/debian_chroot to check which debian branch we are into
  125. > apt-get install vim dialog
  126. > vi /usr/sbin/policy-rc.d and replace return code 101 (not allowed) into 0 (ok)
  127. > apt-get update
  128. > apt-get upgrade
  129. > apt-get install links mysql-client
  130. To test a package
  131. > On host server, stop any server on port 80 and 3306 (same port will be used by chroot env)
  132. > cp ../build-area/* /srv/chroot/unstable/tmp
  133. > sudo schroot -c name_of_chroot
  134. > cd /tmp
  135. > lintian --no-tag-display-limit --pedantic -E -I dolibarr*.deb
  136. > lintian --no-tag-display-limit --pedantic -E -I dolibarr*.dsc
  137. > dpkg -i dolibarr*.deb ou pour avoir des traces: dpkg -D77777 -i dolibarr*.deb
  138. > apt-get install -f
  139. If there is a problem launching apache, because port is already used, change it into your chroot install with
  140. > vi /etc/apache2/ports.conf
  141. Then restart.
  142. Then you can call/test dolibarr with http://localhost:port/dolibarr/ . It can be also called FROM HOST (port must be a not used port on host).
  143. ##### Create/Maintain TCPDF package
  144. To update tcpdf package:
  145. * You can git clone tcpdf
  146. > git clone git.debian.org:/git/collab-maint/tcpdf.git [tcpdf-debian]
  147. or better
  148. > mkdir gitdebian
  149. > cd gitdebian
  150. > gbp-clone git.debian.org:/git/collab-maint/tcpdf.git
  151. * You can then create a PHP project from Eclipse called tcpdf-debian
  152. from git clone dir and make link to git.
  153. * If local branch upstream and pristine-tar does not exists, create it
  154. from origin/upstream and origin/pristine.
  155. * Into root dir, launch:
  156. > debian/get-orig-source.sh
  157. If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VERIFY_HOSTNAME=0" to solve this.
  158. * Some files are removed from archive by the get-orig-source.sh
  159. * Modify the tag file to replace sRGB.icc with correct free version and rename file into
  160. tcpdf_x.y.z+dfsgw.orig.tar.xz
  161. (x.y.z = version, w start from 1 and is increased for each new import)
  162. * Staying into git root directory, run
  163. > git-import-orig -vv ../tcpdf_x.y.z+dfsgw.orig.tar.xz --debian-branch=[master|jessie] --upstream-branch=[upstream|upstream-3.5.x]
  164. and enter version when requested with format
  165. x.y.z+dfsgw
  166. (x.y.z = version, w start from 1 and is increased for each new import)
  167. Note: If there was errors solved manually, you may need to make a git commit
  168. * Add an entry into debian/changelog
  169. > dch -v x.y.z+dfsgw-1 "My comment" will add entry.
  170. For example: dch -v x.y.z+dfsgw-1 "New upstream release." for a new version
  171. Then modify changelog to replace "version" or "unstable" with "UNRELEASED".
  172. Warning: Date must have format reported by "date -R"
  173. Warning: Name and email must match value into debian/control file (Entry added here is used by next step).
  174. * We try to build package
  175. > rm -fr ../build-area;
  176. > git-buildpackage -us -uc --git-debian-branch=[master|jessie] --git-upstream-branch=[upstream|upstream-x.y.z]
  177. ou
  178. > git-buildpackage -us -uc --git-ignore-branch --git-upstream-branch=[upstream|upstream-x.y.z]
  179. Note: To build an old version, do: git checkout oldtagname -b newbranchname; git-buildpackage -us -uc --git-debian-branch=newbranchname --git-upstream-branch=[upstream|upstream-3.5.x]
  180. Note: You can use git-buildpackage -us -uc --git-ignore-new if you want to test build with uncommited file
  181. Note: You can use git-buildpackage -us -uc -d if you want to test build when dependencies does not match
  182. Note: Package is built into directory ../build-area
  183. Note: To compare 2 packages: debdiff package1.dsc package2.dsc
  184. * Test package
  185. > cp ../build-area/* /srv/chroot/unstable/tmp
  186. See rest of process into dedicated chapter "To test a package" to test it with debian unstable env
  187. * If package .deb is ok:
  188. Note: If there was errors managed manually, you may need to make a git commit but do not use option "amend" previous commit
  189. > git push --all ou git push origin --all
  190. * If ok, you can tag.
  191. > Edit debian/changelog to replace "UNRELEASED" into "unstable", then push
  192. > git-buildpackage --git-tag-only --git-retag --git-debian-branch=[master|jessie] --git-upstream-branch=[upstream|upstream-3.5.x]
  193. > git push --tags
  194. * Compilation is then done by a debian developer and sent
  195. > sbuild ...
  196. > dput ...
  197. * Go into page. You should see new package into unstable.
  198. http://packages.qa.debian.org/t/tcpdf.html
  199. * Package will be into release when test will be moved as stable.
  200. ##### Create/Maintain dolibarr package
  201. To update dolibarr debian package when upstream (official version of external project) has changed:
  202. * You can git clone debian git repo
  203. > git clone git.debian.org:/git/collab-maint/dolibarr.git [dolibarr-debian]
  204. or better
  205. > cd ~; mkdir git-debian; cd git-debian
  206. > gbp-clone git.debian.org:/git/collab-maint/dolibarr.git
  207. * You can then create a PHP project from Eclipse called dolibarr-debian
  208. from git clone dir and make link to git.
  209. * If local branch upstream and pristine-tar does not exists, create it
  210. from origin/upstream and origin/pristine.
  211. * When new upstream is available onto sourceforge, launch:
  212. > debian/get-orig-source.sh
  213. If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VERIFY_HOSTNAME=0" to solve this.
  214. * Edit orig.tar.gz file to remove
  215. - debian
  216. - htdocs/includes/ckeditor
  217. - htdocs/includes/jquery/css
  218. - htdocs/includes/jquery/js
  219. - htdocs/includes/jquery/plugins/flot
  220. - htdocs/includes/jquery/plugins/multiselect
  221. - htdocs/includes/jquery/plugins/datatables
  222. - htdocs/includes/jszip
  223. - htdocs/includes/mike42
  224. - htdocs/includes/phpoffice
  225. - htdocs/includes/restler/framework/Luracast/Restler/explorer
  226. - htdocs/includes/swiftmailer
  227. - htdocs/includes/tcpdf or htdocs/includes/tecnickcom
  228. And rename file into
  229. dolibarr-x.y.z+dfsgw.tgz
  230. (x.y.z = version, w start from 1 and is increased for each new git-import-orig already done)
  231. * Staying into projet gitted root directory, run
  232. > git-import-orig -vv ../dolibarr-x.y.z+dfsgw.tgz --debian-branch=[master|jessie] --upstream-branch=[upstream|upstream-3.5.x]
  233. and enter version when requested with format
  234. x.y.z+dfsgw
  235. (x.y.z = version, w start from 1 and is increased for each new import)
  236. Note: If there was errors solved manually after get-orig-sources.sh, you may need to make a git commit
  237. * Update/fix debian/* files used to build package.
  238. At least, add an entry into debian/changelog with command
  239. > dch -v x.y.z+dfsgw-1 "My comment"
  240. For example: dch -v x.y.z+dfsgw-1 "New upstream release." for a new version (x.y.z = version, w start from 1 and increased for each new import)
  241. Then check/modify changelog to replace "version" or "unstable" with "UNRELEASED".
  242. Then check/modify also the user/date signature:
  243. - Date must have format reported by "date -R"
  244. - Name and email must match value into debian/control file (Entry added here is used by next step).
  245. To update dolibarr debian package when only files into debian has changed:
  246. * Change files and commit.
  247. * Add a line into changelog for version debian/x.y.z+dfsgw-v (increase the last v into 2, 3...)
  248. > dch -v x.y.z+dfsgw-v "My comment"
  249. * git tag will be added when package is pushed.
  250. To update dolibarr debian package when only files not into debian has changed:
  251. * Checkout the branch you want to work on: master of debian/...
  252. * Manually, add patches into debian/patches and update the file debian/series, or do the 2 steps with "quilt import filepatch.patch"
  253. * You can test patching of serie with "quilt push" (autant de fois que de patch). Avec "quilt pop -a", on revient a l'état du upstream sans les patch.
  254. * Update the debian/changelog to add entry of change.
  255. Once files has been prepared, it's time to test:
  256. * Try to build package
  257. > rm -fr ../build-area;
  258. > git-buildpackage -us -uc --git-debian-branch=[master|jessie] --git-upstream-branch=[upstream|upstream-jessie|upstream-3.5.x|3.5.5]
  259. ou
  260. > git-buildpackage -us -uc --git-ignore-branch --git-upstream-branch=[upstream|upstream-jessie|upstream-3.5.x|3.5.5]
  261. Note: To build an old version, do: git checkout oldtagname -b newbranchname; git-buildpackage -us -uc --git-debian-branch=newbranchname --git-upstream-branch=[upstream|upstream-jessie|upstream-3.5.x|3.5.5]
  262. Note: You can use git-buildpackage -us -uc --git-ignore-new if you want to test build with uncommited file
  263. Note: You can use git-buildpackage -us -uc -d if you want to test build when dependencies does not match
  264. Note: Package is built into directory ../build-area
  265. Note: To compare 2 packages: debdiff package1.dsc package2.dsc
  266. * Test package (see dedicated chapter to test it with debian unstable env)
  267. > sudo rm /srv/chroot/unstable/tmp/* >/dev/null 2>&1; cp ../build-area/* /srv/chroot/unstable/tmp
  268. See rest of process into dedicated chapter "To test a package" to test it with debian unstable env
  269. * If package .deb is ok:
  270. Note: If there was errors managed manually, you may need to make a git commit but do not use option "amend" previous commit
  271. > git push --all
  272. * If ok, you can tag.
  273. > Edit debian/changelog to replace "UNRELEASED" into "unstable", then push
  274. > git-buildpackage --git-tag-only --git-retag --git-debian-branch=[master|jessie] --git-upstream-branch=[upstream|upstream-3.5.x]
  275. > git push --tags
  276. * Compilation is then done by a debian developer and sent
  277. > sbuild ...
  278. > dput ...
  279. * Package arrives into FTPmaster taskboard with status NEW (pending upload). You can view it at:
  280. http://ftp-master.debian.org/new/
  281. * Once package is validated, you should see it into area unstable at:
  282. http://packages.qa.debian.org
  283. * Package will be into release when test will be moved as stable.
  284. ##### Send an unblock request to make a full update of a stable package
  285. Use this to move from unstable to testing.
  286. reportbug -B debian --smtphost=smtp.gmail.com:587 --smtpuser=xxxx --smtppasswd=yyyy --tls
  287. Choose package "release.debian.org"
  288. Then usertag "unblock"
  289. Then name of package "dolibarr"
  290. Fill message, for example:
  291. "Please unblock package dolibarr
  292. A security error CVE-2015-3935 was reported and is fixed into package 3.5.7.
  293. Note that package 3.5.7 contains not only fixed for bugs reported to debian. It includes other fixes, but they are all related to stability or security,
  294. so it is a better solution to validate this maintenance release than applying a patch of the only CVE-2015-3935.
  295. After discussion with ..., it appears that security holes are enough to request this unblock request."
  296. Use this to request an full update of a stable package
  297. reportbug -B debian --smtphost=smtp.gmail.com:587 --smtpuser=xxxx --smtppasswd=yyyy --tls
  298. Choose package "release.debian.org"
  299. Then usertag "unblock"
  300. Then name of package "dolibarr"
  301. Fill message, for example:
  302. "
  303. A security error CVE-2015-3935 was reported for Dolibarr ERP CRM package. This bug is fixed into official package 3.5.7 of Dolibarr.
  304. Package 3.5.7 is a maintenance release compared to 3.5.5 and contains only fixes. But not only bugs reported to debian, it includes also other fixes (but they are all related to stability or security).
  305. I think it is a better solution to validate this maintenance release based on the new upstream version of Dolibarr than applying a patch of the only CVE-2015-3935.
  306. Pro are:
  307. - It fixes all debian reported bugs (including security one)
  308. - It fixes also stability bugs
  309. - Patches were already tested because deployed and used by several thousands of users.
  310. - It is easier for package maintener to include this official set of fixes than applying one patch after one patch for each debian report or backported each patch into a dedicated version.
  311. - Debian maintenance version is inline with official project maintenance version (better when all fixes are not related to the way the software is packaged)
  312. Cons are:
  313. - The patch include more than the only one security reported fixes
  314. So I just need to know if it's ok to push such a version 3.5.7 (fixes for 3.5.* branch) instead of only one fix for only the few (the only) reported debian bugs,
  315. since it provides more stability and is for me a more secured process.
  316. "
  317. ##### Send an request to ask a simple fix of a stable package
  318. Use this to ask to apply patches on a stable version.
  319. reportbug -B debian --smtphost=smtp.gmail.com:587 --smtpuser=xxxx --smtppasswd=yyyy --tls
  320. Choose package "release.debian.org"
  321. Then usertag "jessie-pu" (if tags is not available in list, choose another one, and change it later into email content text)
  322. Then name of package "dolibarr"
  323. Fill message, for example:
  324. "Please unblock package dolibarr
  325. A security error CVE-2015-3935 was reported and is fixed into package 3.5.7.
  326. Note that package 3.5.7 contains not only fixed for bugs reported to debian. It includes other fixes, but they are all related to stability or security,
  327. so it is a better solution to validate this maintenance release than applying a patch of the only CVE-2015-3935.
  328. After discussion with ..., it appears that security holes are enough to request this unblock request."
  329. Note: If there is a response to ask more information, don't forget to remove the tag during answer.