| 328 | == Generating debug packages == |
| 329 | |
| 330 | RPM can automatically extract debug info from the EXEs and DLLs built by the .spec file and put this info into a separate sub-package named `PACKAGE-debug` where PACKAGE is the main .spec package name. In order to do that, the following directive needs to be added to the .spec file (usually, after all package and sub-package definitions and before the `%prep` section, surrounded by empty lines): |
| 331 | {{{ |
| 332 | %debug_package |
| 333 | }}} |
| 334 | |
| 335 | Normally nothing else needs to be done, RPM will automatically handle all `*.exe`, `*.dll` and `*.pyd` files generated by your .spec. However, sometimes it's desirable to disable debug info generation for certain files. This may be done with the `%_strip_opts` definition placed at the beginning of the .spec file, e.g. as follows: |
| 336 | {{{ |
| 337 | # Exclude myfile*.dll from the processed files |
| 338 | %define _strip_opts --debuginfo -x "myfile*.dll" |
| 339 | |
| 340 | # Add *.mymod files to the default list of files to be processed |
| 341 | %define _strip_opts --debuginfo -i "*.mymod" |
| 342 | |
| 343 | # Process only *.mymod files (do not process default extensions at all) |
| 344 | %define _strip_opts --debuginfo -n "*.mymod" |
| 345 | }}} |
| 346 | |
| 347 | Note that if you don't need any debug info generation at all, simply remove the `%debug_package` macro from your .spec file and debug file generation will be automatically suppressed (all the debug info will be silently discarded from the executable files during the compression phase in such case). |
| 348 | |