From 439e9e85cde98e5e8ee60a562b38ef4a070a8dab Mon Sep 17 00:00:00 2001 From: Federico Simoncelli Date: Sep 11 2012 10:19:39 +0000 Subject: add the autotools support Signed-off-by: Federico Simoncelli --- diff --git a/0042-Ship-the-version-file-with-the-tarballs.patch b/0042-Ship-the-version-file-with-the-tarballs.patch new file mode 100644 index 0000000..905e8a5 --- /dev/null +++ b/0042-Ship-the-version-file-with-the-tarballs.patch @@ -0,0 +1,147 @@ +From 0b3cd04300005c995d20306446a2ab804d74b6be Mon Sep 17 00:00:00 2001 +From: Federico Simoncelli +Date: Fri, 17 Aug 2012 05:23:38 -0400 +Subject: [PATCH] Ship the version file with the tarballs + +Shipping the VERSION file allows running the autoreconf tool also from a +tarball package (no need of the entire git repository). + +In this patch: +* generate and ship the VERSION file +* move, unify (and ship) version.sh and release.sh in pkg-version +* use the VERSION file when the git repository is not available + (eg: tarball) + +Signed-off-by: Federico Simoncelli +Change-Id: I8b72a1740803a9401e4b5a4504a4faa07c29f2b9 +Reviewed-on: http://gerrit.ovirt.org/7295 +Reviewed-by: Douglas Schilling Landgraf +Reviewed-by: Alon Bar-Lev +Reviewed-by: Dan Kenigsberg +Tested-by: Dan Kenigsberg +--- + Makefile.am | 13 +++++++++++-- + build-aux/pkg-version | 39 +++++++++++++++++++++++++++++++++++++++ + configure.ac | 4 ++-- + VERSION | 1 + + 4 files changed, 52 insertions(+), 34 deletions(-) + create mode 100755 build-aux/pkg-version + create mode 100644 VERSION + delete mode 100755 build-aux/release.sh + delete mode 100755 build-aux/version.sh + +diff --git a/Makefile.am b/Makefile.am +index ab9b240..2b6d273 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -25,6 +25,7 @@ include $(top_srcdir)/build-aux/Makefile.subs + # This is an *exception*, we ship also vdsm.spec so it's possible to build the + # rpm from the tarball. + EXTRA_DIST = \ ++ build-aux/pkg-version \ + vdsm.spec \ + vdsm.spec.in + +@@ -80,11 +81,11 @@ rpm: dist + rpmbuild -ta $(if $(BUILDID),--define="extra_release .$(BUILDID)") \ + $(WITH_HOOKS) $(DIST_ARCHIVES) + +-dist-hook: gen-ChangeLog ++dist-hook: gen-VERSION gen-ChangeLog ++.PHONY: gen-VERSION gen-ChangeLog + + # Generate the ChangeLog file and insert it into the directory + # we're about to use to create a tarball. +-.PHONY: gen-ChangeLog + gen-ChangeLog: + if test -d .git; then \ + $(top_srcdir)/build-aux/gitlog-to-changelog \ +@@ -92,3 +93,11 @@ gen-ChangeLog: + rm -f $(distdir)/ChangeLog; \ + mv $(distdir)/cl-t $(distdir)/ChangeLog; \ + fi ++ ++gen-VERSION: ++ if test -d .git; then \ ++ $(top_srcdir)/build-aux/pkg-version --full \ ++ > $(distdir)/ve-t; \ ++ rm -f $(distdir)/VERSION; \ ++ mv $(distdir)/ve-t $(distdir)/VERSION; \ ++ fi +diff --git a/build-aux/pkg-version b/build-aux/pkg-version +new file mode 100755 +index 0000000..a8d9d77 +--- /dev/null ++++ b/build-aux/pkg-version +@@ -0,0 +1,39 @@ ++#!/bin/sh ++ ++# tags and output versions: ++# - v4.9.0 => 4.9.0 (upstream clean) ++# - v4.9.0-1 => 4.9.0 (downstream clean) ++# - v4.9.0-2-g34e62f => 4.9.0 (upstream dirty) ++# - v4.9.0-1-2-g34e62f => 4.9.0 (downstream dirty) ++AWK_VERSION=' ++ BEGIN { FS="-" } ++ /^v[0-9]/ { ++ sub(/^v/,"") ; print $1 ++ }' ++ ++# tags and output releases: ++# - v4.9.0 => 0 (upstream clean) ++# - v4.9.0-1 => 1 (downstream clean) ++# - v4.9.0-2-g34e62f1 => 0.2.git34e62f1 (upstream dirty) ++# - v4.9.0-1-2-g34e62f1 => 1.2.git34e62f1 (downstream dirty) ++AWK_RELEASE=' ++ BEGIN { FS="-"; OFS="." } ++ /^v[0-9]/ { ++ if (NF == 1) print 0 ++ else if (NF == 2) print $2 ++ else if (NF == 3) print 0, $2, "git" substr($3, 2) ++ else if (NF == 4) print $2, $3, "git" substr($4, 2) ++ }' ++ ++PKG_VERSION=`cat VERSION 2> /dev/null || git describe --match "v[0-9]*"` ++ ++if test "x$1" == "x--full"; then ++ echo $PKG_VERSION | tr -d '[:space:]' ++elif test "x$1" == "x--version"; then ++ echo $PKG_VERSION | awk "$AWK_VERSION" | tr -cd '[:alnum:].' ++elif test "x$1" == "x--release"; then ++ echo $PKG_VERSION | awk "$AWK_RELEASE" | tr -cd '[:alnum:].' ++else ++ echo "usage: $0 [--full|--version|--release]" ++ exit 1 ++fi +diff --git a/configure.ac b/configure.ac +index 7b829f5..cb1dc56 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -20,7 +20,7 @@ + + # Autoconf initialization + AC_INIT([vdsm], +- [m4_esyscmd([build-aux/version.sh])], ++ [m4_esyscmd([build-aux/pkg-version --version])], + [vdsm-devel@lists.fedorahosted.org]) + AC_CONFIG_AUX_DIR([build-aux]) + +@@ -28,7 +28,7 @@ m4_include([m4/ax_python_module.m4]) + + # Package release + AC_SUBST([PACKAGE_RELEASE], +- [m4_esyscmd([build-aux/release.sh])]) ++ [m4_esyscmd([build-aux/pkg-version --release])]) + + # Testing for version and release + AS_IF([test "x$PACKAGE_VERSION" = x], +diff --git a/VERSION b/VERSION +new file mode 100644 +index 0000000..bbc89f8 +--- /dev/null ++++ b/VERSION +@@ -0,0 +1,1 @@ ++v4.10.0 +-- +1.7.1 + diff --git a/vdsm.spec b/vdsm.spec index b38a800..60ec9a5 100644 --- a/vdsm.spec +++ b/vdsm.spec @@ -21,9 +21,14 @@ # Required paths %global _polkitdir %{_localstatedir}/lib/polkit-1/localauthority/10-vendor.d +# Default to skipping autoreconf. Distros can change just this one line +# (or provide a command-line override) if they backport any patches that +# touch configure.ac or Makefile.am. +%{!?enable_autotools:%define enable_autotools 1} + Name: %{vdsm_name} Version: 4.10.0 -Release: 7%{?vdsm_relvtag}%{?dist}%{?extra_release} +Release: 8%{?vdsm_relvtag}%{?dist}%{?extra_release} Summary: Virtual Desktop Server Manager Group: Applications/System @@ -79,6 +84,7 @@ Patch37: 0038-Remove-redundant-explicitBonding-parameter-from-setu.patch Patch38: 0039-configNet-clear-up-atomicBackup-arg.patch Patch39: 0040-configNet-atomicBackup-remove-new-files-upon-restore.patch Patch40: 0041-BZ-842948-deployUtil-safely-remove-bridge.patch +Patch41: 0042-Ship-the-version-file-with-the-tarballs.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -92,6 +98,14 @@ BuildRequires: python-pep8 BuildRequires: python-ethtool BuildRequires: libvirt-python +# Autotools BuildRequires +%if 0%{?enable_autotools} +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: gettext-devel +BuildRequires: libtool +%endif + %if !0%{?rhel} BuildRequires: systemd-units %endif @@ -413,8 +427,13 @@ Gluster plugin enables VDSM to serve Gluster functionalities. %patch38 -p1 -b .patch38 %patch39 -p1 -b .patch39 %patch40 -p1 -b .patch40 +%patch41 -p1 -b .patch41 +%{__chmod} +x build-aux/pkg-version # required by patch41 %build +%if 0%{?enable_autotools} +autoreconf -if +%endif %configure %{?with_hooks:--enable-hooks} make # Setting software_version and software_revision in dsaversion.py @@ -973,6 +992,12 @@ exit 0 %{_datadir}/%{vdsm_name}/gluster/hostname.py* %changelog +* Tue Sep 11 2012 Federico Simoncelli 4.10.0-8.fc17 +- add the autotools support + +* Fri Aug 17 2012 Federico Simoncelli 4.10.0-7.fc17 +- enable all the vdsm hooks + * Wed Aug 1 2012 Federico Simoncelli 4.10.0-6.fc17 - BZ#842948: deployUtil - safely remove bridge