Fix the whole python building process to do proper crosscompiling for all python
[openwrt/svn-archive/archive.git] / lang / psycopg / Makefile
1 #
2 # Copyright (C) 2007-2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=psycopg
12 PKG_VERSION:=1.1.21
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.initd.org/pub/software/psycopg/
17 PKG_MD5SUM:=a31f79f68d6d32898d6f24e11369a106
18
19 PKG_BUILD_DEPENDS:=python
20
21 include $(INCLUDE_DIR)/package.mk
22 -include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
23
24 define Package/python-psycopg
25 SUBMENU:=Python
26 SECTION:=lang
27 CATEGORY:=Languages
28 TITLE:=PostgreSQL database adapter for Python
29 URL:=http://www.initd.org/
30 DEPENDS:=python-core +libpq +python-egenix-mx
31 endef
32
33 define Package/python-psycopg/description
34 This package contains is a PostgreSQL database adapter for the Python
35 programming language.
36 endef
37
38 CONFIGURE_ARGS += \
39 --with-python="$(PYTHON)" \
40 --with-postgres-libraries="$(STAGING_DIR)/usr/lib" \
41 --with-postgres-includes="$(STAGING_DIR)/usr/include" \
42 --with-mxdatetime-includes="$(STAGING_DIR)$(PYTHON_PKG_DIR)/mx/DateTime/mxDateTime" \
43 --with-python-prefix=$(STAGING_DIR)/usr
44 --with-python-exec-prefix=$(STAGING_DIR)/usr
45
46 define Build/Compile
47 $(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false)
48 $(MAKE) -C $(PKG_BUILD_DIR) \
49 OPT="$(TARGET_CFLAGS)"
50 endef
51
52 define PyPackage/python-psycopg/install
53 $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
54 $(INSTALL_BIN) $(PKG_BUILD_DIR)/psycopgmodule.so $(1)$(PYTHON_PKG_DIR)/
55 endef
56
57 $(eval $(call PyPackage,python-psycopg))
58 $(eval $(call BuildPackage,python-psycopg))