Skip to content

Commit

Permalink
Try to fix the %nil in stable builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Molkentin committed May 16, 2016
1 parent 22f5dc4 commit 9a1a7e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ Name: [% shortname %]-client
# Use translations from an external tarball in the package, or build them
# using the Qt tools? For distros where we do not have the tools, disable.

%if 0%{?centos_version} == 600 || 0%{?rhel_version} == 600 || 0%{?fedora_version} || "%{prerelease}" == ""
%if 0%{?centos_version} == 600 || 0%{?rhel_version} == 600 || 0%{?fedora_version} || 0%{?prerelease}
# For beta and rc versions we use the ~ notation, as documented in
# http://en.opensuse.org/openSUSE:Package_naming_guidelines
# Some distro's (centos_6) don't allow ~ characters. There we follow the Fedora guidelines,
# which suggests massaging the buildrelease number.
# Otoh: for openSUSE, this technique is discouraged by the package naming guidelines.
Version: %{base_version}
%if "%{prerelease}" == ""
%if 0%{?prerelease}
Release: 0
%else
Release: 0.<CI_CNT>.<B_CNT>.%{prerelease}
Expand Down Expand Up @@ -405,7 +405,7 @@ mkdir build
pushd build
# http://www.cmake.org/Wiki/CMake_RPATH_handling#Default_RPATH_settings
cmake .. -DWITH_DOC=TRUE \
%if "%{prerelease}" != ""
%if 0%{?prerelease}
-DMIRALL_VERSION_SUFFIX="%{prerelease}" \
-DMIRALL_VERSION_BUILD="[% buildjobid %]" \
%endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ Name: [% shortname %]-client
# Use translations from an external tarball in the package, or build them
# using the Qt tools? For distros where we do not have the tools, disable.

%if 0%{?centos_version} == 600 || 0%{?rhel_version} == 600 || 0%{?fedora_version} || "%{prerelease}" == ""
%if 0%{?centos_version} == 600 || 0%{?rhel_version} == 600 || 0%{?fedora_version} || 0%{?prerelease}
# For beta and rc versions we use the ~ notation, as documented in
# http://en.opensuse.org/openSUSE:Package_naming_guidelines
# Some distro's (centos_6) don't allow ~ characters. There we follow the Fedora guidelines,
# which suggests massaging the buildrelease number.
# Otoh: for openSUSE, this technique is discouraged by the package naming guidelines.
Version: %{base_version}
%if "%{prerelease}" == ""
%if 0%{?prerelease}
Release: 0
%else
Release: 0.<CI_CNT>.<B_CNT>.%{prerelease}
Expand Down Expand Up @@ -405,7 +405,7 @@ mkdir build
pushd build
# http://www.cmake.org/Wiki/CMake_RPATH_handling#Default_RPATH_settings
cmake .. -DWITH_DOC=TRUE \
%if "%{prerelease}" != ""
%if 0%{?prerelease}
-DMIRALL_VERSION_SUFFIX="%{prerelease}" \
-DMIRALL_VERSION_BUILD="[% buildjobid %]" \
%endif
Expand Down

1 comment on commit 9a1a7e8

@jnweiger
Copy link
Contributor

@jnweiger jnweiger commented on 9a1a7e8 May 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are all wrong, sorry. The %{?prerelease} syntax is used to catch the case, where the macro is undefined. This never happens. It is either defined as %nil (which evaluates to the empty but defined string), or it is defined to say gitXXX, betaXXX, or rcXXX

Some of the the above changes also invert the intended logic.

Please sign in to comment.