Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add conditional build for offline/online builds (#1616)
Instead of autoconf swapping in a 0 or 1 for a `%define` variable in the `spec.in` file for `OFFLINE_BUILD`, add a conditional build. See [1] for how they work. With a conditional build, source rpms retain the ability to build with different options depending on how `rpmbuild` is called. This allows an offline (using `ovirt-engine-nodejs-modules`) or online (using `yarn install`) build from srpm to be selected at build time using `--with` or `--without` build options. Since at least copr builds chroots directly from a srpm, conditional builds can be used to change build options. With this change, an "online build" can be enabled simply by configuring the target chroot setting "without" to include "ovirt_use_nodejs_modules". Notes: - An offline build with `ovirt-engine-nodejs-modules` is the default - An online build using standard `yarn install` can be achieved by using `--without ovirt_use_nodejs_modules` on the call to rpmbuild - Setting env var `OFFLINE_BUILD=0` when calling `make rpm` will add the `--without` option, and run an offline build. This is the same behavior as previous. [1] - https://rpm-software-management.github.io/rpm/manual/conditionalbuilds.html
- Loading branch information