massive python changes:
* move all python packages to lang section * add a python-package.mk rules file sourced by all python packages for PyPackage/* defs * introduce a new way of specifying files to be packaged (experimental) * add missing svn:properties git-svn-id: svn://svn.openwrt.org/openwrt/packages@8639 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
@ -28,7 +28,7 @@ PY_DISABLED_MODULES=\
|
||||
define Package/python
|
||||
SECTION:=lang
|
||||
CATEGORY:=Languages
|
||||
DEPENDS:=+uclibcxx +libpthread +libreadline +libncurses +libopenssl +libexpat
|
||||
DEPENDS:=+libexpat +libopenssl +libpthread +libreadline +uclibcxx
|
||||
TITLE:=Python 2.5 programming language
|
||||
URL:=http://www.python.org/
|
||||
endef
|
||||
@ -66,15 +66,15 @@ define Build/Configure
|
||||
endef
|
||||
|
||||
MAKE_OPTS:=\
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
PYTHON_MODULES_INCLUDE=$(STAGING_DIR)/include \
|
||||
PYTHON_MODULES_LIB=$(STAGING_DIR)/lib \
|
||||
PYTHON_DISABLE_MODULES="$(PY_DISABLED_MODULES)" \
|
||||
CFLAGS="$(TARGET_CFLAGS) -fno-inline" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS) -lncurses" \
|
||||
LD="$(TARGET_CC)" \
|
||||
HOSTPYTHON=./hostpython \
|
||||
HOSTPGEN=./Parser/hostpgen
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
PYTHON_MODULES_INCLUDE=$(STAGING_DIR)/include \
|
||||
PYTHON_MODULES_LIB=$(STAGING_DIR)/lib \
|
||||
PYTHON_DISABLE_MODULES="$(PY_DISABLED_MODULES)" \
|
||||
CFLAGS="$(TARGET_CFLAGS) -fno-inline" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
LD="$(TARGET_CC)" \
|
||||
HOSTPYTHON=./hostpython \
|
||||
HOSTPGEN=./Parser/hostpgen
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
@ -92,12 +92,13 @@ define Build/InstallDev
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/python2.5 $(STAGING_DIR)/usr/include/
|
||||
mkdir -p $(STAGING_DIR)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/python2.5 $(STAGING_DIR)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/libpython2.5.a $(STAGING_DIR)/usr/lib/python2.5
|
||||
$(CP) $(PKG_BUILD_DIR)/libpython2.5.a $(STAGING_DIR)/usr/lib/python2.5/
|
||||
endef
|
||||
|
||||
define Build/UninstallDev
|
||||
rm -rf \
|
||||
$(STAGING_DIR)/usr/{include,lib}/python2.5
|
||||
rm -rf $(STAGING_DIR)/usr/bin/hostpython \
|
||||
$(STAGING_DIR)/usr/include/python2.5 \
|
||||
$(STAGING_DIR)/usr/lib/python2.5
|
||||
endef
|
||||
|
||||
define Package/python/install
|
||||
@ -108,8 +109,7 @@ define Package/python/install
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/python2.5/Python.h $(1)/usr/include/python2.5/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/python2.5 $(1)/usr/lib/
|
||||
rm -rf \
|
||||
$(1)/usr/lib/python2.5/bsddb/test \
|
||||
rm -rf $(1)/usr/lib/python2.5/bsddb/test \
|
||||
$(1)/usr/lib/python2.5/distutils/tests \
|
||||
$(1)/usr/lib/python2.5/email/test \
|
||||
$(1)/usr/lib/python2.5/idlelib \
|
||||
|
82
lang/python/python-package.mk
Normal file
82
lang/python/python-package.mk
Normal file
@ -0,0 +1,82 @@
|
||||
#
|
||||
# Copyright (C) 2007 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
# $Id$
|
||||
|
||||
ifeq ($(DUMP),)
|
||||
|
||||
PYTHON:=$(STAGING_DIR)/usr/bin/hostpython
|
||||
|
||||
PYTHON_VERSION=2.5
|
||||
|
||||
PYTHON_INC_DIR:=$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION)
|
||||
PYTHON_LIB_DIR:=$(STAGING_DIR)/usr/lib/python$(PYTHON_VERSION)
|
||||
|
||||
PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages
|
||||
|
||||
endif
|
||||
|
||||
define PyPackage
|
||||
NAME:=$(1)
|
||||
$(eval $(call PyPackage/$(1)))
|
||||
|
||||
define Package/$(1)
|
||||
TITLE:=$(TITLE)
|
||||
SECTION:=lang
|
||||
CATEGORY:=Languages
|
||||
DEPENDS:=+python
|
||||
$(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
|
||||
@getvar $$(call shvar,PyPackage/$(1)/filespec) | ( \
|
||||
IFS='|'; \
|
||||
while read fop fspec fperm; do \
|
||||
if [ "$$$$$$$$fop" = "+" ]; then \
|
||||
dpath=`dirname "$$$$$$$$fspec"`; \
|
||||
if [ -n "$$$$$$$$fperm" ]; then \
|
||||
dperm="-m$$$$$$$$fperm"; \
|
||||
else \
|
||||
dperm=`stat -c "%a" $(PKG_INSTALL_DIR)$$$$$$$$dpath`; \
|
||||
fi; \
|
||||
mkdir -p $$$$$$$$$dperm $$(1)$$$$$$$$dpath; \
|
||||
echo "copying: '$$$$$$$$fspec'"; \
|
||||
cp -fpR $(PKG_INSTALL_DIR)$$$$$$$$fspec $$(1)$$$$$$$$dpath/; \
|
||||
if [ -n "$$$$$$$$fperm" ]; then \
|
||||
chmod -R $$$$$$$$fperm $$(1)$$$$$$$$fspec; \
|
||||
fi; \
|
||||
elif [ "$$$$$$$$fop" = "-" ]; then \
|
||||
echo "removing: '$$$$$$$$fspec'"; \
|
||||
rm -fR $$(1)$$$$$$$$fspec; \
|
||||
elif [ "$$$$$$$$fop" = "=" ]; then \
|
||||
echo "setting permissions: '$$$$$$$$fperm' on '$$$$$$$$fspec'"; \
|
||||
chmod -R $$$$$$$$fperm $$(1)$$$$$$$$fspec; \
|
||||
fi; \
|
||||
done; \
|
||||
)
|
||||
$(call PyPackage/$(1)/install,$$(1))
|
||||
endef
|
||||
|
||||
$$(eval $$(call BuildPackage,$(1)))
|
||||
endef
|
||||
|
||||
define Build/Compile/PyMod
|
||||
( cd $(PKG_BUILD_DIR)/$(1); \
|
||||
CFLAGS="$(TARGET_CFLAGS)" \
|
||||
CPPFLAGS="$(TARGET_CPPFLAGS)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
$(3) \
|
||||
$(PYTHON) ./setup.py $(2) \
|
||||
);
|
||||
endef
|
Reference in New Issue
Block a user