OverviewpycURL requires cURL, and therefore zlib, OpenSSL, and libssh. It is pretty straight forward to cross-compile. PreparationMake sure you have a cross-compiling virtual machine properly setup. Then, make sure you have a complete cross-compiled Python available in the VM. Compilationexport DEST=/mnt/DroboFS/Shares/DroboApps/python2
cd ~/code
wget -O zlib-1.2.7.tar.gz http://zlib.net/zlib-1.2.7.tar.gz
tar zxf zlib-1.2.7.tar.gz
cd zlib-1.2.7
CFLAGS="$CFLAGS -O3" ./configure --prefix=$DEST --static
make clean && make
ZLIB=`pwd`
cd ..
wget -O openssl-1.0.1b.tar.gz http://www.openssl.org/source/openssl-1.0.1b.tar.gz
tar zxf openssl-1.0.1b.tar.gz
cd openssl-1.0.1b
./Configure linux-generic32 -DL_ENDIAN --prefix=$DEST --openssldir=$DEST/etc/ssl no-shared no-zlib-dynamic --with-zlib-include=$ZLIB --with-zlib-lib=$ZLIB
sed -i -e "s/CFLAG= /CFLAG=${CFLAGS} /g" Makefile
make clean && make
OPENSSL=`pwd`
cd ..
wget -O libssh2-1.4.1.tar.gz http://www.libssh2.org/download/libssh2-1.4.1.tar.gz
tar zxf libssh2-1.4.1.tar.gz
cd libssh2-1.4.1/
CFLAGS="$CFLAGS -O3 -I$ZLIB -I$OPENSSL/include" LDFLAGS="$LDFLAGS -L$ZLIB -L$OPENSSL" LIBS="-ldl" ./configure --host=arm-none-linux-gnueabi --prefix=$DEST --with-openssl --with-libz --disable-shared
make clean && make
LIBSSH=`pwd`
cd ..
wget -O curl-7.25.0.tar.gz http://curl.haxx.se/download/curl-7.25.0.tar.gz
tar zxf curl-7.25.0.tar.gz
cd curl-7.25.0/
CFLAGS="$CFLAGS -O3 -I$ZLIB -I$OPENSSL/include -I$LIBSSH/include" LDFLAGS="$LDFLAGS -L$ZLIB -L$OPENSSL -L$LIBSSH/src/.libs" LIBS="-ldl" ./configure --host=arm-none-linux-gnueabi --prefix=$DEST --disable-shared --with-ssl --with-zlib --with-libssh2 --with-random --with-ca-bundle=$DEST/etc/ssl/certs/ca-certificates.crt
make clean && make
sed -i -e "s|\${exec_prefix}/lib/libcurl.a||g" curl-config
chmod a+x curl-config
LIBCURL=`pwd`
cd ..
wget -O setuptools-0.6c11.tar.gz http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
tar zxf setuptools-0.6c11.tar.gz
wget -O pycurl-7.19.0.tar.gz http://pycurl.sourceforge.net/download/pycurl-7.19.0.tar.gz
tar zxf pycurl-7.19.0.tar.gz
cd pycurl-7.19.0/
PYTHONPATH=../Python-2.7.3/Lib CURL_DIR=$LIBCURL ../Python-2.7.3/hostpython setup.py build_ext --openssl-dir=$OPENSSL --curl-config=$LIBCURL/curl-config -I$LIBCURL/include -L$LIBCURL/lib/.libs
$STRIP build/lib.linux-i686-2.7/pycurl.so
PYTHONPATH=../Python-2.7.3/Lib CURL_DIR=$LIBCURL ../Python-2.7.3/hostpython setup.py build --openssl-dir=$OPENSSL --curl-config=$LIBCURL/curl-config
wget -O setup.py.patch http://www.droboports.com/python-packages/pycurl-7-19-0/setup.py.patch
patch setup.py setup.py.patch
PYTHONPATH=../Python-2.7.3-native/Lib:../setuptools-0.6c11 ../Python-2.7.3-native/python setup.py bdist_egg --openssl-dir=$OPENSSL --curl-config=$LIBCURL/curl-config
mv dist/pycurl-7.19.0-py2.7-linux-i686.egg dist/pycurl-7.19.0-py2.7.egg
InstallationStart an SSH session on the DroboFS and type: mkdir -p /mnt/DroboFS/Shares/DroboApps/python2/tmp cd /mnt/DroboFS/Shares/DroboApps/python2/tmp export TMPDIR=/mnt/DroboFS/Shares/DroboApps/python2/tmp easy_install http://www.droboports.com/python-packages/pycurl-7-19-0/pycurl-7.19.0-py2.7.egg Final remarksPlease visit the DroboSpace forums to leave your comments, suggestions and feedback. |

