2 # Copyright (C) 2007 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
13 PYTHON_DIR
:=$(STAGING_DIR
)/usr
14 PYTHON_BIN_DIR
:=$(PYTHON_DIR
)/bin
15 PYTHON_INC_DIR
:=$(PYTHON_DIR
)/include/python
$(PYTHON_VERSION
)
16 PYTHON_LIB_DIR
:=$(PYTHON_DIR
)/lib
/python
$(PYTHON_VERSION
)
18 PYTHON
:=$(PYTHON_BIN_DIR
)/python
20 PYTHON_PKG_DIR
:=/usr
/lib
/python
$(PYTHON_VERSION
)/site-packages
26 $(eval
$(call PyPackage
/$(1)))
34 $(call PyPackage
/$(1))
37 ifdef PyPackage
/$(1)/description
38 define Package
/$(1)/description
39 $(call PyPackage
/$(1)/description
)
43 $(call shexport
,PyPackage
/$(1)/filespec
)
45 define Package
/$(1)/install
46 @getvar
$$(call shvar
,PyPackage
/$(1)/filespec
) |
( \
48 while read fop fspec fperm
; do \
49 if
[ "$$$$$$$$fop" = "+" ]; then \
50 dpath
=`dirname "$$$$$$$$fspec"`; \
51 if
[ -n
"$$$$$$$$fperm" ]; then \
52 dperm
="-m$$$$$$$$fperm"; \
54 dperm
=`stat -c "%a" $(PKG_INSTALL_DIR)$$$$$$$$dpath`; \
56 mkdir
-p
$$$$$$$$$dperm $$(1)$$$$$$$$dpath; \
57 echo
"copying: '$$$$$$$$fspec'"; \
58 cp
-fpR
$(PKG_INSTALL_DIR
)$$$$$$$$fspec $$(1)$$$$$$$$dpath/; \
59 if
[ -n
"$$$$$$$$fperm" ]; then \
60 chmod
-R
$$$$$$$$fperm $$(1)$$$$$$$$fspec; \
62 elif
[ "$$$$$$$$fop" = "-" ]; then \
63 echo
"removing: '$$$$$$$$fspec'"; \
64 rm -fR
$$(1)$$$$$$$$fspec; \
65 elif
[ "$$$$$$$$fop" = "=" ]; then \
66 echo
"setting permissions: '$$$$$$$$fperm' on '$$$$$$$$fspec'"; \
67 chmod
-R
$$$$$$$$fperm $$(1)$$$$$$$$fspec; \
71 $(call PyPackage
/$(1)/install,$$(1))
74 $$(eval
$$(call BuildPackage
,$(1)))
77 define Build
/Compile
/PyMod
78 ( cd
$(PKG_BUILD_DIR
)/$(1); \
79 CFLAGS
="$(TARGET_CFLAGS)" \
80 CPPFLAGS
="$(TARGET_CPPFLAGS)" \
81 LDFLAGS
="$(TARGET_LDFLAGS)" \
83 $(PYTHON
) .
/setup.py
$(2) \