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.
10 PYTHON_DIR
:=$(STAGING_DIR
)/usr
11 PYTHON_BIN_DIR
:=$(PYTHON_DIR
)/bin
12 PYTHON_INC_DIR
:=$(PYTHON_DIR
)/include/python
$(PYTHON_VERSION
)
13 PYTHON_LIB_DIR
:=$(PYTHON_DIR
)/lib
/python
$(PYTHON_VERSION
)
15 PYTHON
:=python
$(PYTHON_VERSION
)
17 PYTHON_PKG_DIR
:=/usr
/lib
/python
$(PYTHON_VERSION
)/site-packages
20 $(call shexport
,PyPackage
/$(1)/filespec
)
22 define Package
/$(1)/install
23 @getvar
$$(call shvar
,PyPackage
/$(1)/filespec
) |
( \
25 while read fop fspec fperm
; do \
26 if
[ "$$$$$$$$fop" = "+" ]; then \
27 dpath
=`dirname "$$$$$$$$fspec"`; \
28 if
[ -n
"$$$$$$$$fperm" ]; then \
29 dperm
="-m$$$$$$$$fperm"; \
31 dperm
=`stat -c "%a" $(PKG_INSTALL_DIR)$$$$$$$$dpath`; \
33 mkdir
-p
$$$$$$$$$dperm $$(1)$$$$$$$$dpath; \
34 echo
"copying: '$$$$$$$$fspec'"; \
35 cp
-fpR
$(PKG_INSTALL_DIR
)$$$$$$$$fspec $$(1)$$$$$$$$dpath/; \
36 if
[ -n
"$$$$$$$$fperm" ]; then \
37 chmod
-R
$$$$$$$$fperm $$(1)$$$$$$$$fspec; \
39 elif
[ "$$$$$$$$fop" = "-" ]; then \
40 echo
"removing: '$$$$$$$$fspec'"; \
41 rm -fR
$$(1)$$$$$$$$fspec; \
42 elif
[ "$$$$$$$$fop" = "=" ]; then \
43 echo
"setting permissions: '$$$$$$$$fperm' on '$$$$$$$$fspec'"; \
44 chmod
-R
$$$$$$$$fperm $$(1)$$$$$$$$fspec; \
48 $(call PyPackage
/$(1)/install,$$(1))
52 define Build
/Compile
/PyMod
53 ( cd
$(PKG_BUILD_DIR
)/$(1); \
54 CFLAGS
="$(TARGET_CFLAGS)" \
55 CPPFLAGS
="$(TARGET_CPPFLAGS)" \
56 LDFLAGS
="$(TARGET_LDFLAGS)" \
58 $(PYTHON
) .
/setup.py
$(2) && \
59 find
$(PKG_INSTALL_DIR
) -name
"*\.pyc" -o
-name
"*\.pyo" | xargs
rm -f \