From ddfb9ac5683d0cb8a3a2ed5581d05f46bf7445d9 Mon Sep 17 00:00:00 2001 From: Chet Luther Date: Fri, 27 May 2011 10:57:17 -0500 Subject: [PATCH] Adding pg8000 submodule. --- .gitmodules | 3 +++ GNUmakefile | 40 ++++++++++++++++++++++++++++++++++++++++ setup.py | 21 +++++++++++++++++++++ src/pg8000 | 1 + 4 files changed, 65 insertions(+) create mode 100644 .gitmodules create mode 100644 GNUmakefile create mode 160000 src/pg8000 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..3302738 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src/pg8000"] + path = src/pg8000 + url = https://github.com/mfenniak/pg8000.git diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..fe1cf9f --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,40 @@ +########################################################################### +# +# This program is part of Zenoss Core, an open source monitoring platform. +# Copyright (C) 2011, Zenoss Inc. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 or (at your +# option) any later version as published by the Free Software Foundation. +# +# For complete information please visit: http://www.zenoss.com/oss/ +# +########################################################################### + +PYTHON=python +SRC_DIR=$(PWD)/src +PG8000_DIR=$(SRC_DIR)/pg8000 +ZP_DIR=$(PWD)/ZenPacks/zenoss/PostgreSQL +BIN_DIR=$(ZP_DIR)/bin +LIB_DIR=$(ZP_DIR)/lib + +default: egg + +egg: + # setup.py will call 'make build' before creating the egg + python setup.py bdist_egg + +build: + git submodule init ; \ + git submodule update ; \ + cd $(PG8000_DIR) ; \ + PYTHONPATH="$(PYTHONPATH):$(LIB_DIR)" \ + $(PYTHON) setup.py install \ + --install-lib="$(LIB_DIR)" \ + --install-scripts="$(BIN_DIR)" + +clean: + rm -rf build dist *.egg-info + find . -name '*.pyc' | xargs rm + cd $(PG8000_DIR) ; rm -rf build dist *.egg-info + diff --git a/setup.py b/setup.py index 1673819..1c8f9aa 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,16 @@ +########################################################################### +# +# This program is part of Zenoss Core, an open source monitoring platform. +# Copyright (C) 2011, Zenoss Inc. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 or (at your +# option) any later version as published by the Free Software Foundation. +# +# For complete information please visit: http://www.zenoss.com/oss/ +# +########################################################################### + ################################ # These variables are overwritten by Zenoss when the ZenPack is exported # or saved. Do not modify them directly here. @@ -17,6 +30,14 @@ from setuptools import setup, find_packages +# make build +import subprocess +p = subprocess.Popen('make build', shell=True) +if p.poll() == None: + p.wait() +if p.returncode != 0: + raise Exception('make exited with an error: %s' % p.returncode) + setup( # This ZenPack metadata should usually be edited with the Zenoss # ZenPack edit page. Whenever the edit page is submitted it will diff --git a/src/pg8000 b/src/pg8000 new file mode 160000 index 0000000..5484f95 --- /dev/null +++ b/src/pg8000 @@ -0,0 +1 @@ +Subproject commit 5484f950ccbdd31b319b1e7d738b59099f165bf3