[Pkg-net-snmp-commits] r157 - in branches/net-snmp54/debian: . patches

Jochen Friedrich jochen at alioth.debian.org
Fri Apr 13 12:04:31 UTC 2007


Author: jochen
Date: 2007-04-13 12:04:31 +0000 (Fri, 13 Apr 2007)
New Revision: 157

Added:
   branches/net-snmp54/debian/libsnmp-python.install
   branches/net-snmp54/debian/patches/38_python_intree.README
   branches/net-snmp54/debian/patches/38_python_intree.patch
Modified:
   branches/net-snmp54/debian/control
   branches/net-snmp54/debian/rules
Log:
Support for python


Modified: branches/net-snmp54/debian/control
===================================================================
--- branches/net-snmp54/debian/control	2007-04-13 12:03:42 UTC (rev 156)
+++ branches/net-snmp54/debian/control	2007-04-13 12:04:31 UTC (rev 157)
@@ -3,8 +3,11 @@
 Priority: optional
 Maintainer: Net-SNMP Packaging Team <pkg-net-snmp-devel at lists.alioth.debian.org>
 Uploaders: Jochen Friedrich <jochen at scram.de>, Thomas Anders <tanders at users.sourceforge.net>
-Build-Depends: debhelper (>=5), libtool, libwrap0-dev, libssl-dev (>> 0.9.8), perl (>=5.8), libperl-dev, autoconf, automake1.9, debianutils (>=1.13.1), bash (>=2.05), findutils (>=4.1.20), procps, cdbs (>=0.4.40), libkvm-dev [kfreebsd-i386 kfreebsd-amd64], libsensors-dev (>=2.8.5) [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64]
+Build-Depends: debhelper (>=5), libtool, libwrap0-dev, libssl-dev (>> 0.9.8), perl (>=5.8), libperl-dev, python-all-dev, python-central (>=0.5.6), python (>=2.3.5-7), python-setuptools (>=0.6b3-1), autoconf, automake1.9, debianutils (>=1.13.1), bash (>=2.05), findutils (>=4.1.20), procps, cdbs (>=0.4.40), libkvm-dev [kfreebsd-i386 kfreebsd-amd64], libsensors-dev (>=2.8.5) [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64]
 Standards-Version: 3.7.2
+XS-Vcs-Svn: svn://svn.debian.org/pkg-net-snmp/
+XS-Vcs-Browser: http://svn.debian.org/wsvn/pkg-net-snmp/
+XS-Python-Version: all
 
 Package: snmpd
 Section: net
@@ -87,6 +90,19 @@
  and clients.  The NET SNMP perl5 support files provide the perl
  functions for integration of SNMP into applications, written in perl.
 
+Package: libsnmp-python
+Section: python
+Priority: optional
+Architecture: any
+Depends: ${python:Depends}, ${shlibs:Depends}, libsnmp15 (=${Source-Version})
+XB-Python-Version: ${python:Versions}
+Provides: ${python:Provides}
+Description: NET SNMP (Simple Network Management Protocol) Python Support
+ The Simple Network Management Protocol (SNMP) provides a framework
+ for the exchange of management information between agents (servers)
+ and clients.  The NET SNMP python support files provide the python
+ functions for integration of SNMP into applications, written in python.
+
 Package: tkmib
 Section: net
 Priority: optional

Added: branches/net-snmp54/debian/libsnmp-python.install
===================================================================
--- branches/net-snmp54/debian/libsnmp-python.install	2007-04-13 12:03:42 UTC (rev 156)
+++ branches/net-snmp54/debian/libsnmp-python.install	2007-04-13 12:04:31 UTC (rev 157)
@@ -0,0 +1 @@
+debian/tmp/usr/lib/python*

Added: branches/net-snmp54/debian/patches/38_python_intree.README
===================================================================
--- branches/net-snmp54/debian/patches/38_python_intree.README	2007-04-13 12:03:42 UTC (rev 156)
+++ branches/net-snmp54/debian/patches/38_python_intree.README	2007-04-13 12:04:31 UTC (rev 157)
@@ -0,0 +1 @@
+Let python build in source tree

Added: branches/net-snmp54/debian/patches/38_python_intree.patch
===================================================================
--- branches/net-snmp54/debian/patches/38_python_intree.patch	2007-04-13 12:03:42 UTC (rev 156)
+++ branches/net-snmp54/debian/patches/38_python_intree.patch	2007-04-13 12:04:31 UTC (rev 157)
@@ -0,0 +1,77 @@
+--- net-snmp-5.4.orig/python/setup.py	2007-04-12 14:19:59.000000000 +0200
++++ net-snmp-5.4/python/setup.py	2007-04-12 14:25:16.000000000 +0200
+@@ -3,10 +3,29 @@
+ import os
+ import re
+ import string
++import sys
+ 
+-netsnmp_libs = os.popen('net-snmp-config --libs').read()
+-libdirs = re.findall(r"-L(\S+)", netsnmp_libs)
+-libs = re.findall(r"-l(\S+)", netsnmp_libs)
++intree=0
++
++args = sys.argv[:]
++for arg in args:
++    if string.find(arg,'--basedir=') == 0:
++        basedir = string.split(arg,'=')[1]
++	sys.argv.remove(arg)
++        intree=1
++
++if intree:
++    netsnmp_libs = os.popen(basedir+'/net-snmp-config --libs').read()
++    libdir = os.popen(basedir+'/net-snmp-config --build-lib-dirs '+basedir).read()
++    incdir = os.popen(basedir+'/net-snmp-config --build-includes '+basedir).read()
++    libs = re.findall(r"-l(\S+)", netsnmp_libs)
++    libdirs = re.findall(r"-L(\S+)", libdir)
++    incdirs = re.findall(r"-I(\S+)", incdir)
++else:
++    netsnmp_libs = os.popen('net-snmp-config --libs').read()
++    libdirs = re.findall(r"-L(\S+)", netsnmp_libs)
++    incdirs = []
++    libs = re.findall(r"-l(\S+)", netsnmp_libs)
+ 
+ setup(
+     name="netsnmp-python", version="1.0a1",
+@@ -21,6 +40,7 @@
+     ext_modules = [
+        Extension("netsnmp.client_intf", ["netsnmp/client_intf.c"],
+                  library_dirs=libdirs,
++                 include_dirs=incdirs,
+                  libraries=libs )
+        ]
+     )
+--- net-snmp-5.4.orig/Makefile.in	2007-04-13 12:38:12.000000000 +0200
++++ net-snmp-5.4/Makefile.in	2007-04-13 12:55:58.000000000 +0200
+@@ -202,13 +202,13 @@
+ # override LD_RUN_PATH to avoid dependencies on the build directory
+ PYMAKE=python setup.py $(PYTHONARGS)
+ pythonmodules: 
+-	@(cd python ; $(PYMAKE) build) ; \
++	@(dir=`pwd`; cd python; $(PYMAKE) build --basedir=$$dir) ; \
+         if test $$? != 0 ; then \
+            exit 1 ; \
+         fi
+ 
+ pythoninstall:
+-	@(cd python ; $(PYMAKE) install) ; \
++	@(dir=`pwd`; cd python; $(PYMAKE) install --basedir=$$dir) ; \
+         if test $$? != 0 ; then \
+            exit 1 ; \
+         fi
+@@ -217,13 +217,13 @@
+ 	echo "WARNING: python doesn't support uninstall"
+ 
+ pythontest:
+-	@(cd python ; $(PYMAKE) test) ; \
++	@(dir=`pwd`; cd python; $(PYMAKE) test --basedir=$$dir) ; \
+ 	if test $$? != 0 ; then \
+ 	   exit 1 ; \
+ 	fi
+ 
+ pythonclean:
+-	@( cd python ; $(PYMAKE) clean )
++	@(dir=`pwd`; cd python; $(PYMAKE) clean --basedir=$$dir)
+ 
+ 
+ #

Modified: branches/net-snmp54/debian/rules
===================================================================
--- branches/net-snmp54/debian/rules	2007-04-13 12:03:42 UTC (rev 156)
+++ branches/net-snmp54/debian/rules	2007-04-13 12:04:31 UTC (rev 157)
@@ -1,16 +1,23 @@
 #!/usr/bin/make -f
 
+# Fix for broken clean target. Must run before reversing patches
+cleanbuilddir::
+	-make clean
+
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/rules/simple-patchsys.mk
 include /usr/share/cdbs/1/class/autotools.mk
 
 LIB_VERSION = 15
 COMPAT_VERSION = 5.4
+PYTHON_VERSION = 1.0a1
 BACKUP = aclocal.m4 configure ltmain.sh stamp-h stamp-h.in \
          include/net-snmp/net-snmp-config.h.in
 
 MIB_MODULES = host smux ucd-snmp/dlmod
 
+PYVERS=$(shell pyversions -vr)
+
 ifeq (linux,$(DEB_HOST_ARCH_OS))
 MIB_MODULES += ucd-snmp/diskio ucd-snmp/lmSensors 
 IPV6 = --enable-ipv6
@@ -32,7 +39,7 @@
 DEB_CONFIGURE_EXTRA_FLAGS := --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man \
 	  --with-persistent-directory=/var/lib/snmp \
 	  --enable-ucd-snmp-compatibility \
-	  --enable-shared --with-cflags="$(CFLAGS)" \
+	  --enable-shared --with-cflags="$(CFLAGS) -DNETSNMP_USE_INLINE" \
 	  --with-perl-modules="INSTALLDIRS=vendor" \
 	  $(IPV6) --with-logfile=none \
 	  --without-rpm --with-libwrap --with-openssl \
@@ -40,6 +47,7 @@
 	  --with-sys-contact="root" --with-sys-location="Unknown" \
 	  --with-mib-modules="$(MIB_MODULES)" \
 	  --enable-mfd-rewrites \
+	  --with-mnttab=/etc/mtab \
 	  --with-defaults
 
 pre-build::
@@ -55,8 +63,18 @@
 	for i in $(BACKUP); do \
 		if [ -f $$i.backup ]; then mv -f $$i.backup $$i; fi ; \
 	done
+	find . -name *\.py[co] -exec rm {} \;
+	find debian -name python-*-stamp-* -exec rm {} \;
+	rm -rf python/build
 
-common-install-arch::
+common-build-arch:: $(PYVERS:%=debian/python-build-stamp-%)
+
+debian/python-build-stamp-%:
+	# Build python modules manually as the net-snmp Makefile is too limited.
+	cd python; python$* setup.py build --basedir=$(CURDIR)
+	touch $@
+
+common-install-arch:: $(PYVERS:%=debian/python-install-stamp-%)
 	# Install the "broke" headers
 	cp agent/mibgroup/struct.h debian/tmp/usr/include/net-snmp/agent
 	cp agent/mibgroup/util_funcs.h debian/tmp/usr/include/net-snmp
@@ -78,6 +96,16 @@
 	mkdir -p debian/tmp/usr/share/lintian/overrides
 	cp debian/snmpd.lintian-overrides debian/tmp/usr/share/lintian/overrides/snmpd
 
+debian/python-install-stamp-%:
+	# Build python modules manually as the net-snmp Makefile is too limited.
+	cd python; python$* setup.py install --root $(CURDIR)/debian/tmp
+	mv debian/tmp/usr/lib/python$*/site-packages/netsnmp_python-$(PYTHON_VERSION)-py$*.egg-info \
+	   debian/tmp/usr/lib/python$*/site-packages/netsnmp_python.egg-info
+	touch $@
+
+binary-install/libsnmp-python::
+	dh_pycentral -plibsnmp-python
+
 binary/libsnmp-perl::
 	dh_installexamples -plibsnmp-perl $(shell ls -d perl/SNMP/examples/* | grep -v SCCS)
 




More information about the Pkg-net-snmp-commits mailing list