On 05/06/2013 11:41 AM, Lukas Tribus wrote:
Hi Clay!


When attempting to build from the latest 1.5-dev18 haproxy.spec
file I receive the following error:

# rpmbuild -bb haproxy.spec
error: line 3: Illegal char '-' in: Version: 1.5-dev18

I see. "Version" doesn't like the hyphen [1]. Could we put the dev18
in "Release" instead? This has been suggested here [2].

Clay, can you give this a try (see the patch above)? Please also
check that you see the "dev18" where you would expect it.


Regards,
Lukas

[1] http://lists.opensuse.org/archive/opensuse-packaging/2011-08/msg00088.html
[2] http://www.redhat.com/archives/rpm-list/2005-April/msg00012.html


<snip>

Thanks Lukas. New to the list, my apologies for not being aware of your references prior to posting.

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

Here is the complete diff from my spec that built and the original that was included 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 13:52:05.591125616 -0500
@@ -1,12 +1,12 @@
Summary: HA-Proxy is a TCP/HTTP reverse proxy for high availability environments
 Name: haproxy
-Version: 1.5-dev18
-Release: 1
+Version: 1.5
+Release: dev18
 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 +27,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
---

I think that works for us. The RPM built will look like this:

haproxy-1.5-dev18.x86_64.rpm

Versus having the -1 "version" in the RPM.

i.e. haproxy-1.5dev18-1.x86_64.rpm.

You'll notice the modified filename with my original work around removing the "-" from the Version value. This would work for us and when 1.5 drops the "dev" we could then go back to the more standard Version and Release usage that is common amongst the RedHat and comparable systems.

Let me know if there are any other thoughts or input from others on the list. Also, feel free to use any of our modifications if you feel they would benefit others.

Clay


Reply via email to