[Spice-devel] [vdagent-win PATCH] Do not use dash in rpm version

Pavel Grunt pgrunt at redhat.com
Wed Jul 26 15:27:30 UTC 2017


Hi,

Cool, looks good to me

I can confirm that thanks to this patch is possible to do things like:
   1. make dist
   2. md5sum vdagent-win-0.8.0.34-7b15.tar.xz > sources
   3. fedpkg srpm

And for instance use the srpm to create a build in koji/brew/copr....

On Wed, 2017-07-26 at 16:03 +0100, Frediano Ziglio wrote:
> RPM does not allow dash in version string.
> Remove everything after the dash (which should be the "dirty"
> git version).
> This make easier to run "make dist" followed by rpmbuild.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  configure.ac                | 2 ++
>  mingw-spice-vdagent.spec.in | 6 +++---
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> Maybe I should use sed 's,-,.,g' to just replace
> all dashes with dots ?

it is like s/-/./g so it looks more clean to me, but it's up to you :) Both
variants are ok

Pavel
> 
> diff --git a/configure.ac b/configure.ac
> index bb33075..dc75c25 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -38,6 +38,8 @@ AC_DEFINE_UNQUOTED([RC_PRODUCTVERSION_STR],
> "$RC_PRODUCTVERSION", [Resource prod
>  AC_DEFINE_UNQUOTED([RC_PRODUCTVERSION], [$RC_PRODUCTVERSION], [Resource
> product version])
>  BUILD_YEAR=`date +%Y`
>  AC_DEFINE_UNQUOTED([BUILD_YEAR], "$BUILD_YEAR", [Build year])
> +RPM_VERSION=`echo $PACKAGE_VERSION | sed 's,-.*,,'`
> +AC_SUBST([RPM_VERSION])
>  
>  # Check for programs
>  AC_PROG_CC
> diff --git a/mingw-spice-vdagent.spec.in b/mingw-spice-vdagent.spec.in
> index d25ea31..d129a7b 100644
> --- a/mingw-spice-vdagent.spec.in
> +++ b/mingw-spice-vdagent.spec.in
> @@ -16,13 +16,13 @@
>  %endif
>  
>  Name:           mingw-spice-vdagent
> -Version:        @VERSION@
> +Version:        @RPM_VERSION@
>  Release:        1%{?dist}%{?extra_release}
>  Summary:        MinGW Windows SPICE guest agent
>  
>  License:        GPLv2+
>  URL:            https://www.spice-space.org/
> -Source0:        vdagent-win-%{version}%{?_version_suffix}.tar.xz
> +Source0:        vdagent-win- at VERSION@%{?_version_suffix}.tar.xz
>  
>  BuildRequires:  mingw32-filesystem >= 23
>  BuildRequires:  mingw64-filesystem >= 23
> @@ -84,7 +84,7 @@ Features:
>    session and the client
>  
>  %prep
> -%setup -q -n vdagent-win-%{version}%{?_version_suffix}
> +%setup -q -n vdagent-win- at VERSION@%{?_version_suffix}
>  
>  %{mingw_debug_package}
>  


More information about the Spice-devel mailing list