Skip to content

Commit

Permalink
Finally found the miracle macro that should work for all values + %nil
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Molkentin committed May 17, 2016
1 parent 2d7434a commit 1a1d58a
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} || ! 0%{?prerelease}
%if 0%{?centos_version} == 600 || 0%{?rhel_version} == 600 || 0%{?fedora_version} || 0%{?!prerelease:1}
# 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 ! 0%{?prerelease}
%if 0%{?!prerelease:1}
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 0%{?prerelease}
%if 0%{?prerelease:1}
-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} || ! 0%{?prerelease}
%if 0%{?centos_version} == 600 || 0%{?rhel_version} == 600 || 0%{?fedora_version} || 0%{?!prerelease:1}
# 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 ! 0%{?prerelease}
%if 0%{?!prerelease:1}
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 0%{?prerelease}
%if 0%{?prerelease:1}
-DMIRALL_VERSION_SUFFIX="%{prerelease}" \
-DMIRALL_VERSION_BUILD="[% buildjobid %]" \
%endif
Expand Down

1 comment on commit 1a1d58a

@jnweiger
Copy link
Contributor

@jnweiger jnweiger commented on 1a1d58a May 18, 2016

Choose a reason for hiding this comment

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

Where is the %{XXX:1} syntax defined? I have no idea what it should do. Please document.
Tested on CentOS7, it evaluates always true.

Please sign in to comment.