Skip to content

Commit

Permalink
rpm spec: fix version numbering when building alpha, beta, rc
Browse files Browse the repository at this point in the history
We want to ensure smooth upgrades when doing rpm -U throughout the
release cycle so this change implements the scheme documented at:
http://fedoraproject.org/wiki/Packaging%3aNamingGuidelines#NonNumericRelease

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
  • Loading branch information
hallyn authored and stgraber committed Oct 29, 2013
1 parent 5da6aa8 commit 9588a6c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
13 changes: 12 additions & 1 deletion configure.ac
@@ -1,7 +1,18 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_INIT([lxc], [1.0.0.alpha2])
m4_define([lxc_version_major], 1)
m4_define([lxc_version_minor], 0)
m4_define([lxc_version_micro], 0)
m4_define([lxc_version_beta], [alpha2])

m4_define([lxc_version_base], [lxc_version_major.lxc_version_minor.lxc_version_micro])
m4_define([lxc_version],
[ifelse(lxc_version_beta, [], [lxc_version_base], [lxc_version_base.lxc_version_beta])])

AC_INIT([lxc], [lxc_version])
AC_SUBST(LXC_VERSION_BASE, lxc_version_base)
AC_SUBST(LXC_VERSION_BETA, lxc_version_beta)

AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_AUX_DIR([config])
Expand Down
18 changes: 14 additions & 4 deletions lxc.spec.in
Expand Up @@ -23,11 +23,21 @@
%global with_python %{?_with_python: 1} %{?!_with_python: 0}
%global with_lua %{?_with_lua: 1} %{?!_with_lua: 0}

# RPM needs alpha/beta/rc in Release: not Version: to ensure smooth
# package upgrades from alpha->beta->rc->release. For more info see:
# http://fedoraproject.org/wiki/Packaging%3aNamingGuidelines#NonNumericRelease
%if "x@LXC_VERSION_BETA@" != "x"
%global beta_rel @LXC_VERSION_BETA@
%global beta_dot .%{beta_rel}
%else
%global norm_rel 1
%endif

Name: @PACKAGE@
Version: @VERSION@
Release: 1%{?dist}
Version: @LXC_VERSION_BASE@
Release: %{?beta_rel:0.1.%{beta_rel}}%{?!beta_rel:%{norm_rel}}%{?dist}
URL: http://linuxcontainers.org
Source: http://linuxcontainers.org/downloads/%{name}-%{version}.tar.gz
Source: http://linuxcontainers.org/downloads/%{name}-%{version}%{?beta_dot}.tar.gz
Summary: Linux Containers userspace tools
Group: Applications/System
License: LGPLv2+
Expand Down Expand Up @@ -75,7 +85,7 @@ The %{name}-lua package contains %{name} bindings for lua.
%endif

%prep
%setup -q
%setup -q -n %{name}-%{version}%{?beta_dot}
%build
PATH=$PATH:/usr/sbin:/sbin %configure $args \
%if %{with_lua}
Expand Down

0 comments on commit 9588a6c

Please sign in to comment.