Previously our NSIS project template hard-coded `$INSTDIR\bin` for
inclusion in the `PATH`. If the directory does not exist, nothing is
done. Use `CPACK_NSIS_EXECUTABLES_DIRECTORY` instead of `bin`.
Fixes: #15635
Since commit 302a645d73 (CPack/DEB: use `triggers` instead of legacy
postXXX scripts for `ldconfig`, 2026-03-05, v4.4.0-rc1~583^2) the
`triggers` feature refers to `DPKG_EXECUTABLE` if the latter is defined.
Unfortunately, it is defined only if one particular execution branch has
executed. Move the `find_program(dpkg)` to the function scope to make
it available in all execution branches.
Capture `execute_process` calls' `RESULT_VARIABLE`.
We don't actually need to check the result as we presume the existing
logic is already adequate, and sometimes programs return non-zero values
as result of valid query. I.e. this is a "safe" way to broadly protect
these scripts.
Issue: #27782
According to [this] commit message in the `rpmlint` codebase,
a %clean section is not necessary since `rpm` 4.8.0 (2010)
and nowadays `rpmlint` at least issues a warning about it, and
(seems) in some distros it's even considered as an error.
[this]: https://github.com/rpm-software-management/rpmlint/commit/b1a8a422
Ask `stat` to output only human-readable permissions and nothing else.
Secondly, simplify parsing algorithm. Instead of multiple regex matches
transform permissions into a list and split into groups.
Add a new variable `CPACK_DEBIAN_COMPRESSION_LEVEL` to control the compression
level used when generating Debian packages. This complements the existing
`CPACK_DEBIAN_COMPRESSION_TYPE` variable and allows finer control over the
compression performance vs. size trade-off. Supported values correspond to
the compression level accepted by the underlying compressor (e.g. gzip, xz,
zstd, etc.).
By setting CPACK_WIX_CAB_PER_COMPONENT users can generate one
.cab per component instead of one .cab per installer.
WiX compresses .cab files in parallel.
This may potentially speed up installer creation.
May also allow larger installers (there is a 2GB per .cab limit).
Enable the generation of NuGet symbol package(s) with the new variable
`CPACK_NUGET_SYMBOL_PACKAGE`. CPack generates then normal nuget package
(*.nupkg) and a symbol nuget package (*.snupkg). The new generate
package contains PDB files.
Fixes: #26976
283a48403f CPack/RPM: Fix detection of RPM support for weak dependencies
ab4e74ad0b CPack/RPM: Remove redundant conditions for presence of rpmbuild
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10403
Add a missing `find_program` call to populate `RPM_EXECUTABLE`.
This was left out of two previous changes that intended to query
the `rpm` executable:
* In commit 9b53eca317 (CPack/RPM: Fix weak dep support, 2021-06-29,
v3.21.0-rc2~4^2), without `RPM_EXECUTABLE` the query always failed,
so we were concluding that weak dependencies are not supported even
when they are.
* In commit 488de6294a (CPack: correctly perform querytags on old
versions of RPM, 2025-01-09, v4.0.0-rc1~182^2~3), without
`RPM_EXECUTABLE` the query always failed. This change has not
yet been in a release anyway.
Also fix the test case for the "suggests" field to verify this.
Issue: #22350
Reported-by: Balazs Kosaras <balazskosaras@gmail.com>
When a new installation prompts to uninstall the old version,
use the display name of the old version from the registry.
This only affects packages that change their CPACK_NSIS_DISPLAY_NAME.
Patch-by: David Golub <golubdr@gmail.com>
Fixes: #14112
In some versions of RPM, e.g. 4.0.4, rpmbuild does not understand
--querytags parameter, but rpm does. Such behavior was found on
Alt Linux P10 and Alt Linux Sisyphus (e2k).
Remove some edge cases where if CPACK_DEBIAN_PACKAGE_DEPENDS is a list
it would not be expanded on all components leaving some with ';'(s) in
the Depends field of the control file.
Same goes for using CPACK_DEBIAN_PACKAGE_SHLIBDEPS.
Add the `native0.0` framework to the list of allowed frameworks allowing
native (C/C++) NuGet packages. This extends commit 0f4d3664a9
(CPack/NuGet: Build dependencies in groups, 2024-06-01, v3.30.0-rc1~18^2).
Fixes: #26305