You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by rl...@apache.org on 2016/09/26 09:59:45 UTC

incubator-hawq git commit: HAWQ-1067. Append hawq version number to plr-hawq rpm pakcage name.

Repository: incubator-hawq
Updated Branches:
  refs/heads/master 5515de9c6 -> 0a188b87c


HAWQ-1067. Append hawq version number to plr-hawq rpm pakcage name.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/0a188b87
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/0a188b87
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/0a188b87

Branch: refs/heads/master
Commit: 0a188b87cd12b9d731ed0244dcd79fbb0efb26d6
Parents: 5515de9
Author: rlei <rl...@pivotal.io>
Authored: Thu Sep 22 14:55:09 2016 +0800
Committer: rlei <rl...@pivotal.io>
Committed: Mon Sep 26 17:54:24 2016 +0800

----------------------------------------------------------------------
 src/pl/Makefile  | 18 +++++++++++++++++-
 src/pl/plr.spec  | 17 +++++++++--------
 src/pl/vplr.spec | 24 ++++++++++++++++++++++++
 3 files changed, 50 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/0a188b87/src/pl/Makefile
----------------------------------------------------------------------
diff --git a/src/pl/Makefile b/src/pl/Makefile
index 0792f49..e399396 100644
--- a/src/pl/Makefile
+++ b/src/pl/Makefile
@@ -50,12 +50,28 @@ plr_prepare: plr_prepare_timestamp
 	fi
 
 ABS_PLR_SRCDIR = $(abs_top_srcdir)/$(subdir)/plr
+HAWQ_VERSION := $(shell cat $(abs_top_srcdir)/VERSION | awk '{print $$1}')
+HAWQ_VERSION_STR := $(shell cat $(abs_top_srcdir)/VERSION | awk '{print $$1}' | sed 's/\./_/g')
+HAWQ_BUILD_NUMBER := $(shell cat $(abs_top_srcdir)/VERSION | awk '{print $$3}')
+REDHAT_MAJOR_VERSION := $(shell cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*// | awk -F '.' '{print $$1}')
 
 # rpm only so far.
 plr_pkgbuild: plr_prepare
 	if [ ! -f /etc/redhat-release ]; then echo "rpm build is not supported on the platform."; exit 1; fi
+	if [ ! -f $(abs_top_srcdir)/VERSION ]; then echo "VERSION file is missing. Forgot to run configure?"; exit 1; fi
 	rm -rf plr/build; mkdir -p plr/build;
-	rpmbuild -bb plr.spec --define 'plr_srcdir $(ABS_PLR_SRCDIR)' --define '_topdir $(ABS_PLR_SRCDIR)/build' --define '__os_install_post \%{nil}'
+	rpmbuild -bb plr.spec --define 'plr_srcdir $(ABS_PLR_SRCDIR)' \
+        --define 'hawq_version $(HAWQ_VERSION)' \
+        --define 'hawq_version_str $(HAWQ_VERSION_STR)' \
+        --define 'hawq_build_number $(HAWQ_BUILD_NUMBER)' \
+        --define 'redhat_major_version $(REDHAT_MAJOR_VERSION)' \
+        --define '_topdir $(ABS_PLR_SRCDIR)/build' --define '__os_install_post \%{nil}'
+	rpmbuild -bb vplr.spec \
+        --define 'hawq_version $(HAWQ_VERSION)' \
+        --define 'hawq_version_str $(HAWQ_VERSION_STR)' \
+        --define 'hawq_build_number $(HAWQ_BUILD_NUMBER)' \
+        --define 'redhat_major_version $(REDHAT_MAJOR_VERSION)' \
+        --define '_topdir $(ABS_PLR_SRCDIR)/build'
 
 ifeq ($(with_r), yes)
 plr_prepare2: plr_prepare

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/0a188b87/src/pl/plr.spec
----------------------------------------------------------------------
diff --git a/src/pl/plr.spec b/src/pl/plr.spec
index 23af95b..abac849 100644
--- a/src/pl/plr.spec
+++ b/src/pl/plr.spec
@@ -1,11 +1,12 @@
 Summary:        PL/R module for HAWQ
-Name:           plr-hawq
-Version:        08.03.00.14
-Release:		0
-Prefix:         /usr/local
+Name:           plr-hawq_%{hawq_version_str}
+Version:        08.03.00.14.%{hawq_version}
+Release:		%{hawq_build_number}.el%{redhat_major_version}
+Prefix:         /usr/local/hawq
 License:		GPL
 BuildRequires:  R-core-devel
 Requires:       R
+Provides:       plr-hawq
 
 %define _unpackaged_files_terminate_build 0
 
@@ -21,9 +22,9 @@ The PL/R modules provides Procedural language implementation of R for HAWQ.
 # 2. We build using the "configured" prefix at first and then install it using
 #    the new prefix.
 make -C %{plr_srcdir}
-make -C %{plr_srcdir} install prefix=%{buildroot}/usr/local
+make -C %{plr_srcdir} install prefix=%{buildroot}/usr/local/hawq
 
 %files
-/usr/local/docs/contrib/README.plr
-/usr/local/lib/postgresql/plr.so*
-/usr/local/share/postgresql/contrib/plr.sql
+/usr/local/hawq/docs/contrib/README.plr
+/usr/local/hawq/lib/postgresql/plr.so*
+/usr/local/hawq/share/postgresql/contrib/plr.sql

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/0a188b87/src/pl/vplr.spec
----------------------------------------------------------------------
diff --git a/src/pl/vplr.spec b/src/pl/vplr.spec
new file mode 100644
index 0000000..3931c98
--- /dev/null
+++ b/src/pl/vplr.spec
@@ -0,0 +1,24 @@
+Name:       plr-hawq
+Summary:    PL/R module for HAWQ
+Version:    08.03.00.14.%{hawq_version}
+Release:    %{hawq_build_number}.el%{redhat_major_version}
+License:    GPL
+Prefix:     /usr/local
+Requires:   plr-hawq_%{hawq_version_str}
+
+AutoReqProv:    no
+
+%description
+This is the virtual rpm package of plr-hawq.
+
+%prep
+
+%install
+
+%clean
+
+%post
+
+%postun
+
+%files