[PATCH] add iwhd.spec.in and Makefile rules

Jeff Darcy jdarcy at redhat.com
Tue Oct 19 19:24:59 UTC 2010


On 10/19/2010 03:10 PM, Jim Meyering wrote:
> Here's a first cut at the spec file.
> With it and the Makefile.am rules, you can now run
> "make rpm" to run rpmbuild on the just-created tarball.
> 
>>From 1606241c32e0940e5a917ad3e9bbc69f3e24eac0 Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering at redhat.com>
> Date: Thu, 7 Oct 2010 13:44:31 +0200
> Subject: [PATCH] add iwhd.spec.in and Makefile rules
> 
> With these, you can now run "make rpm" to invoke rpmbuild
> on a just-created tarball.

Looks great!  Thanks, Jim.

> ---
>  .gitignore   |    1 +
>  Makefile.am  |   28 ++++++++++++++++++++++---
>  iwhd.spec.in |   63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 88 insertions(+), 4 deletions(-)
>  create mode 100644 iwhd.spec.in
> 
> diff --git a/.gitignore b/.gitignore
> index c495020..e85dc40 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -18,6 +18,7 @@ iwhd
>  iwhd-*.tar.gz
>  iwhd-qparser.c
>  iwhd-qparser.h
> +iwhd.spec
>  qlexer.c
>  stamp-h1
>  t/*.log
> diff --git a/Makefile.am b/Makefile.am
> index 60dce9a..5510cf1 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -23,11 +23,18 @@ iwhd_YFLAGS = -d
>  SUBDIRS = t
>  ACLOCAL_AMFLAGS = -I ax
> 
> +# iwhd is short for Image WareHouse Daemon.
>  bin_PROGRAMS = iwhd
> -EXTRA_DIST = iwhd-qparser.h
> +
> +EXTRA_DIST =		\
> +  iwhd-qparser.h	\
> +  iwhd.spec		\
> +  iwhd.spec.in
> +
>  BUILT_SOURCES = iwhd-qparser.h qlexer.c
> 
> -# iwhd is short for Image WareHouse Daemon.
> +MOSTLYCLEANFILES =
> +MAINTAINERCLEANFILES =
> 
>  iwhd_SOURCES = \
>    auto.c	\
> @@ -51,6 +58,19 @@ iwhd_SOURCES = \
> 
>  EXTRA_iwhd_SOURCES = qlexer.l
> 
> +MOSTLYCLEANFILES += iwhd.spec
> +MAINTAINERCLEANFILES += iwhd.spec
> +iwhd.spec: iwhd.spec.in Makefile.am
> +	rm -f $@-t $@
> +	sed 's/@''VERSION@/$(VERSION)/' $< > $@-t
> +	chmod a=r $@-t
> +	mv $@-t $@
> +
> +.PHONY: rpm
> +rpm: dist iwhd.spec
> +	chmod 644 $(distdir).tar.gz
> +	rpmbuild -ta $(distdir).tar.gz
> +
>  iwhd_CPPFLAGS	= $(HAIL_CFLAGS)
>  iwhd_LDADD =		\
>    -lmongoclient		\
> @@ -65,6 +85,6 @@ iwhd_LDADD =		\
>    $(GLIB2_LIB)		\
>    $(HAIL_LIBS)
> 
> -MOSTLYCLEANFILES = qlexer.c
> -MAINTAINERCLEANFILES = qlexer.c
> +MOSTLYCLEANFILES += qlexer.c
> +MAINTAINERCLEANFILES += qlexer.c
>  EXTRA_DIST += qlexer.c
> diff --git a/iwhd.spec.in b/iwhd.spec.in
> new file mode 100644
> index 0000000..282370e
> --- /dev/null
> +++ b/iwhd.spec.in
> @@ -0,0 +1,63 @@
> +Name:		iwhd
> +Version:	@VERSION@
> +Release:	1%{?dist}
> +Summary:	Image WareHouse Daemon
> +
> +Group:		System Environment/Libraries
> +License:	GPLv3
> +
> +# FIXME: this is just the gitweb URL.  Do we need more?
> +URL:		http://repo.or.cz/w/iwhd.git
> +
> +# pulled from upstream git,
> +# to recreate tarball, check out commit, then run "make dist"
> +Source0:	iwhd-%{version}.tar.gz
> +
> +BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
> +
> +BuildRequires: boost-devel
> +BuildRequires: boost-filesystem
> +BuildRequires: glib2-devel
> +BuildRequires: hail-devel
> +BuildRequires: jansson-devel
> +BuildRequires: libcurl-devel
> +BuildRequires: libmicrohttpd-devel
> +BuildRequires: libxml2-devel
> +BuildRequires: mongodb-devel
> +BuildRequires: bison
> +BuildRequires: flex
> +BuildRequires: autoconf
> +BuildRequires: automake
> +BuildRequires: mongodb-server
> +BuildRequires: help2man
> +
> +%description
> +Deltacloud image-warehouse daemon
> +
> +%prep
> +%setup -q
> +
> +%build
> +%configure
> +make %{?_smp_mflags}
> +
> +%install
> +rm -rf %{buildroot}
> +make install DESTDIR=%{buildroot}
> +
> +%check
> +make -s check
> +
> +%clean
> +rm -rf %{buildroot}
> +
> +%post
> +
> +%files
> +%defattr(-,root,root,-)
> +%doc AUTHORS COPYING README NEWS
> +%{_bindir}/iwhd
> +
> +%changelog
> +* Wed Oct  7 2010 Jim Meyering <meyering at redhat.com> - 0.90-1
> +- Initial release.
> --
> 1.7.3.1.526.g2ee4


More information about the iwhd-devel mailing list