[node-patches] Change in ovirt-node[master]: build: Rework build/naming process

fabiand at fedoraproject.org fabiand at fedoraproject.org
Mon Jun 30 11:29:29 UTC 2014


Fabian Deutsch has uploaded a new change for review.

Change subject: build: Rework build/naming process
......................................................................

build: Rework build/naming process

Now the build and naming process is closer to what is done in the
remaining oVirt project.
This shall help to maintain the CI.

Change-Id: I11a608719bde0bcd6cb3edb39acbfc3b0ee1fe5f
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M Makefile.am
M configure.ac
M ovirt-node.spec.in
3 files changed, 58 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/04/29404/1

diff --git a/Makefile.am b/Makefile.am
index 225806b..6e0f858 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -55,11 +55,21 @@
 RPM_FLAGS	= --define "ovirt_cache_dir $(OVIRT_CACHE_DIR)"
 RPM_FLAGS	+= $(if $(_ovirt_dev),--define "extra_release .$(GIT_RELEASE)")
 
-rpms: dist
-	rpmbuild $(RPM_FLAGS) -ta $(distdir).tar.gz
+TMPREPOS = tmp.repos
+RELEASE_SUFFIX ?=
+srpm:	dist
+	rm -fr "$(TMPREPOS)"
+	mkdir -p $(TMPREPOS)/{SPECS,RPMS,SRPMS,SOURCES}
+	$(RPMBUILD) --define="_topdir `pwd`/$(TMPREPOS)" --define="release_suffix $$RELEASE_SUFFIX" -ts "$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz"
+	@echo
+	@echo "srpm available at '$(TMPREPOS)'"
+	@echo
 
-srpms: dist
-	rpmbuild $(RPM_FLAGS) -ts $(distdir).tar.gz
+rpm:	srpm
+	$(RPMBUILD) --define="_topdir `pwd`/$(TMPREPOS)" --define="release_suffix $$RELEASE_SUFFIX" --rebuild "$(TMPREPOS)"/SRPMS/*.src.rpm
+	@echo
+	@echo "rpm(s) available at '$(TMPREPOS)'"
+	@echo
 
 publish: rpms
 	mkdir -p $(OVIRT_CACHE_DIR)
@@ -83,6 +93,9 @@
 unittests:
 	$(MAKE) -C tests/ check-local
 
+snapshot-rpm:
+	make rpm RELEASE_SUFFIX=".$(date --utc +%Y%m%d).git$(git rev-parse --short HEAD)"
+
 snapshot:
 	eval export $$(grep ^PACKAGE_ configure) ; \
 	git archive \
diff --git a/configure.ac b/configure.ac
index ec2b7e8..b179e29 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,40 @@
-AC_INIT([ovirt-node], [3.1.0], [node-devel at ovirt.org])
+dnl
+dnl Licensed to the Apache Software Foundation (ASF) under one or more
+dnl contributor license agreements.  See the NOTICE file distributed with
+dnl this work for additional information regarding copyright ownership.
+dnl The ASF licenses this file to You under the Apache License, Version 2.0
+dnl (the "License"); you may not use this file except in compliance with
+dnl the License.  You may obtain a copy of the License at
+dnl
+dnl     http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing, software
+dnl distributed under the License is distributed on an "AS IS" BASIS,
+dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+dnl See the License for the specific language governing permissions and
+dnl limitations under the License.
+dnl
+
+AC_PREREQ(2.60)
+
+define([VERSION_MAJOR], [3])
+define([VERSION_MINOR], [1])
+define([VERSION_FIX], [0])
+define([VERSION_NUMBER], VERSION_MAJOR[.]VERSION_MINOR[.]VERSION_FIX)
+define([VERSION_SUFFIX], [_master])
+
+AC_INIT([ovirt-node], VERSION_NUMBER[]VERSION_SUFFIX, [devel at ovirt.org])
+PACKAGE_RPM_VERSION="VERSION_NUMBER"
+PACKAGE_RPM_RELEASE="0.0.$(echo VERSION_SUFFIX | sed 's/^_//')"
+AC_SUBST([PACKAGE_RPM_VERSION])
+AC_SUBST([PACKAGE_RPM_RELEASE])
+
+
 AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability tar-pax])
 
+AC_ARG_VAR([RPMBUILD], [path to rpmbuild utility])
+AC_CHECK_PROGS([RPMBUILD], [rpmbuild])
+
 AC_SUBST([FEDORA],[[`rpm --eval '%{fedora}'|sed 's/[^0-9]//g'`]])
 AC_SUBST([RHEL], [[`rpm --eval '%{rhel}'|sed 's/[^0-9]//g'`]])
 AC_SUBST([CENTOS], [[`rpm --eval '%{centos}'|sed 's/[^0-9]//g'`]])
diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in
index 08c3978..7cd3b8e 100644
--- a/ovirt-node.spec.in
+++ b/ovirt-node.spec.in
@@ -21,16 +21,17 @@
 # RHN Plugin is only build on RHEL
 %define with_rhn 0%{?rhel}
 
+%global         package_version @PACKAGE_VERSION@
+%global         package_name @PACKAGE_NAME@
 
 Summary:        The %{product_family} daemons/scripts
 Name:           ovirt-node
-Version:        @VERSION@
-Release:        0.999%{?BUILD_NUMBER}%{?extra_release}%{?dist}
-Source0:        %{name}-%{version}.tar.gz
+Version:        @PACKAGE_RPM_VERSION@
+Release:        @PACKAGE_RPM_RELEASE@%{?release_suffix}%{?dist}
+Source0:        http://plain.resources.ovirt.org/pub/ovirt-master-snapshot/src/%{name}/%{name}-%{package_version}.tar.gz
 License:        GPLv2+
 Group:          Applications/System
 
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot
 URL:            http://www.ovirt.org/
 BuildRequires:  python-setuptools python-devel dracut
 BuildRequires:  automake autoconf
@@ -407,7 +408,7 @@
 
 
 %prep
-%setup -q
+%setup -q -n %{name}-%{package_version}
 
 
 %build


-- 
To view, visit http://gerrit.ovirt.org/29404
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I11a608719bde0bcd6cb3edb39acbfc3b0ee1fe5f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list