clean up python packaging code.
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 21 Oct 2007 10:20:01 +0000 (10:20 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 21 Oct 2007 10:20:01 +0000 (10:20 +0000)
- packages must not rely on stuff in package/ outside of their own directory
- python-package.mk is installed to $(STAGING_DIR)/mk
- python-package.mk must not be required at DUMP time

git-svn-id: svn://svn.openwrt.org/openwrt/packages@9387 3c298f89-4303-0410-b956-a3cf2f4a3e73

lang/egenix-mx/Makefile
lang/kid/Makefile
lang/psycopg/Makefile
lang/pyevent/Makefile
lang/pymysql/Makefile
lang/pypcap/Makefile
lang/pysqlite/Makefile
lang/python/Makefile
lang/python/python-package.mk
lang/twisted/Makefile
lang/yapsnmp/Makefile

index 1517a25..2c9e0b1 100644 (file)
@@ -17,16 +17,23 @@ PKG_SOURCE_URL:=http://www.egenix.com/files/python/
 PKG_MD5SUM:=66841151728a06f92d0b8dd2ed317a29
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-base-$(PKG_VERSION)
+PKG_BUILD_DEPENDS:=python
 
 include $(INCLUDE_DIR)/package.mk
-include ../python/python-package.mk
+-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
+ifeq ($(DUMP)$(Build/Compile/PyMod),)
+  $(error Python packaging code not found.)
+endif
 
-define PyPackage/python-egenix-mx
- TITLE:=Egenix mxBase
- URL:=http://www.egenix.com/products/python/mxBase/
+define Package/python-egenix-mx
+  SECTION:=lang
+  CATEGORY:=Languages
+  DEPENDS:=python-core
+  TITLE:=Egenix mxBase
+  URL:=http://www.egenix.com/products/python/mxBase/
 endef
 
-define PyPackage/python-egenix-mx/description
+define Package/python-egenix-mx/description
  This package contains a set of base packages from Egenix required by other 
  python packages.
 endef
@@ -88,3 +95,4 @@ define PyPackage/python-egenix-mx/install
 endef
 
 $(eval $(call PyPackage,python-egenix-mx))
+$(eval $(call BuildPackage,python-egenix-mx))
index af007aa..19aa6ec 100644 (file)
@@ -5,7 +5,7 @@
 # See /LICENSE for more information.
 #
 # $Id$
+
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=kid
@@ -15,16 +15,23 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.kid-templating.org/dist/0.9.6/dist
 PKG_MD5SUM:=31e7156698a6f214b4067afb9e13728f
+PKG_BUILD_DEPENDS:=python
 
 include $(INCLUDE_DIR)/package.mk
-include ../python/python-package.mk
-
-define PyPackage/python-kid
- TITLE:=XML-based Templating
- URL:=http://www.kid-templating.org/
+-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
+ifeq ($(DUMP)$(Build/Compile/PyMod),)
+  $(error Python packaging code not found.)
+endif
+
+define Package/python-kid
+  SECTION:=lang
+  CATEGORY:=Languages
+  DEPENDS:=python-core
+  TITLE:=XML-based Templating
+  URL:=http://www.kid-templating.org/
 endef
 
-define PyPackage/python-kid/description
+define Package/python-kid/description
  Kid is a simple template language for XML based vocabularies written in 
  Python.
 endef
@@ -41,3 +48,4 @@ define Build/Compile
 endef
 
 $(eval $(call PyPackage,python-kid))
+$(eval $(call BuildPackage,python-kid))
index 1f22b52..a1fdb49 100644 (file)
@@ -15,17 +15,23 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.initd.org/pub/software/psycopg/
 PKG_MD5SUM:=a31f79f68d6d32898d6f24e11369a106
+PKG_BUILD_DEPENDS:=python
 
 include $(INCLUDE_DIR)/package.mk
-include ../python/python-package.mk
-
-define PyPackage/python-psycopg
- TITLE:=PostgreSQL database adapter for Python
- URL:=http://www.initd.org/
- DEPENDS+= +libpq +python-egenix-mx
+-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
+ifeq ($(DUMP)$(Build/Compile/PyMod),)
+  $(error Python packaging code not found.)
+endif
+
+define Package/python-psycopg
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=PostgreSQL database adapter for Python
+  URL:=http://www.initd.org/
+  DEPENDS:=python-core +libpq +python-egenix-mx
 endef
 
-define PyPackage/python-psycopg/description
+define Package/python-psycopg/description
  This package contains is a PostgreSQL database adapter for the Python 
  programming language.
 endef
@@ -47,3 +53,4 @@ define PyPackage/python-psycopg/install
 endef
 
 $(eval $(call PyPackage,python-psycopg))
+$(eval $(call BuildPackage,python-psycopg))
index 6cc8977..63e1fd1 100644 (file)
@@ -15,14 +15,20 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://pyevent.googlecode.com/files/
 PKG_MD5SUM:=584912c92d08bf005283fb29a47a6e4d
+PKG_BUILD_DEPENDS:=python
 
 include $(INCLUDE_DIR)/package.mk
-include ../python/python-package.mk
-
-define PyPackage/python-event
- TITLE:=Python interface to libevent
- URL:=http://code.google.com/p/pyevent/
- DEPENDS+= +libevent
+-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
+ifeq ($(DUMP)$(Build/Compile/PyMod),)
+  $(error Python packaging code not found.)
+endif
+
+define Package/python-event
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Python interface to libevent
+  URL:=http://code.google.com/p/pyevent/
+  DEPENDS:=python-core +libevent
 endef
 
 define PyPackage/python-event/filespec
@@ -37,3 +43,4 @@ define Build/Compile
 endef
 
 $(eval $(call PyPackage,python-event))
+$(eval $(call BuildPackage,python-event))
index d1bd2bf..868643b 100644 (file)
@@ -15,17 +15,23 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/mysql-python
 PKG_MD5SUM:=532268f02870bea18c1d465e88afff30
+PKG_BUILD_DEPENDS:=python
 
 include $(INCLUDE_DIR)/package.mk
-include ../python/python-package.mk
-
-define PyPackage/python-mysql
- TITLE:=MySQL database adapter for Python
- URL:=http://mysql-python.sourceforge.net/
- DEPENDS+= +libmysqlclient
+-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
+ifeq ($(DUMP)$(Build/Compile/PyMod),)
+  $(error Python packaging code not found.)
+endif
+
+define Package/python-mysql
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=MySQL database adapter for Python
+  URL:=http://mysql-python.sourceforge.net/
+  DEPENDS:=python-core +libmysqlclient
 endef
 
-define PyPackage/python-mysql/description
+define Package/python-mysql/description
  MySQLdb is an thread-compatible interface to the popular MySQL database 
  server that provides the Python database API.
 endef
@@ -43,3 +49,4 @@ define Build/Compile
 endef
 
 $(eval $(call PyPackage,python-mysql))
+$(eval $(call BuildPackage,python-mysql))
index ddf3cc4..46adf69 100644 (file)
@@ -15,14 +15,20 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://pypcap.googlecode.com/files
 PKG_MD5SUM:=034c3cbbfa81aa19e8f685b767c65764
+PKG_BUILD_DEPENDS:=python
 
 include $(INCLUDE_DIR)/package.mk
-include ../python/python-package.mk
-
-define PyPackage/python-pcap
- TITLE:=Python interface to lipcap
- URL:=http://code.google.com/p/pypcap/
- DEPENDS+= +libpcap
+-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
+ifeq ($(DUMP)$(Build/Compile/PyMod),)
+  $(error Python packaging code not found.)
+endif
+
+define Package/python-pcap
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Python interface to lipcap
+  URL:=http://code.google.com/p/pypcap/
+  DEPENDS:=python-core +libpcap
 endef
 
 define PyPackage/python-pcap/filespec
@@ -37,3 +43,4 @@ define Build/Compile
 endef
 
 $(eval $(call PyPackage,python-pcap))
+$(eval $(call BuildPackage,python-pcap))
index 3f1bfab..bade7b3 100644 (file)
@@ -15,17 +15,21 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://initd.org/pub/software/pysqlite/releases/2.3/2.3.5/
 PKG_MD5SUM:=b4a185e936848370fcc1a5b17755b641
+PKG_BUILD_DEPENDS:=python
 
 include $(INCLUDE_DIR)/package.mk
-include ../python/python-package.mk
+-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
+ifeq ($(DUMP)$(Build/Compile/PyMod),)
+  $(error Python packaging code not found.)
+endif
 
-define PyPackage/python-sqlite
+define Package/python-sqlite
  TITLE:=SQLite database adapter for Python
  URL:=http://www.initd.org/tracker/pysqlite/wiki/pysqlite
- DEPENDS+= +libsqlite3
+ DEPENDS:= +libsqlite3
 endef
 
-define PyPackage/python-sqlite/description
+define Package/python-sqlite/description
  This package contains an SQLite database adapter for the Python 
  programming language.
 endef
@@ -42,3 +46,4 @@ define Build/Compile
 endef
 
 $(eval $(call PyPackage,python-sqlite))
+$(eval $(call BuildPackage,python-sqlite))
index 24e581c..7115a75 100644 (file)
@@ -5,7 +5,7 @@
 # See /LICENSE for more information.
 #
 # $Id$
+
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=python
@@ -18,12 +18,12 @@ PKG_MD5SUM:=70084ffa561660f07de466c2c8c4842d
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
 
-PKG_BUILD_DEPENDS:=libexpat libopenssl zlib
+PKG_BUILD_DEPENDS:=python libexpat libopenssl zlib
 
 include $(INCLUDE_DIR)/package.mk
-include ./python-package.mk
+-include $(if $(DUMP),,./python-package.mk)
 
-define PyPackage/python/Default
+define Package/python/Default
   SUBMENU:=Python
   SECTION:=lang
   CATEGORY:=Languages
@@ -31,7 +31,7 @@ define PyPackage/python/Default
   URL:=http://www.python.org/
 endef
 
-define PyPackage/python/Default/description
+define Package/python/Default/description
  Python is a dynamic object-oriented programming language that can be used 
  for many kinds of software development. It offers strong support for 
  integration with other languages and tools, comes with extensive standard 
@@ -40,45 +40,45 @@ define PyPackage/python/Default/description
  the development of higher quality, more maintainable code.
 endef
 
-define PyPackage/python
-$(call PyPackage/python/Default)
+define Package/python
+$(call Package/python/Default)
  TITLE+= (full)
  DEPENDS:= +libpthread +zlib
  PROVIDES:=python-core
 endef
 
-define PyPackage/python/description
-$(call PyPackage/python/Default/description)
+define Package/python/description
+$(call Package/python/Default/description)
  .
  This package contains the full Python install.
 endef
 
-define PyPackage/python-mini
-$(call PyPackage/python/Default)
+define Package/python-mini
+$(call Package/python/Default)
  TITLE+= (minimal)
  DEPENDS:= +libpthread +zlib
  PROVIDES:=python-core
 endef
 
-define PyPackage/python-mini/description
-$(call PyPackage/python/Default/description)
+define Package/python-mini/description
+$(call Package/python/Default/description)
  .
  This package contains only a minimal Python install.
 endef
 
-define PyPackage/python-doc
-$(call PyPackage/python/Default)
+define Package/python-doc
+$(call Package/python/Default)
  TITLE:=Python interactive documentation
 endef
 
-define PyPackage/python-expat
-$(call PyPackage/python/Default)
+define Package/python-expat
+$(call Package/python/Default)
  TITLE:=Python support for expat
  DEPENDS+= +libexpat
 endef
 
-define PyPackage/python-openssl
-$(call PyPackage/python/Default)
+define Package/python-openssl
+$(call Package/python/Default)
  TITLE:=Python support for OpenSSL
  DEPENDS+= +libopenssl
 endef
@@ -135,6 +135,8 @@ define Build/Compile
 endef
 
 define Build/InstallDev
+       $(INSTALL_DIR) $(1)/mk
+       $(INSTALL_DATA) ./python-package.mk $(1)/mk/
        mkdir -p $(1)/usr/bin
        $(CP) $(PKG_BUILD_DIR)/hostpython $(1)/usr/bin/
        ln -sf hostpython $(1)/usr/bin/python
@@ -149,11 +151,12 @@ define Build/InstallDev
 endef
 
 define Build/UninstallDev
-       rm -rf  $(STAGING_DIR)/usr/bin/hostpython \
-               $(STAGING_DIR)/usr/bin/python \
-               $(STAGING_DIR)/usr/include/python$(PYTHON_VERSION) \
-               $(STAGING_DIR)/usr/lib/python$(PYTHON_VERSION) \
-               $(STAGING_DIR)/usr/lib/libpython$(PYTHON_VERSION).a
+       rm -rf \
+               $(1)/usr/bin/hostpython \
+               $(1)/usr/bin/python \
+               $(1)/usr/include/python$(PYTHON_VERSION) \
+               $(1)/usr/lib/python$(PYTHON_VERSION) \
+               $(1)/usr/lib/libpython$(PYTHON_VERSION).a
 endef
 
 define PyPackage/python/filespec
@@ -266,3 +269,9 @@ $(eval $(call PyPackage,python-doc))
 $(eval $(call PyPackage,python-expat))
 $(eval $(call PyPackage,python-openssl))
 
+$(eval $(call BuildPackage,python))
+$(eval $(call BuildPackage,python-mini))
+$(eval $(call BuildPackage,python-doc))
+$(eval $(call BuildPackage,python-expat))
+$(eval $(call BuildPackage,python-openssl))
+
index 78409f2..6ad1221 100644 (file)
@@ -6,40 +6,18 @@
 #
 # $Id$
 
-ifeq ($(DUMP),)
+PYTHON_VERSION=2.5
 
-  PYTHON_VERSION=2.5
+PYTHON_DIR:=$(STAGING_DIR)/usr
+PYTHON_BIN_DIR:=$(PYTHON_DIR)/bin
+PYTHON_INC_DIR:=$(PYTHON_DIR)/include/python$(PYTHON_VERSION)
+PYTHON_LIB_DIR:=$(PYTHON_DIR)/lib/python$(PYTHON_VERSION)
 
-  PYTHON_DIR:=$(STAGING_DIR)/usr
-  PYTHON_BIN_DIR:=$(PYTHON_DIR)/bin
-  PYTHON_INC_DIR:=$(PYTHON_DIR)/include/python$(PYTHON_VERSION)
-  PYTHON_LIB_DIR:=$(PYTHON_DIR)/lib/python$(PYTHON_VERSION)
+PYTHON:=$(PYTHON_BIN_DIR)/python
 
-  PYTHON:=$(PYTHON_BIN_DIR)/python
-
-  PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages
-
-endif
+PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages
 
 define PyPackage
-  NAME:=$(1)
-  $(eval $(call PyPackage/$(1)))
-
-  define Package/$(1)
-    SUBMENU:=Python
-    TITLE:=$(TITLE)
-    SECTION:=lang
-    CATEGORY:=Languages
-    DEPENDS:=python-core
-    $(call PyPackage/$(1))
-  endef
-
-  ifdef PyPackage/$(1)/description
-    define Package/$(1)/description
-$(call PyPackage/$(1)/description)
-    endef
-  endif
-
   $(call shexport,PyPackage/$(1)/filespec)
 
   define Package/$(1)/install
@@ -70,8 +48,6 @@ $(call PyPackage/$(1)/description)
        )
        $(call PyPackage/$(1)/install,$$(1))
   endef
-
-  $$(eval $$(call BuildPackage,$(1)))
 endef
 
 define Build/Compile/PyMod
index 9f96e54..799e826 100644 (file)
@@ -17,76 +17,83 @@ PKG_SOURCE_URL:=http://tmrc.mit.edu/mirror/twisted/Twisted/2.5
 PKG_MD5SUM:=56df2ae66db57932515a491c03bf514f
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/Twisted-$(PKG_VERSION)
+PKG_BUILD_DEPENDS:=python
 
 include $(INCLUDE_DIR)/package.mk
-include ../python/python-package.mk
+-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
+ifeq ($(DUMP)$(Build/Compile/PyMod),)
+  $(error Python packaging code not found.)
+endif
 
-define PyPackage/twisted/default
- URL:=http://twistedmatrix.com/
+define Package/twisted/default
+  SECTION:=lang
+  CATEGORY:=Languages
+  DEPENDS:=python-core
+  URL:=http://twistedmatrix.com/
 endef
 
-define PyPackage/twisted/default/description
+define Package/twisted/default/description
  Twisted is a networking engine written in Python, supporting numerous 
  protocols. It contains a web server, numerous chat clients, chat servers, 
  mail servers, and more.
 endef
 
-define PyPackage/twisted
-$(call PyPackage/twisted/default)
- TITLE:=Python networking engine
- DEPENDS+= +zope-interface
+define Package/twisted
+$(call Package/twisted/default)
 TITLE:=Python networking engine
 DEPENDS+= +zope-interface
 endef
 
-define PyPackage/twisted-conch
-$(call PyPackage/twisted/default)
+define Package/twisted-conch
+$(call Package/twisted/default)
   TITLE:=Twisted - Conch
   DEPENDS+= twisted
 endef
 
-define PyPackage/twisted-lore
-$(call PyPackage/twisted/default)
+define Package/twisted-lore
+$(call Package/twisted/default)
   TITLE:=Twisted - Lore
   DEPENDS+= twisted
 endef
 
-define PyPackage/twisted-mail
-$(call PyPackage/twisted/default)
+define Package/twisted-mail
+$(call Package/twisted/default)
   TITLE:=Twisted - Mail
   DEPENDS+= twisted
 endef
 
-define PyPackage/twisted-names
-$(call PyPackage/twisted/default)
+define Package/twisted-names
+$(call Package/twisted/default)
   TITLE:=Twisted - Names
   DEPENDS+= twisted
 endef
 
-define PyPackage/twisted-news
-$(call PyPackage/twisted/default)
+define Package/twisted-news
+$(call Package/twisted/default)
   TITLE:=Twisted - News
   DEPENDS+= twisted
 endef
 
-define PyPackage/twisted-runner
-$(call PyPackage/twisted/default)
+define Package/twisted-runner
+$(call Package/twisted/default)
   TITLE:=Twisted - Runner
   DEPENDS+= twisted
 endef
 
-define PyPackage/twisted-web
-$(call PyPackage/twisted/default)
+define Package/twisted-web
+$(call Package/twisted/default)
   TITLE:=Twisted - Web
   DEPENDS+= twisted
 endef
 
-define PyPackage/twisted-words
-$(call PyPackage/twisted/default)
+define Package/twisted-words
+$(call Package/twisted/default)
   TITLE:=Twisted - Words
   DEPENDS+= twisted
 endef
 
-define PyPackage/zope-interface
-$(call PyPackage/twisted/default)
+define Package/zope-interface
+$(call Package/twisted/default)
   TITLE:=Zope interface
 endef
 
@@ -230,3 +237,14 @@ $(eval $(call PyPackage,twisted-runner))
 $(eval $(call PyPackage,twisted-web))
 $(eval $(call PyPackage,twisted-words))
 $(eval $(call PyPackage,zope-interface))
+
+$(eval $(call BuildPackage,twisted))
+$(eval $(call BuildPackage,twisted-conch))
+$(eval $(call BuildPackage,twisted-lore))
+$(eval $(call BuildPackage,twisted-mail))
+$(eval $(call BuildPackage,twisted-names))
+$(eval $(call BuildPackage,twisted-news))
+$(eval $(call BuildPackage,twisted-runner))
+$(eval $(call BuildPackage,twisted-web))
+$(eval $(call BuildPackage,twisted-words))
+$(eval $(call BuildPackage,zope-interface))
index 651337d..851fe9f 100644 (file)
@@ -15,17 +15,23 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
 PKG_MD5SUM:=8a3e9a5b814388d7907c639105cb2365
+PKG_BUILD_DEPENDS:=python
 
 include $(INCLUDE_DIR)/package.mk
-include ../python/python-package.mk
+-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
+ifeq ($(DUMP)$(Build/Compile/PyMod),)
+  $(error Python packaging code not found.)
+endif
 
-define PyPackage/python-yapsnmp
- TITLE:=Python interface to Net-SNMP
- URL:=http://yapsnmp.sourceforge.net/
- DEPENDS+= +libnetsnmp
+define Package/python-yapsnmp
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Python interface to Net-SNMP
+  URL:=http://yapsnmp.sourceforge.net/
+  DEPENDS:=python-core +libnetsnmp
 endef
 
-define PyPackage/python-yapsnmp/description
+define Package/python-yapsnmp/description
  This package contains a Python SNMP module based on the net-snmp (formerly 
  known as ucd-snmp) library. It's composed of a low level interface to the 
  library, created using SWIG, and a higher level python module removing all 
@@ -62,3 +68,4 @@ define Build/Compile
 endef
 
 $(eval $(call PyPackage,python-yapsnmp))
+$(eval $(call BuildPackage,python-yapsnmp))