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.
11 PYTHON
:=$(STAGING_DIR
)/usr
/bin
/hostpython
15 PYTHON_INC_DIR
:=$(STAGING_DIR
)/usr
/include/python
$(PYTHON_VERSION
)
16 PYTHON_LIB_DIR
:=$(STAGING_DIR
)/usr
/lib
/python
$(PYTHON_VERSION
)
18 PYTHON_PKG_DIR
:=/usr
/lib
/python
$(PYTHON_VERSION
)/site-packages
24 $(eval
$(call PyPackage
/$(1)))
31 $(call PyPackage
/$(1))
34 ifdef PyPackage
/$(1)/description
35 define Package
/$(1)/description
36 $(call PyPackage
/$(1)/description
)
40 $(call shexport
,PyPackage
/$(1)/filespec
)
42 define Package
/$(1)/install
43 @getvar
$$(call shvar
,PyPackage
/$(1)/filespec
) |
( \
45 while read fop fspec fperm
; do \
46 if
[ "$$$$$$$$fop" = "+" ]; then \
47 dpath
=`dirname "$$$$$$$$fspec"`; \
48 if
[ -n
"$$$$$$$$fperm" ]; then \
49 dperm
="-m$$$$$$$$fperm"; \
51 dperm
=`stat -c "%a" $(PKG_INSTALL_DIR)$$$$$$$$dpath`; \
53 mkdir
-p
$$$$$$$$$dperm $$(1)$$$$$$$$dpath; \
54 echo
"copying: '$$$$$$$$fspec'"; \
55 cp
-fpR
$(PKG_INSTALL_DIR
)$$$$$$$$fspec $$(1)$$$$$$$$dpath/; \
56 if
[ -n
"$$$$$$$$fperm" ]; then \
57 chmod
-R
$$$$$$$$fperm $$(1)$$$$$$$$fspec; \
59 elif
[ "$$$$$$$$fop" = "-" ]; then \
60 echo
"removing: '$$$$$$$$fspec'"; \
61 rm -fR
$$(1)$$$$$$$$fspec; \
62 elif
[ "$$$$$$$$fop" = "=" ]; then \
63 echo
"setting permissions: '$$$$$$$$fperm' on '$$$$$$$$fspec'"; \
64 chmod
-R
$$$$$$$$fperm $$(1)$$$$$$$$fspec; \
68 $(call PyPackage
/$(1)/install,$$(1))
71 $$(eval
$$(call BuildPackage
,$(1)))
74 define Build
/Compile
/PyMod
75 ( cd
$(PKG_BUILD_DIR
)/$(1); \
76 CFLAGS
="$(TARGET_CFLAGS)" \
77 CPPFLAGS
="$(TARGET_CPPFLAGS)" \
78 LDFLAGS
="$(TARGET_LDFLAGS)" \
80 $(PYTHON
) .
/setup.py
$(2) \