Skip to content
This repository was archived by the owner on Aug 16, 2019. It is now read-only.

Commit 37839b4

Browse files
committed
packge python packages (*.pyo) into zip file
1 parent 25a5d42 commit 37839b4

File tree

3 files changed

+142
-135
lines changed

3 files changed

+142
-135
lines changed

_build_package.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@ fi
2727
cd "$PACKAGE_ROOT"
2828
python setup.py build_py -O2 -d "$BUILD_DIR"
2929

30+
echo "removing .py files ..."
31+
find "$BUILD_DIR" -name "*.py" -exec rm -f {} \;
32+
3033
cd "$ROOT"
3134

package.sh

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,33 @@ PYTHON_DIR="build/python/universal"
77

88
SITE_PACKAGES_DIR="$LIB_DIR/lib/python2.7/site-packages"
99

10-
if [ ! -d "$LIB_DIR" ]; then
11-
mkdir -p "$LIB_DIR"
10+
if [ ! -d "$SITE_PACKAGES_DIR" ]; then
11+
mkdir -p "$SITE_PACKAGES_DIR"
1212
fi
1313

14-
1514
if [ -d "$PYTHON_DIR" ]; then
15+
zip -r $PYTHON_DIR/lib/python2.7.zip $PYTHON_DIR/lib/python2.7
16+
17+
if [ 0 == $? ]; then
18+
rm -rf $PYTHON_DIR/lib/python2.7
19+
fi
1620
cp -v -r "$PYTHON_DIR"/* "$LIB_DIR"/
1721
else
1822
echo "libpython is not built yet ?"
1923
exit 1
2024
fi
2125

22-
if [ ! -d "$SITE_PACKAGES_DIR" ]; then
23-
echo "not found $SITE_PACKAGES_DIR"
24-
exit 1
25-
fi
26+
#if [ ! -d "$SITE_PACKAGES_DIR" ]; then
27+
# echo "not found $SITE_PACKAGES_DIR"
28+
# exit 1
29+
#fi
2630

27-
cp -v -r "build/twisted/twisted" "$SITE_PACKAGES_DIR/"
31+
zip -r build/twisted/twisted.zip build/twisted/twisted
32+
cp -v -r "build/twisted/twisted.zip" "$SITE_PACKAGES_DIR/"
2833
cp -v "build/twisted/libtwisted_ext.a" "$LIB_DIR/"
2934
cp -v "build/twisted/twisted.h" "$LIB_DIR/"
3035

31-
cp -v -r "build/zope.interface/zope" "$SITE_PACKAGES_DIR/"
36+
zip -r build/zope.interface/zope.zip build/zope.interface/zope
37+
cp -v -r "build/zope.interface/zope.zip" "$SITE_PACKAGES_DIR/"
3238
cp -v "build/zope.interface/libzope_interface.a" "$LIB_DIR/"
3339
cp -v "build/zope.interface/zope_interface.h" "$LIB_DIR/"

0 commit comments

Comments
 (0)