6438650 USLD - Python should have SNMP support
authorRich Burridge <rich.burridge@oracle.com>
Tue, 03 Apr 2012 13:30:32 -0700
changeset 757 a37ee009302a
parent 756 3602fbc18c59
child 758 8d61ac17827e
6438650 USLD - Python should have SNMP support
components/net-snmp/Makefile
components/net-snmp/net-snmp-26.p5m
components/net-snmp/net-snmp-27.p5m
components/net-snmp/net-snmp-base.p5m
components/net-snmp/patches/023.6438650.python.patch
--- a/components/net-snmp/Makefile	Mon Apr 02 18:14:05 2012 -0700
+++ b/components/net-snmp/Makefile	Tue Apr 03 13:30:32 2012 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 include ../../make-rules/shared-macros.mk
 
@@ -63,6 +63,10 @@
 MIB_MOBULES += $(MIB_MODULES.$(MACH))
 CONFIGURE_OPTIONS  +=	--with-mib-modules="$(MIB_MODULES)"
 
+# Python bindings support.
+PYTHON_ARGS =		--basedir=/usr/bin
+CONFIGURE_OPTIONS  +=	--with-python-modules="$(PYTHON_ARGS)"
+
 # Only build 32 bit Perl support
 PERL_ARGS =			DESTDIR=$(PROTO_DIR) INSTALLDIRS=vendor
 CONFIGURE_OPTIONS.32  +=	PERLPROG="$(PERL)"
@@ -81,6 +85,10 @@
 COMPONENT_PRE_CONFIGURE_ACTION = \
 	($(CLONEY) $(SOURCE_DIR) $(@D); $(CLONEY) $(COMPONENT_DIR)/sun $(@D)/sun)
 
+# After we have configured, make a copy of the python bits so we
+# can build separate python 2.7 support.
+COMPONENT_POST_CONFIGURE_ACTION = (cd $(@D) ; cp -rp python python2.7)
+
 # for the goofy definition of ARCH in the extra Makefiles
 ARCH=32
 ARCH=$(BITS:64=$(MACH64))
@@ -94,9 +102,15 @@
 $(BUILD_64): COMPONENT_POST_BUILD_ACTION= \
 	(cd $(BUILD_DIR)/$(MACH64)/sun ; ls agent; $(CCSMAKE) -e $(CCSMAKE_ARGS))
 
+$(INSTALL_32): COMPONENT_INSTALL_ARGS += PYTHON_VENDOR_PACKAGES=$(PYTHON_VENDOR_PACKAGES)
+
 $(INSTALL_32): COMPONENT_POST_INSTALL_ACTION= \
 	($(MKDIR) -p $(BUILD_DIR)/prototype/$(MACH)/etc/net-snmp/snmp/mibs; \
-	 cd $(BUILD_DIR)/$(MACH32)/sun ; ls agent; $(CCSMAKE) -e $(CCSMAKE_ARGS) install)
+	 cd $(BUILD_DIR)/$(MACH32)/sun ; ls agent; $(CCSMAKE) -e $(CCSMAKE_ARGS) install) ; \
+	(cd $(@D)/python2.7 ; env PYTHON=$(PYTHON.2.7.$(BITS)) \
+		$(PYTHON.2.7.$(BITS)) ./setup.py install \
+			--root $(PROTO_DIR) \
+			--install-lib=$(PYTHON.2.7.VENDOR_PACKAGES))
 
 $(INSTALL_64): COMPONENT_POST_INSTALL_ACTION= \
 	($(MKDIR) -p $(BUILD_DIR)/prototype/$(MACH64)/etc/net-snmp/snmp/mibs; \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/net-snmp/net-snmp-26.p5m	Tue Apr 03 13:30:32 2012 -0700
@@ -0,0 +1,53 @@
+#
+# 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) 2012, Oracle and/or its affiliates. All rights reserved.
+#
+
+set name=pkg.fmri \
+    value=pkg:/library/python-2/[email protected]$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.summary value="The Net-SNMP - Python 2.6 bindings"
+set name=info.classification \
+    value=org.opensolaris.category.2008:Development/Python
+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/355
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+dir path=usr
+dir path=usr/lib
+dir path=usr/lib/python2.6
+dir path=usr/lib/python2.6/vendor-packages
+dir path=usr/lib/python2.6/vendor-packages/netsnmp
+dir path=usr/lib/python2.6/vendor-packages/netsnmp/tests
+dir path=usr/lib/python2.6/vendor-packages/netsnmp_python-1.0a1-py2.6.egg-info
+file path=usr/lib/python2.6/vendor-packages/netsnmp/__init__.py
+file path=usr/lib/python2.6/vendor-packages/netsnmp/client.py
+file path=usr/lib/python2.6/vendor-packages/netsnmp/client_intf.so
+file path=usr/lib/python2.6/vendor-packages/netsnmp/tests/__init__.py
+file path=usr/lib/python2.6/vendor-packages/netsnmp/tests/test.py
+file \
+    path=usr/lib/python2.6/vendor-packages/netsnmp_python-1.0a1-py2.6.egg-info/PKG-INFO
+file \
+    path=usr/lib/python2.6/vendor-packages/netsnmp_python-1.0a1-py2.6.egg-info/SOURCES.txt
+file \
+    path=usr/lib/python2.6/vendor-packages/netsnmp_python-1.0a1-py2.6.egg-info/dependency_links.txt
+file \
+    path=usr/lib/python2.6/vendor-packages/netsnmp_python-1.0a1-py2.6.egg-info/top_level.txt
+license COPYING license="BSD, BSD-like"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/net-snmp/net-snmp-27.p5m	Tue Apr 03 13:30:32 2012 -0700
@@ -0,0 +1,53 @@
+#
+# 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) 2012, Oracle and/or its affiliates. All rights reserved.
+#
+
+set name=pkg.fmri \
+    value=pkg:/library/python-2/[email protected]$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.summary value="The Net-SNMP - Python 2.7 bindings"
+set name=info.classification \
+    value=org.opensolaris.category.2008:Development/Python
+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/355
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+dir path=usr
+dir path=usr/lib
+dir path=usr/lib/python2.7
+dir path=usr/lib/python2.7/vendor-packages
+dir path=usr/lib/python2.7/vendor-packages/netsnmp
+dir path=usr/lib/python2.7/vendor-packages/netsnmp/tests
+dir path=usr/lib/python2.7/vendor-packages/netsnmp_python-1.0a1-py2.7.egg-info
+file path=usr/lib/python2.7/vendor-packages/netsnmp/__init__.py
+file path=usr/lib/python2.7/vendor-packages/netsnmp/client.py
+file path=usr/lib/python2.7/vendor-packages/netsnmp/client_intf.so
+file path=usr/lib/python2.7/vendor-packages/netsnmp/tests/__init__.py
+file path=usr/lib/python2.7/vendor-packages/netsnmp/tests/test.py
+file \
+    path=usr/lib/python2.7/vendor-packages/netsnmp_python-1.0a1-py2.7.egg-info/PKG-INFO
+file \
+    path=usr/lib/python2.7/vendor-packages/netsnmp_python-1.0a1-py2.7.egg-info/SOURCES.txt
+file \
+    path=usr/lib/python2.7/vendor-packages/netsnmp_python-1.0a1-py2.7.egg-info/dependency_links.txt
+file \
+    path=usr/lib/python2.7/vendor-packages/netsnmp_python-1.0a1-py2.7.egg-info/top_level.txt
+license COPYING license="BSD, BSD-like"
--- a/components/net-snmp/net-snmp-base.p5m	Mon Apr 02 18:14:05 2012 -0700
+++ b/components/net-snmp/net-snmp-base.p5m	Tue Apr 03 13:30:32 2012 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
 <transform file path=usr.*/man/.+ -> default mangler.man.stability volatile>
@@ -578,3 +578,11 @@
 link path=usr/lib/libnetsnmptrapd.so.15 target=./libnetsnmptrapd.so.15.1.0
 link path=usr/lib/libsnmp.so target=./libsnmp.so.15.1.0
 link path=usr/lib/libsnmp.so.15 target=./libsnmp.so.15.1.0
+
+depend fmri=library/python-2/[email protected]$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) \
+    predicate=runtime/python-26 \
+    type=conditional
+
+depend fmri=library/python-2/[email protected]$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) \
+    predicate=runtime/python-27 \
+    type=conditional
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/net-snmp/patches/023.6438650.python.patch	Tue Apr 03 13:30:32 2012 -0700
@@ -0,0 +1,11 @@
+--- net-snmp-5.4.1/Makefile.in.orig	2012-03-21 09:36:23.148069679 -0700
++++ net-snmp-5.4.1/Makefile.in	2012-03-21 09:36:56.194195238 -0700
[email protected]@ -207,7 +207,7 @@
+         fi
+ 
+ pythoninstall:
+-	@(dir=`pwd`; cd python; $(PYMAKE) install --basedir=$$dir) ; \
++	@(dir=`pwd`; cd python; $(PYMAKE) install --basedir=$$dir --root $(DESTDIR) --install-lib=$(PYTHON_VENDOR_PACKAGES)) ; \
+         if test $$? != 0 ; then \
+            exit 1 ; \
+         fi