Hi,
At the beginning of a .spec file there are some define. I wonder if one can set if-condition in the define such as:
Code:
...
%define profile_name @PROFILE_NAME@
...
if [ %{profile_name} == "test" ]
%define pkg_release @PACKAGE_RELEASE_TEST@
fi
if [[ %{profile_name} == "pbv-icf" ]]; then
%define pkg_release @PACKAGE_RELEASE_PBV-ICF@
fi
...
I've tried this but I got error message like:
Code:
[rpm] Building the RPM based on the pbv-icf-jboss-eap-6.2.1.spec file
[rpm] error: line 18: Unknown tag: if [ pbv-icf == "test" ]
This means the code "if [ %{profile_name} == "test" ]" is wrong.
Later I change this code as follow:
Code:
...
%if [ %{profile_name} == "test" ]
%define pkg_release @PACKAGE_RELEASE_TEST@
%endif
...
But I got another error:
Code:
...
[rpm] error: parse error in expression
[rpm] error: pbv-icf-jboss-eap-6.2.1.spec:18: parseExpressionBoolean returns -1
...
What could be the correct format for IF-condition?