]> git.proxmox.com Git - mirror_lxc.git/commitdiff
rpm spec: fix version numbering when building alpha, beta, rc
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 29 Oct 2013 17:48:46 +0000 (12:48 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 29 Oct 2013 18:50:07 +0000 (14:50 -0400)
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>
configure.ac
lxc.spec.in

index 2066952dd1cffb338bd909b475d22d857b03fc7b..9fedf55a1bdd8c64223880e6b01ed8b7b3a414df 100644 (file)
@@ -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])
index 0f7f22fda12b525cb43cb7d92ee057aa0c156b80..a6c96a23df40f239f904f43758aee58da3fc8f74 100644 (file)
 %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+
@@ -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}