virt-viewer/mingw-virt-viewer.spec.in
Daniel P. Berrange 28a6bd6cf4 Bump version 1.0 to simplify Windows MSI versioning
The Windows MSI product version is restricted to a 3 component
version number, whose fields are a max value of 255.255.65536

Since the main virt-viewer version takes up 3 components already,
we have the munge the micro version together with the first
component of the release version. eg we have

   $VERSION[0].$VERSION[1].($VERSION[2] << 8 + $RELEASE[0])

This causes problems for RHEL which needs to have 2-component
release versions to deal with z-stream builds.  eg a RHEL
version might be virt-viewer-0.5.6-2.el6_4.3 and we've
no easy way of adding the final '.3' to the Windows product
version.

If we reduce the primary virt-viewer version to just 2 components,
then we can leave the 3rd component for exclusive use by the RPM
release number. eg so we'd make product version up using

   $VERSION[0].$VERSION[1].($RELEASE[0] << 8 + $RELEASE[1])

In course of normal development, we'd increase the $VERSION[0]
for each release. ie next release is 1.0, then 2.0, then 3.0.
This means we retain the ability to put out "stable" branch
releases for any historical version by doing 1.1, 1.2 instead
of having to re-add a 3rd component.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-06-23 16:16:01 +01:00

167 lines
5.3 KiB
RPMSpec

%{?mingw_package_header}
%define relver 1%{?dist}
# We want the 1st part of the release number, and
# the 3rd part (or 0 if not present). We want to
# avoid the autobuild magic %{extra_release} too
# which is not purely numeric and larger than 255.
# This scheme lets us cope with RHEL-style z-stream
# versioning when creating Win product versions
%define rel0 %(echo %{relver} | cut -d. -f1)
%define rel1 %(test -z "`echo %{relver} | cut -d. -f3`" && echo 0 || (echo %{relver} | cut -d. -f3))
%define buildid %(expr %{rel0} \\* 256 + %{rel1})
Name: mingw-virt-viewer
Version: @VERSION@
Release: %{relver}%{?extra_release}
Summary: MinGW Windows virt-viewer console application
License: GPLv2+
Group: Applications/Internet
URL: http://virt-manager.org/
Source0: ftp://virt-manager.org/downloads/virt-viewer/virt-viewer-%{version}.tar.gz
BuildRequires: mingw32-filesystem >= 23
BuildRequires: mingw64-filesystem >= 23
BuildRequires: mingw32-glib2 >= @GLIB2_REQUIRED@
BuildRequires: mingw64-glib2 >= @GLIB2_REQUIRED@
BuildRequires: mingw32-gstreamer-plugins-bad-free
BuildRequires: mingw64-gstreamer-plugins-bad-free
BuildRequires: mingw32-gstreamer-plugins-good
BuildRequires: mingw64-gstreamer-plugins-good
BuildRequires: mingw32-gtk2 >= @GTK2_REQUIRED@
BuildRequires: mingw64-gtk2 >= @GTK2_REQUIRED@
BuildRequires: mingw32-libusbx
BuildRequires: mingw64-libusbx
BuildRequires: mingw32-libvirt >= @LIBVIRT_REQUIRED@
BuildRequires: mingw64-libvirt >= @LIBVIRT_REQUIRED@
BuildRequires: mingw32-libxml2 >= @LIBXML2_REQUIRED@
BuildRequires: mingw64-libxml2 >= @LIBXML2_REQUIRED@
BuildRequires: mingw32-gtk-vnc >= @GTK_VNC1_REQUIRED@
BuildRequires: mingw64-gtk-vnc >= @GTK_VNC1_REQUIRED@
BuildRequires: mingw32-readline
BuildRequires: mingw64-readline
BuildRequires: mingw32-spice-glib
BuildRequires: mingw64-spice-glib
BuildRequires: mingw32-spice-gtk >= @SPICE_GTK_REQUIRED@
BuildRequires: mingw64-spice-gtk >= @SPICE_GTK_REQUIRED@
BuildRequires: mingw32-usbredir
BuildRequires: mingw64-usbredir
BuildRequires: pkgconfig
BuildRequires: /usr/bin/pod2man
BuildRequires: intltool
BuildRequires: icoutils
BuildRequires: dos2unix
BuildRequires: hicolor-icon-theme
BuildRequires: gnome-icon-theme
BuildRequires: msitools >= 0.92-2
BuildArch: noarch
%package -n mingw32-virt-viewer
Summary: MinGW Windows virt-viewer console application
Group: Applications/Internet
%package -n mingw64-virt-viewer
Summary: MinGW Windows virt-viewer console application
Group: Applications/Internet
%package -n mingw64-virt-viewer-msi
Summary: MinGW Windows virt-viewer MSI
Group: Applications/Internet
%package -n mingw32-virt-viewer-msi
Summary: MinGW Windows virt-viewer MSI
Group: Applications/Internet
%description
MinGW Windows virt-viewer console application
%description -n mingw32-virt-viewer
MinGW Windows virt-viewer console application
%description -n mingw64-virt-viewer
MinGW Windows virt-viewer console application
%description -n mingw64-virt-viewer-msi
MinGW Windows virt-viewer MSI
%description -n mingw32-virt-viewer-msi
MinGW Windows virt-viewer MSI
%{mingw_debug_package}
%prep
%setup -q -n virt-viewer-%{version}
%build
%mingw_configure --with-gtk=2.0 --with-buildid=%{buildid}
%mingw_make %{?_smp_mflags} V=1
%mingw_make %{?_smp_mflags} V=1 -C data msi
%install
%mingw_make_install DESTDIR=$RPM_BUILD_ROOT
%if 0%{?mingw_build_win32} == 1
cp build_win32$MINGW_BUILDDIR_SUFFIX/data/virt-viewer-x86-@VERSION@.msi $RPM_BUILD_ROOT/%{mingw32_datadir}/virt-viewer
%endif
%if 0%{?mingw_build_win64} == 1
cp build_win64$MINGW_BUILDDIR_SUFFIX/data/virt-viewer-x64-@VERSION@.msi $RPM_BUILD_ROOT/%{mingw64_datadir}/virt-viewer
%endif
%find_lang virt-viewer
# Don't need the XDG desktop files on Windows
find $RPM_BUILD_ROOT -name "*.desktop" -delete
%clean
rm -rf $RPM_BUILD_ROOT
%files -n mingw32-virt-viewer -f virt-viewer.lang
%defattr(-,root,root)
%{mingw32_bindir}/virt-viewer.exe
%{mingw32_bindir}/remote-viewer.exe
%{mingw32_bindir}/windows-cmdline-wrapper.exe
%{mingw32_bindir}/debug-helper.exe
%dir %{mingw32_datadir}/virt-viewer/
%dir %{mingw32_datadir}/virt-viewer/ui/
%{mingw32_datadir}/virt-viewer/ui/virt-viewer.xml
%{mingw32_datadir}/virt-viewer/ui/virt-viewer-about.xml
%{mingw32_datadir}/virt-viewer/ui/virt-viewer-auth.xml
%{mingw32_datadir}/icons/hicolor/*/apps/*
%{mingw32_datadir}/icons/hicolor/*/devices/*
%{mingw32_mandir}/man1/virt-viewer.1*
%{mingw32_mandir}/man1/remote-viewer.1*
%files -n mingw32-virt-viewer-msi
%{mingw32_datadir}/virt-viewer/virt-viewer-x86-@VERSION@.msi
%files -n mingw64-virt-viewer -f virt-viewer.lang
%defattr(-,root,root)
%{mingw64_bindir}/virt-viewer.exe
%{mingw64_bindir}/remote-viewer.exe
%{mingw64_bindir}/windows-cmdline-wrapper.exe
%{mingw64_bindir}/debug-helper.exe
%dir %{mingw64_datadir}/virt-viewer/
%dir %{mingw64_datadir}/virt-viewer/ui/
%{mingw64_datadir}/virt-viewer/ui/virt-viewer.xml
%{mingw64_datadir}/virt-viewer/ui/virt-viewer-about.xml
%{mingw64_datadir}/virt-viewer/ui/virt-viewer-auth.xml
%{mingw64_datadir}/icons/hicolor/*/apps/*
%{mingw64_datadir}/icons/hicolor/*/devices/*
%{mingw64_mandir}/man1/virt-viewer.1*
%{mingw64_mandir}/man1/remote-viewer.1*
%files -n mingw64-virt-viewer-msi
%{mingw64_datadir}/virt-viewer/virt-viewer-x64-@VERSION@.msi
%changelog