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_DIR
:=$(STAGING_DIR
)/usr
12 PYTHON_BIN_DIR
:=$(PYTHON_DIR
)/bin
13 PYTHON_INC_DIR
:=$(PYTHON_DIR
)/include/python
$(PYTHON_VERSION
)
14 PYTHON_LIB_DIR
:=$(PYTHON_DIR
)/lib
/python
$(PYTHON_VERSION
)
16 PYTHON
:=$(PYTHON_BIN_DIR
)/python
18 PYTHON_PKG_DIR
:=/usr
/lib
/python
$(PYTHON_VERSION
)/site-packages
21 $(call shexport
,PyPackage
/$(1)/filespec
)
23 define Package
/$(1)/install
24 @getvar
$$(call shvar
,PyPackage
/$(1)/filespec
) |
( \
26 while read fop fspec fperm
; do \
27 if
[ "$$$$$$$$fop" = "+" ]; then \
28 dpath
=`dirname "$$$$$$$$fspec"`; \
29 if
[ -n
"$$$$$$$$fperm" ]; then \
30 dperm
="-m$$$$$$$$fperm"; \
32 dperm
=`stat -c "%a" $(PKG_INSTALL_DIR)$$$$$$$$dpath`; \
34 mkdir
-p
$$$$$$$$$dperm $$(1)$$$$$$$$dpath; \
35 echo
"copying: '$$$$$$$$fspec'"; \
36 cp
-fpR
$(PKG_INSTALL_DIR
)$$$$$$$$fspec $$(1)$$$$$$$$dpath/; \
37 if
[ -n
"$$$$$$$$fperm" ]; then \
38 chmod
-R
$$$$$$$$fperm $$(1)$$$$$$$$fspec; \
40 elif
[ "$$$$$$$$fop" = "-" ]; then \
41 echo
"removing: '$$$$$$$$fspec'"; \
42 rm -fR
$$(1)$$$$$$$$fspec; \
43 elif
[ "$$$$$$$$fop" = "=" ]; then \
44 echo
"setting permissions: '$$$$$$$$fperm' on '$$$$$$$$fspec'"; \
45 chmod
-R
$$$$$$$$fperm $$(1)$$$$$$$$fspec; \
49 $(call PyPackage
/$(1)/install,$$(1))
53 define Build
/Compile
/PyMod
54 ( cd
$(PKG_BUILD_DIR
)/$(1); \
55 CFLAGS
="$(TARGET_CFLAGS)" \
56 CPPFLAGS
="$(TARGET_CPPFLAGS)" \
57 LDFLAGS
="$(TARGET_LDFLAGS)" \
59 $(PYTHON
) .
/setup.py
$(2) \