[spice-protocol] build-sys: Provide spec file during build

Submitted by Frediano Ziglio on Jan. 31, 2019, 10:34 a.m.

Details

Message ID 20190131103427.26229-1-fziglio@redhat.com
State New
Headers show
Series "build-sys: Provide spec file during build" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio Jan. 31, 2019, 10:34 a.m.
Having the RPM spec file produced by the build is helpful in
different situation. Different tools like mock or code
scanners accept source RPMs as input.
Providing this file allows easily build of the source RPM (and
binaries) using a simple command like

  $ rpmbuild -ta spice-protocol-XXXX.tar.bz2

The spec proposed is a port of current Red Hat spec combining with
MingW one which allows to build MingW packages easily with a

  $ rpmbuild --with mingw -ta spice-protocol-XXXX.tar.bz2

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
---
 Makefile.am            |   2 +-
 configure.ac           |   1 +
 spice-protocol.spec.in | 206 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 208 insertions(+), 1 deletion(-)
 create mode 100644 spice-protocol.spec.in

Patch hide | download patch | download mbox

diff --git a/Makefile.am b/Makefile.am
index c464fa7..2cc1ea2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,6 +22,6 @@  MAINTAINERCLEANFILES =						\
 	`find "$(srcdir)" -type f -name Makefile.in -print`	\
 	$(NULL)
 
-EXTRA_DIST = meson.build
+EXTRA_DIST = meson.build spice-protocol.spec
 
 -include $(top_srcdir)/git.mk
diff --git a/configure.ac b/configure.ac
index eb1b314..e64ea6c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,4 +18,5 @@  AC_OUTPUT([
 Makefile
 spice-protocol.pc
 spice/Makefile
+spice-protocol.spec
 ])
diff --git a/spice-protocol.spec.in b/spice-protocol.spec.in
new file mode 100644
index 0000000..5094fe8
--- /dev/null
+++ b/spice-protocol.spec.in
@@ -0,0 +1,206 @@ 
+%bcond_with mingw
+%if %{with mingw}
+Name:           mingw-spice-protocol
+%else
+Name:           spice-protocol
+%endif
+Version:        @VERSION@
+Release:        1%{?dist}
+Summary:        Spice protocol header files
+Group:          Development/Libraries
+# Main headers are BSD, controller / foreign menu are LGPL
+License:        BSD and LGPLv2+
+URL:            http://www.spice-space.org/
+Source0:        http://www.spice-space.org/download/releases/spice-protocol-%{version}.tar.bz2
+BuildArch:      noarch
+%if %{with mingw}
+BuildRequires:  mingw32-filesystem >= 95
+BuildRequires:  mingw64-filesystem >= 95
+%endif
+
+
+%description
+Header files describing the spice protocol
+and the para-virtual graphics card QXL.
+
+
+%if %{with mingw}
+%package -n mingw32-spice-protocol
+Summary:        Spice protocol header files
+Requires:       pkgconfig
+
+%description -n mingw32-spice-protocol
+Header files describing the spice protocol
+and the para-virtual graphics card QXL.
+
+%package -n mingw64-spice-protocol
+Summary:        Spice protocol header files
+Requires:       pkgconfig
+
+%description -n mingw64-spice-protocol
+Header files describing the spice protocol
+and the para-virtual graphics card QXL.
+%endif
+
+
+%prep
+%setup -q -n spice-protocol-%{version}
+
+%build
+%if %{with mingw}
+%mingw_configure
+%mingw_make %{?_smp_mflags} V=1
+%else
+%configure
+make %{?_smp_mflags}
+%endif
+
+%install
+%if %{with mingw}
+%mingw_make install DESTDIR=%{buildroot}
+%else
+make DESTDIR=%{buildroot} install
+%endif
+
+
+%if %{with mingw}
+
+%files -n mingw32-spice-protocol
+%doc COPYING NEWS
+%{mingw32_includedir}/spice-1
+%{mingw32_datadir}/pkgconfig/spice-protocol.pc
+
+%files -n mingw64-spice-protocol
+%doc COPYING NEWS
+%{mingw64_includedir}/spice-1
+%{mingw64_datadir}/pkgconfig/spice-protocol.pc
+
+%else
+
+%files
+%doc COPYING NEWS
+%{_includedir}/spice-1
+%{_datadir}/pkgconfig/spice-protocol.pc
+
+%endif
+
+
+%changelog
+* Wed Jul 12 2017 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.12.13-1
+- Update to 0.12.13 release
+
+* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.12-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
+
+* Fri Aug 05 2016 Christophe Fergeau <cfergeau@redhat.com> - 0.12.12-1
+- Update to 0.12.12 release
+
+* Fri Mar 11 2016 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.12.11-1
+- Update to 0.12.11 release
+
+* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.10-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
+
+* Thu Oct 01 2015 Christophe Fergeau <cfergeau@redhat.com> 0.12.10-1
+- Update to 0.12.10 - Add python scripts and .proto files used
+  to generate spice-gtk/spice-server marshalling C code
+
+* Wed Jul 29 2015 Christophe Fergeau <cfergeau@redhat.com> 0.12.9-1
+- Update to 0.12.9 - Fixes QEMU build failures when using 0.12.8 with
+  spice-server 0.12.5
+
+* Tue Jun 30 2015 Christophe Fergeau <cfergeau@redhat.com> 0.12.8-1
+- Update to 0.12.8
+
+* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12.7-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
+
+* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12.7-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
+
+* Mon May 19 2014 Christophe Fergeau <cfergeau@redhat.com> 0.12.7-1
+- Update to 0.12.7
+
+* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12.6-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
+
+* Wed Jul  3 2013 Hans de Goede <hdegoede@redhat.com> - 0.12.6-1
+- Update to 0.12.6
+
+* Thu Mar  7 2013 Hans de Goede <hdegoede@redhat.com> - 0.12.5-1
+- Update to 0.12.5
+
+* Fri Feb  1 2013 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.12.4-1
+- Update to 0.12.4
+
+* Thu Dec 20 2012 Hans de Goede <hdegoede@redhat.com> - 0.12.3-1
+- Update to 0.12.3
+
+* Fri Sep 28 2012 Hans de Goede <hdegoede@redhat.com> - 0.12.2-1
+- Update to 0.12.2
+
+* Thu Sep 6 2012 Soren Sandmann <ssp@redhat.com> - 0.12.1-1
+- Add patch1 and patch2 to support capability bits
+
+* Thu Sep 6 2012 Soren Sandmann <ssp@redhat.com> - 0.12.1-1
+- Update to 0.12.1
+
+* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.1-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Mon Jan 16 2012 Hans de Goede <hdegoede@redhat.com> - 0.10.1-1
+- Update to 0.10.1
+
+* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.0-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
+* Sun Nov 13 2011 Alon Levy <alevy@redhat.com> - 0.10.0-1
+- Update to 0.10.0
+
+* Sun Oct 23 2011 Alon Levy <alevy@redhat.com> - 0.9.1-1
+- Update to 0.9.1
+
+* Thu Aug 25 2011 Hans de Goede <hdegoede@redhat.com> - 0.9.0-1
+- Update to 0.9.0
+
+* Mon Jul 25 2011 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.8.1-2
+- Added spice-protocol-0.8.1-define-INLINE.patch
+
+* Tue Jul 19 2011 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.8.1-1
+- Update to 0.8.1
+
+* Tue Mar  1 2011 Hans de Goede <hdegoede@redhat.com> - 0.8.0-1
+- Update to 0.8.0
+
+* Fri Feb 11 2011 Hans de Goede <hdegoede@redhat.com> - 0.7.1-1
+- Update to 0.7.1
+
+* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.0-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Wed Jan 12 2011 Hans de Goede <hdegoede@redhat.com> - 0.7.0-2
+- Update License tag (controller and foreign menu headers are LGPL)
+
+* Fri Dec 17 2010 Hans de Goede <hdegoede@redhat.com> - 0.7.0-1
+- Update to 0.7.0
+
+* Mon Oct 18 2010 Hans de Goede <hdegoede@redhat.com> - 0.6.3-1
+- Update to 0.6.3
+
+* Thu Sep 30 2010 Gerd Hoffmann <kraxel@redhat.com> - 0.6.1-1
+- Update to 0.6.1.
+
+* Tue Aug 31 2010 Alexander Larsson <alexl@redhat.com> - 0.6.0-1
+- Update to 0.6.0 (stable release)
+
+* Tue Jul 20 2010 Alexander Larsson <alexl@redhat.com> - 0.5.3-1
+- Update to 0.5.3
+
+* Mon Jul 12 2010 Gerd Hoffmann <kraxel@redhat.com> - 0.5.2-2
+- Fix license: It is BSD, not GPL.
+- Cleanup specfile, drop bits not needed any more with
+  recent rpm versions (F13+).
+
+* Fri Jul 9 2010 Gerd Hoffmann <kraxel@redhat.com> - 0.5.2-1
+- initial package.
+

Comments

On Thu, Jan 31, 2019 at 10:34:27AM +0000, Frediano Ziglio wrote:
> Having the RPM spec file produced by the build is helpful in
> different situation. Different tools like mock or code
> scanners accept source RPMs as input.
> Providing this file allows easily build of the source RPM (and
> binaries) using a simple command like
> 
>   $ rpmbuild -ta spice-protocol-XXXX.tar.bz2
> 
> The spec proposed is a port of current Red Hat spec combining with
> MingW one which allows to build MingW packages easily with a
> 
>   $ rpmbuild --with mingw -ta spice-protocol-XXXX.tar.bz2
> 
> Signed-off-by: Frediano Ziglio <fziglio@redhat.com>

Are you planning to push for this file to be used for RHEL/fedora
builds? Or is this going to be a 3rd spec file to maintain?

Christophe
> On Thu, Jan 31, 2019 at 10:34:27AM +0000, Frediano Ziglio wrote:
> > Having the RPM spec file produced by the build is helpful in
> > different situation. Different tools like mock or code
> > scanners accept source RPMs as input.
> > Providing this file allows easily build of the source RPM (and
> > binaries) using a simple command like
> > 
> >   $ rpmbuild -ta spice-protocol-XXXX.tar.bz2
> > 
> > The spec proposed is a port of current Red Hat spec combining with
> > MingW one which allows to build MingW packages easily with a
> > 
> >   $ rpmbuild --with mingw -ta spice-protocol-XXXX.tar.bz2
> > 
> > Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
> 
> Are you planning to push for this file to be used for RHEL/fedora
> builds? Or is this going to be a 3rd spec file to maintain?
> 
> Christophe
> 

It would be great to have a single one.
I don't know if this is technically possible and how to do it.
I think fedpkg requires to have the spec in the git repository,
I suppose we can say to copy and save from the project repository
one.

Frediano
On Thu, Jan 31, 2019 at 08:37:14AM -0500, Frediano Ziglio wrote:
> > On Thu, Jan 31, 2019 at 10:34:27AM +0000, Frediano Ziglio wrote:
> > > Having the RPM spec file produced by the build is helpful in
> > > different situation. Different tools like mock or code
> > > scanners accept source RPMs as input.
> > > Providing this file allows easily build of the source RPM (and
> > > binaries) using a simple command like
> > > 
> > >   $ rpmbuild -ta spice-protocol-XXXX.tar.bz2
> > > 
> > > The spec proposed is a port of current Red Hat spec combining with
> > > MingW one which allows to build MingW packages easily with a
> > > 
> > >   $ rpmbuild --with mingw -ta spice-protocol-XXXX.tar.bz2
> > > 
> > > Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
> > 
> > Are you planning to push for this file to be used for RHEL/fedora
> > builds? Or is this going to be a 3rd spec file to maintain?
> > 
> > Christophe
> > 
> 
> It would be great to have a single one.
> I don't know if this is technically possible and how to do it.
> I think fedpkg requires to have the spec in the git repository,
> I suppose we can say to copy and save from the project repository
> one.

I'm not asking that fedpkg gets the .spec file from the tarball and use
that, I'm merely asking if you have plans to unify the file used in
fedora/rhel and in the tarball. It's fine with me if the same file is
committed to 3 different places (upstream git, fedora dist-git, rhel
dist-git). I'm less fine with these 3 spec files being maintained
separately with arbitrary differences.

Christophe
> On Thu, Jan 31, 2019 at 08:37:14AM -0500, Frediano Ziglio wrote:
> > > On Thu, Jan 31, 2019 at 10:34:27AM +0000, Frediano Ziglio wrote:
> > > > Having the RPM spec file produced by the build is helpful in
> > > > different situation. Different tools like mock or code
> > > > scanners accept source RPMs as input.
> > > > Providing this file allows easily build of the source RPM (and
> > > > binaries) using a simple command like
> > > > 
> > > >   $ rpmbuild -ta spice-protocol-XXXX.tar.bz2
> > > > 
> > > > The spec proposed is a port of current Red Hat spec combining with
> > > > MingW one which allows to build MingW packages easily with a
> > > > 
> > > >   $ rpmbuild --with mingw -ta spice-protocol-XXXX.tar.bz2
> > > > 
> > > > Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
> > > 
> > > Are you planning to push for this file to be used for RHEL/fedora
> > > builds? Or is this going to be a 3rd spec file to maintain?
> > > 
> > > Christophe
> > > 
> > 
> > It would be great to have a single one.
> > I don't know if this is technically possible and how to do it.
> > I think fedpkg requires to have the spec in the git repository,
> > I suppose we can say to copy and save from the project repository
> > one.
> 
> I'm not asking that fedpkg gets the .spec file from the tarball and use
> that, I'm merely asking if you have plans to unify the file used in
> fedora/rhel and in the tarball. It's fine with me if the same file is
> committed to 3 different places (upstream git, fedora dist-git, rhel
> dist-git). I'm less fine with these 3 spec files being maintained
> separately with arbitrary differences.
> 
> Christophe
> 

My idea was to have one. The one I sent seems different from everything
but it is just because is a single one for both MingW and not MingW, if
you remove the MingW part is (except the changelog) exactly the same as
Fedora version.
As discussed on IRC probably the packager could want to add some
patches or other minor changes so it's reasonable if the spec get
changed but I would try to keep it in sync with the upstream one.
I should probably separate and have an initial spec with just Fedora
version and then add (if agreed) the MingW part.

I also wanted to know what people think about having a spec file
upstream as all our project don't have it.

Frediano
Hi

On Thu, Jan 31, 2019 at 7:18 PM Frediano Ziglio <fziglio@redhat.com> wrote:
>
> > On Thu, Jan 31, 2019 at 08:37:14AM -0500, Frediano Ziglio wrote:
> > > > On Thu, Jan 31, 2019 at 10:34:27AM +0000, Frediano Ziglio wrote:
> > > > > Having the RPM spec file produced by the build is helpful in
> > > > > different situation. Different tools like mock or code
> > > > > scanners accept source RPMs as input.
> > > > > Providing this file allows easily build of the source RPM (and
> > > > > binaries) using a simple command like
> > > > >
> > > > >   $ rpmbuild -ta spice-protocol-XXXX.tar.bz2
> > > > >
> > > > > The spec proposed is a port of current Red Hat spec combining with
> > > > > MingW one which allows to build MingW packages easily with a
> > > > >
> > > > >   $ rpmbuild --with mingw -ta spice-protocol-XXXX.tar.bz2
> > > > >
> > > > > Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
> > > >
> > > > Are you planning to push for this file to be used for RHEL/fedora
> > > > builds? Or is this going to be a 3rd spec file to maintain?
> > > >
> > > > Christophe
> > > >
> > >
> > > It would be great to have a single one.
> > > I don't know if this is technically possible and how to do it.
> > > I think fedpkg requires to have the spec in the git repository,
> > > I suppose we can say to copy and save from the project repository
> > > one.
> >
> > I'm not asking that fedpkg gets the .spec file from the tarball and use
> > that, I'm merely asking if you have plans to unify the file used in
> > fedora/rhel and in the tarball. It's fine with me if the same file is
> > committed to 3 different places (upstream git, fedora dist-git, rhel
> > dist-git). I'm less fine with these 3 spec files being maintained
> > separately with arbitrary differences.
> >
> > Christophe
> >
>
> My idea was to have one. The one I sent seems different from everything
> but it is just because is a single one for both MingW and not MingW, if
> you remove the MingW part is (except the changelog) exactly the same as
> Fedora version.
> As discussed on IRC probably the packager could want to add some
> patches or other minor changes so it's reasonable if the spec get
> changed but I would try to keep it in sync with the upstream one.
> I should probably separate and have an initial spec with just Fedora
> version and then add (if agreed) the MingW part.
>
> I also wanted to know what people think about having a spec file
> upstream as all our project don't have it.

I personally think this has nothing to do in upstream projects.

Some people may find it convenient. For the projects I maintain, I opt out.

cheers

>
> Frediano
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel