.. index:: Python_2.7.8 Python 2.7.8 ============= .. contents:: Contents =========== 実行環境 =========== :ref:`centos_6.3` =========== 最終検証日 =========== 2014/08/22 =========== 依存関係 =========== ================ 推奨ライブラリ ================ * :doc:`../../library/zlib/index` * :doc:`../../library/bzip2/index` * :doc:`../../library/openssl/index` * :doc:`../../library/readline/index` =========== コンパイル =========== .. note:: 基本的には管理者ユーザ(rootなど)で実施していることを前提としています .. code-block:: bash #------------------------------------------------------------ # Python-2.7.8 #------------------------------------------------------------ BASE=/opt/brew export CFLAGS="-fPIC" export CPPFLAGS="-I${BASE}/include -I${BASE}/include/ncurses" export LDFLAGS="-Wl,-L${BASE}/lib,-R${BASE}/lib" # ソースダウンロード先 comp_dir=/usr/local/src # パッケージ名 pack_name=Python # バージョン version=-2.7.8 # ソースのファイル形式 ext=.tgz # 解凍コマンド tar_cmd="tar zxf" # インストール先ディレクトリ ins_dir=/opt/${pack_name}/${version##-} # ダウンロード元パッケージ dl_uri="https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz" # コンパイル時の並列数 proc_num=`cat /proc/cpuinfo | grep processor | wc -l` cd ${comp_dir} rm -rf ${pack_name}${version} test -f ${pack_name}${version}${ext} \ || wget ${dl_uri} -O ${pack_name}${version}${ext} ${tar_cmd} ${pack_name}${version}${ext} cd ${pack_name}${version} ./configure \ --prefix=${ins_dir} \ && nice -n 15 make -j${proc_num} SSL=${BASE}\ && make install ================ Pathの設定 ================ .. code-block:: bash for type in $(ls -1 ${ins_dir}) do for src in $(find ${ins_dir}/${type} -xtype f) do parent=`dirname ${src#*/${type}/}` filename=`basename ${src}` mkdir -p /opt/brew/$type/$parent echo "ln -fs ${src} ${BASE}/${type}/${parent}/${filename}" ln -fs ${src} ${BASE}/${type}/${parent}/${filename} done done grep -q ${BASE}/bin ~/.bashrc \ || echo "export PATH=${BASE}/bin:${BASE}/sbin:"'${PATH}' >> ~/.bashrc \ ; source ~/.bashrc ======================== 主なconfigureオプション ======================== ``--prefix=[DIR]`` インストール先ディレクトリの指定