CC = gcc
PREFIX = /usr/local
CLEAN_PATTERNS = *.o *.a *.so *.gcda *.gcno
+PYTHON_VERSION = $(shell python -c "import sys; print sys.version[0:3]")
+
+# FIXME: Add a more intelligent autodetection, because this is one Debian spcific
+ifeq ($(PYTHON_VERSION), 2.5)
+ PYTHON_PACKAGES = $(PREFIX)/lib/python$(PYTHON_VERSION)/site-packages
+else
+ PYTHON_PACKAGES = $(PREFIX)/lib/python$(PYTHON_VERSION)/dist-packages
+endif
# Backend configuration
DATA_BACKEND = file
include ../config.mk
OBJS = module.o
-TARGET = libvscmgmt_python.so
+TARGET = libvscmgmtmodule.so
#
# Fancy gcc options
LDFLAGS += $(LIBVSCMGMT_LDFLAGS)
# python
-CFLAGS += $(shell python2.5-config --cflags)
-LDFLAGS += $(shell python2.5-config --libs)
+CFLAGS += $(shell python$(PYTHON_VERSION)-config --cflags)
+LDFLAGS += $(shell python$(PYTHON_VERSION)-config --libs)
#
# Rules
clean:
rm -rf -- $(TARGET) $(OBJS) $(CLEAN_PATTERNS)
-install: install-target-lib
+install:
+ mkdir -p $(PYTHON_PACKAGES)/libvscmgmt
+ @echo "> installing libvscmgmtmodule.so"
+ install -c -m 755 libvscmgmtmodule.so $(PYTHON_PACKAGES)/libvscmgmtmodule.so
+ @echo "> installing libvscmgmt/__init__.py"
+ install -c -m 644 libvscmgmt/__init__.py $(PYTHON_PACKAGES)/libvscmgmt/__init__.py
include ../rules.mk
-"""
- * Python bindings for libvscmgmt
- *
- * Copyright (C) 2009 Matthias Bolte <matthias.bolte@googlemail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-"""
+# Python bindings for libvscmgmt
+#
+# Copyright (C) 2009 Matthias Bolte <matthias.bolte@googlemail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from libvscmgmt_python import *
+from libvscmgmtmodule import *
HOST_TYPE__UNDEFINED = 0
HOST_TYPE__VIRTUAL = 1