Hello again,

On 05/07/2013 01:19 AM, Willy Tarreau wrote:
Hi guys,

On Tue, May 07, 2013 at 12:54:29AM +0200, Lukas Tribus wrote:
Hi Clay!


I had a few more modifications to the spec file that I am
including to get the rpmbuild to finish successfully for us.

Ok.

I'm not familiar with spec files or rpm packaging at all,
so please bear with me. Also I have not tested this.

I'm attaching your patch in git format, so Willy and others
can review the patch.

Its an unspectacular change in examples/*, I think we should
include it.

I'm fine with it, but it will require me to modify my release scripts, so
before I merge it, does anyone know if there is a way in the spec file to
split a variable in two ? That way we could have full_version=1.5-dev18
and build both version and release from this ?

If it's not possible not trivial, then I'll adapt my release scripts.

Note that it proves how long spec files have not been used !

Thanks,
Willy



Is this along the lines of what you had in mind:

%define full_version 1.5-dev18
%define version %(echo %{full_version} | awk -F "-" '{print $1}')
%define release %(echo %{full_version} | awk -F "-" '{print $2}')
<snip>
Version: %{version}
Release: %{release}

Here is my current diff containing this and the previous discussed changes in comparison to the existing haproxy.spec in examples/:

# diff -u haproxy.spec.orig haproxy.spec
--- haproxy.spec.orig   2013-05-06 10:19:48.462440897 -0500
+++ haproxy.spec        2013-05-06 22:17:08.551225524 -0500
@@ -1,12 +1,16 @@
+%define full_version 1.5-dev18
+%define version %(echo %{full_version} | awk -F "-" '{print $1}')
+%define release %(echo %{full_version} | awk -F "-" '{print $2}')
+
Summary: HA-Proxy is a TCP/HTTP reverse proxy for high availability environments
 Name: haproxy
-Version: 1.5-dev18
-Release: 1
+Version: %{version}
+Release: %{release}
 License: GPL
 Group: System Environment/Daemons
 URL: http://haproxy.1wt.eu/
-Source0: http://haproxy.1wt.eu/download/1.5/src/devel/%{name}-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-root
+Source0: http://haproxy.1wt.eu/download/1.5/src/devel/%{name}-%{version}-%{release}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}.root
 BuildRequires: pcre-devel
 Requires: /sbin/chkconfig, /sbin/service

@@ -27,7 +31,7 @@
 risking the system's stability.

 %prep
-%setup -q
+%setup -q -n %{name}-%{version}-%{release}

 # We don't want any perl dependecies in this RPM:
 %define __perl_requires /bin/true


Reply via email to