20839720 Enable python module in rrdtool
authorYamei Feng <yamei.feng@oracle.com>
Wed, 08 Jul 2015 15:54:50 -0700
changeset 4605 62d61ce27a05
parent 4604 eba741d252dc
child 4609 c87d757fa091
20839720 Enable python module in rrdtool
components/rrdtool/Makefile
components/rrdtool/rrdtool-python-PYVER.p5m
components/rrdtool/rrdtool.p5m
--- a/components/rrdtool/Makefile	Tue Jul 07 16:42:20 2015 -0700
+++ b/components/rrdtool/Makefile	Wed Jul 08 15:54:50 2015 -0700
@@ -35,6 +35,9 @@
 COMPONENT_BUGDB=        utility/rrdtool
 TPNO=                   21430 
 
+PYTHON_VERSION=         2.7
+PYTHON_VERSIONS=        2.7
+
 include ../../make-rules/prep.mk
 include ../../make-rules/configure.mk
 include ../../make-rules/ips.mk
@@ -51,7 +54,7 @@
 COMPONENT_PREP_ACTION = ( cd $(@D); autoconf -f)
 
 CONFIGURE_OPTIONS  += --enable-perl 
-CONFIGURE_OPTIONS  += --disable-python
+CONFIGURE_OPTIONS  += --enable-python
 CONFIGURE_OPTIONS  += --disable-ruby
 CONFIGURE_OPTIONS  += --enable-tcl
 CONFIGURE_OPTIONS  += --enable-static=no
@@ -68,13 +71,24 @@
 CONFIGURE_OPTIONS  +=   PERLINSTALLMAN3DIR=/usr/share/man/man3
 CONFIGURE_OPTIONS  +=   PERLINSTALLSITEMAN3DIR=/usr/share/man/man3
 CONFIGURE_OPTIONS  +=   PERLINSTALLVENDORMAN3DIR=/usr/share/man/man3
+CONFIGURE_OPTIONS +=    am_cv_python_pythondir=$(PYTHON_VENDOR_PACKAGES)
+CONFIGURE_OPTIONS +=    am_cv_python_pyexecdir=$(PYTHON_VENDOR_PACKAGES)
+CONFIGURE_OPTIONS  +=   PYTHON=$(PYTHON.$(PYTHON_VERSION).$(BITS))
 
 $(CONFIGURE_64): CONFIGURE_OPTIONS  +=   LUARRDLIBDIR=64
 
+PYTHON_ENV  =   CC="$(CC)"
+PYTHON_ENV +=   CFLAGS="$(CFLAGS)"
+COMPONENT_BUILD_ENV += $(PYTHON_ENV)
+COMPONENT_INSTALL_ENV += $(PYTHON_ENV)
+
 PKG_MACROS         +=   P_ARCH=$(shell arch)
 
 ASLR_MODE	    =   $(ASLR_ENABLE)
 
+PKG_MACROS +=  PYVER=$(PYTHON_VERSION)
+PKG_MACROS +=  PYV=$(shell echo $(PYTHON_VERSION) | tr -d .)
+
 # common targets
 configure:	$(CONFIGURE_32_and_64)
 
@@ -96,3 +110,4 @@
 REQUIRED_PACKAGES += runtime/lua
 REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/math
+REQUIRED_PACKAGES += runtime/python-27
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/rrdtool/rrdtool-python-PYVER.p5m	Wed Jul 08 15:54:50 2015 -0700
@@ -0,0 +1,48 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+#
+set name=pkg.fmri \
+    value=pkg:/library/python/rrdtool-$(PYV)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.summary \
+    value="Python $(PYVER) bindings for RRDtool-Round Robin Database tool"
+set name=com.oracle.info.description \
+    value="Python $(PYVER) bindings for RRDtool-Round Robin Database tool"
+set name=com.oracle.info.tpno value=$(TPNO)
+set name=info.classification \
+    value="org.opensolaris.category.2008:Applications/System Utilities"
+set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
+set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
+set name=org.opensolaris.arc-caseid value=LSARC/2008/129
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+file usr/lib/python$(PYVER)/site-packages/64/rrdtoolmodule.so \
+    path=usr/lib/python$(PYVER)/vendor-packages/64/rrdtoolmodule.so
+file usr/lib/python$(PYVER)/site-packages/py_rrdtool-0.2.2-py$(PYVER).egg-info \
+    path=usr/lib/python$(PYVER)/vendor-packages/py_rrdtool-0.2.2-py$(PYVER).egg-info
+file usr/lib/python$(PYVER)/site-packages/rrdtoolmodule.so \
+    path=usr/lib/python$(PYVER)/vendor-packages/rrdtoolmodule.so
+license rrdtool.license license=GPLv2
+
+# force a dependency on the Python $(PYVER) runtime
+depend type=require fmri=__TBD pkg.debug.depend.file=python$(PYVER) \
+    pkg.debug.depend.path=usr/bin
--- a/components/rrdtool/rrdtool.p5m	Tue Jul 07 16:42:20 2015 -0700
+++ b/components/rrdtool/rrdtool.p5m	Wed Jul 08 15:54:50 2015 -0700
@@ -215,3 +215,8 @@
 file path=usr/share/rrdtool/ifOctets.tcl
 file path=usr/share/rrdtool/pkgIndex.tcl
 license rrdtool.license license=GPLv2
+
+# Bring in the language bindings if the language platforms are installed.
+depend type=conditional \
+    fmri=library/python/[email protected]$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) \
+    predicate=runtime/python-27