六月 11
首先參考這裡, 去抓SID 的source code.
我抓的檔是:sid-20100601.tar.bz2
在Linux 中, 建立一個目錄src, 並將SID 的source code放到這個目錄.
然後將下面的code 存成build_sid.sh, 並且和SID 的source code 放在一起.
#!/bin/bash
INSTALL_PATH=~/bin/sid
SID_TAR_BALL=sid-20100601.tar.bz2
#
# Variables
#
BUILD_DIR=build
SRC_DIR=sid_src
#
# Remove old install-directory then create new
#
if [ -d ${INSTALL_PATH} ]; then
rm -rf ${INSTALL_PATH}/*
else
mkdir -p ${INSTALL_PATH}
fi
#
# Create source directory
#
if [ -d ${SRC_DIR} ]; then
rm -rf ${SRC_DIR}/*
else
mkdir -p ${SRC_DIR}
fi
#
# Decompress the sid source code
#
if [ -f ${SID_TAR_BALL} ]; then
(cd ${SRC_DIR}; tar -jxvf ../${SID_TAR_BALL})
else
echo "Error!! can't find ${SID_TAR_BALL}"
exit
fi
#
# Create build directory
#
if [ -d ${BUILD_DIR} ]; then
rm -rf ${BUILD_DIR}/*
exit
else
mkdir -p ${BUILD_DIR}
fi
#
# Build SID
#
cd ${BUILD_DIR}
../${SRC_DIR}/src/configure --prefix=${INSTALL_PATH} --exec-prefix=${INSTALL_PATH}
make
#
# Install SID
#
make install
echo "Install SID finished!!"
切換到src的目錄.
執行如下的指令
#chmod +x build_sid.sh
#./build_sid.sh
然後將PATH環境變數設到~/bin/sid即可.