43 | | stop at 53:28 |
| 43 | Source and Maintainer are the only required fields in the source paragraph of the control file. |
| 44 | |
| 45 | Binary paragraph: |
| 46 | Package name: (need not be the same) |
| 47 | Architecture: any (but must be compiled for each) vs all (works on all) |
| 48 | Description: multi-line values must be indented on subsequent lines |
| 49 | - single space indent can be re-flowed |
| 50 | - 2 space indent must be displayed as is |
| 51 | - single dot on a line indicates blank line but not field break |
| 52 | |
| 53 | Depends: |
| 54 | - explicit dependencies, must be installed |
| 55 | - shared libraries (shlibdeps) |
| 56 | -- ldd example |
| 57 | -- dpkg-shlibdeps, uses ldd, then looks for packages, subs them in |
| 58 | - version dependencies, dpkg --compare-versions, etc, logical OR, etc |
| 59 | --- don't put in deps by hand if thye're purely shared lib dependencies, dpkg will deal |
| 60 | -- disjunctive dependencies ("OR") |
| 61 | --- APT looks through package list to see if any of the packages are installed. If they do, success. |
| 62 | ---- if not, look at beginning of list, try to install that, if succeeds, success. If not, try next. |
| 63 | ---- don't misuse them for optional deps (e.g. foo | basefiles), because basefiles will always satisfy it, and it'll never try foo. |
| 64 | |
| 65 | Recommendations: |
| 66 | - attempt to satisfy, but don't fail. |
| 67 | |
| 68 | Suggests: |
| 69 | - metadata only |
| 70 | |
| 71 | Do not depend on "Essential" packages, unless you need a specific version |
| 72 | |
| 73 | List of dependencies should be what _you_ need/interact with. e.g. If you need 'a' and 'b', and 'a' depends 'b', you still need both, don't just dpend on 'a', because it might change. Simultaneously, if you use 'a', and you _know_ that 'a' dependss on 'b', but you're not using 'b', don't depend on 'b'. Yes, this means that if you depend on 'a', and 'a' screws up their packaging, it won't work, but that's their problem. |
| 74 | |
| 75 | Build-Depends: Things needed to _build_ the package, but not to _run_ it. But don't build-dep on a C compiler, because there are build-essential packages. /usr/share/doc/build-essential.list |
| 76 | |
| 77 | |
| 78 | == SESSION 2 == |
| 79 | |
| 80 | Quiz: List some arch all/any packages. |
| 81 | Which rules targets must be run as root/fakeroot? |
| 82 | Difference between build-depends and depends. |
| 83 | |
| 84 | Maintainer scripts: |
| 85 | - preinst, postinst, prerm, postrm |
| 86 | - all shell scripts, called in a variety of ways -- some take the _new_ version as args, others take old version |
| 87 | - talking about fixing up from previous screwups |
| 88 | - giant case statement, you should use the dhmakeexample |
| 89 | |
| 90 | Talk about dpkg transactions, remove vs purge. |
| 91 | link to order of transactions diagram, and link to policy |
| 92 | |
| 93 | Idempotence. The postinst is quite likely to be run multiple times. |
| 94 | talk about "set -e" |
| 95 | doesn't _have_ to be in shell, but should be. |
| 96 | shell idiom " || :" (if this fails, don't error out) (|| true is more readble and equal nowadays) |
| 97 | "something || [ $? = 123 ]" so if something returns 123, it's not an error, but other error codes might be |
| 98 | |
| 99 | |
| 100 | Debhelper: |
| 101 | -hello vs hello-debhelper |
| 102 | |
| 103 | dh_foo, each one corresponds to a step |
| 104 | -- abstract concrete tasks, e.g. dh_compress will compress what needs to be compressed |
| 105 | |
| 106 | Also, the presence of some files (e.g. .install, .dirs) will trigger these operations or act as input for them. TODO clarify this. |
| 107 | |
| 108 | stop at 36:00 |