Linux cpanel.rrshost.in 5.15.0-25-generic #25-Ubuntu SMP Wed Mar 30 15:54:22 UTC 2022 x86_64
Apache
: 109.123.238.221 | : 172.70.80.42
128 Domain
8.2.28
aev999
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
rpm /
[ HOME SHELL ]
Name
Size
Permission
Action
CREDITS
3.66
KB
-rw-r--r--
NEWS.Debian.gz
686
B
-rw-r--r--
README
603
B
-rw-r--r--
README.Debian
1.19
KB
-rw-r--r--
arch_dependencies.md.gz
2.23
KB
-rw-r--r--
autosetup.md.gz
1.82
KB
-rw-r--r--
boolean_dependencies.md
3.67
KB
-rw-r--r--
buildprocess.md
1.09
KB
-rw-r--r--
buildroot.md
3.54
KB
-rw-r--r--
changelog.Debian.gz
2.49
KB
-rw-r--r--
conditionalbuilds.md
1.69
KB
-rw-r--r--
copyright
1.86
KB
-rw-r--r--
dependencies.md.gz
3.73
KB
-rw-r--r--
dependency_generators.md.gz
3.49
KB
-rw-r--r--
file_triggers.md
3.97
KB
-rw-r--r--
format.md.gz
3.95
KB
-rw-r--r--
hregions.md
2.8
KB
-rw-r--r--
index.md
1.29
KB
-rw-r--r--
large_files.md
2.58
KB
-rw-r--r--
lua.md.gz
3.68
KB
-rw-r--r--
macros.md.gz
4.79
KB
-rw-r--r--
more_dependencies.md.gz
2.84
KB
-rw-r--r--
multiplebuilds.md
1.83
KB
-rw-r--r--
plugins.md.gz
1.7
KB
-rw-r--r--
queryformat.md.gz
2.34
KB
-rw-r--r--
relocatable.md
1.92
KB
-rw-r--r--
scriptlet_expansion.md.gz
2.05
KB
-rw-r--r--
signatures.md
2.46
KB
-rw-r--r--
signatures_digests.md
1.48
KB
-rw-r--r--
spec.md.gz
6.98
KB
-rw-r--r--
tags.md.gz
4.79
KB
-rw-r--r--
triggers.md.gz
1.94
KB
-rw-r--r--
tsort.md.gz
2.17
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : conditionalbuilds.md
--- layout: default title: rpm.org - Conditional Builds --- # Conditional Builds Rpmbuild supports conditional package builds with the command line switches `--with` and `--without`. Here is an example of how to enable gnutls and disable openssl support: ``` $ rpmbuild -ba newpackage.spec --with gnutls --without openssl ``` ## Enable `--with`/`--without` parameters To use this feature in a spec file, add this to the beginning of the file: ``` # add --with gnutls option, i.e. disable gnutls by default %bcond_with gnutls # add --without openssl option, i.e. enable openssl by default %bcond_without openssl ``` If you want to change whether or not an option is enabled by default, only change `%bcond_with` to `%bcond_without` or vice versa. In such a case, the remainder of the spec file can be left unchanged. ## Check whether an option is enabled or disabled To define `BuildRequires` depending on the command-line switch, you can use the `%{with foo}` macro: ``` %if %{with gnutls} BuildRequires: gnutls-devel %endif %if %{with openssl} BuildRequires: openssl-devel %endif ``` Alternatively, you can test the presence (or lack thereof) of `%with_foo` macros which is nicer in other situations, e.g.: ``` %configure \ %{?with_static:--enable-static} \ %{!?with_static:--disable-static} ``` Always test for the `with`-condition, not the `without`-counterpart! ## Pass it to `%configure` To pass options to configure or other scripts that understand a `--with-foo` or `--without-foo` parameter, you can use the `%{?_with_foo}` macro: ``` %configure \ %{?_with_gnutls} \ %{?_with_openssl} ``` ## References * [macros](https://github.com/rpm-software-management/rpm/blob/master/macros.in)
Close