史萊姆論壇

史萊姆論壇 (http://forum.slime.com.tw/)
-   網路疑難應用技術研討區 (http://forum.slime.com.tw/f47.html)
-   -   XFce4的編譯安裝指令碼 (http://forum.slime.com.tw/thread116582.html)

psac 2004-07-10 03:23 PM

XFce4的編譯安裝指令碼
 
我的系統是RHEL 3.0 Update1,原來一直使用gnome,發現gnome比較佔用資源,想找一個輕型的桌面系統,以前聽過XFce,不過一直沒有試過,前兩天花了一點時間把XFce 4裝上,發現不錯,於是又用了一點時間寫了一個shell安裝指令碼,算是複習一下shell編程的知識,呵呵

1。這個指令碼需要先下載Xfce4的源碼包,解開源碼包後把這個指令碼放入源碼的目錄裡面(一般是/path/xfce-4.0.5/src/)
2。用chmod a+x把指令碼權限設定成可執行,使用絕對路徑執行該指令碼進行安裝
3。安裝程序需要的一些開發工具和庫文件請事先安裝好。
4。指令碼後面會讓你選項是否配置Xfce4的啟動指令碼,如果你有自己的啟動指令碼,請選項n
5。XFce的安裝目錄預設是/usr/local/xfce,你可以修改指令碼裡面的TARGET_DIR參數。

6。如以fc1版上裝的時候一個一個編譯累死了!
fc2+2.6.7自編譯內核+xfce4 啟動後記憶體消耗才50多mb 爽啊
如是用apt安裝的 5分鐘搞定
歡迎任何意見,謝謝

build_xfce4.rar

=======================================
#!/usr/bin/ksh
#
# Note for "build_xfce4.sh" :
# (1)You can get XFce4 source tarball from:
# wget http://optusnet.dl.sourceforge.net/s....5-src.tar.bz2
#
# (2)Untar the XFce4 tarball, put this script in the source directory, and run it
# from abolute path, such as:
# chmod a+x /XFce4_Source_Dir/build_all.sh
# /XFce4_Source_Dir/build_all.sh
#
# (3)If you want to resume from last built, you can use "-r" option in the command
# line, like this:
# /path/build.sh -r
#
# script version:v0.2
# rls date:2004-06-20
# author:Jacky He
# mailto:joihc@yahoo.com.cn
#

SRC_DIR=${0%/*}
BUILD_DIR=$SRC_DIR/build
LOGS_DIR=$SRC_DIR/logs
# you can change XFce4 install directory by modified TARGET_DIR below
TARGET_DIR=/usr/local/xfce
BUILD_SEQ="dbh gtk-xfce-engine libxfce4util libxfcegui4 libxfce4mcs \
xfce-mcs-manager xfce-mcs-plugins xfce-utils xfce4-panel xfcalendar \
xfce4-iconbox xfce4-mixer xfce4-systray xfce4-themes xfce4-toys \
xfce4-trigger-launcher xfdesktop xffm xffm-icons xfprint xfwm4 xfwm4-themes"
FILE_LST=$SRC_DIR/file_lst
SUMMARY_LOG=$LOGS_DIR/build_summary
export PKG_CONFIG_PATH=$TARGET_DIR/lib/pkgconfig
export PATH=$TARGET_DIR/bin:$PATH
export MAKE_OPTS="-j 2" # MAKE_OPTS can be comment out safely

if [ "${0%%/*}" = "." ];then
echo "Please use absolute path to run the script, like:"
echo " /path1/${0#*/} args"
exit 99
fi

rm -f $FILE_LST
rm -f $SUMMARY_LOG
for i in $BUILD_SEQ;do
ls -l $SRC_DIR |grep $i-[0-9] |awk '{print $9}' \
|sed -e 's/\('"$i"'\)\(-\)\(.*\)\(.tar.gz\)/\1 \3/'>>$FILE_LST
done

if (($(ls -lt $LOGS_DIR |grep -v $SUMMARY_LOG |grep ^- |wc -l)<2));then
rm -fr $BUILD_DIR $LOGS_DIR
mkdir -p $BUILD_DIR $LOGS_DIR
elif [ "$1" = "-r" ];then
FLAG=$(ls -lt $LOGS_DIR |grep -v $SUMMARY_LOG |grep ^- |head -n 2 \
|tail -n 1 |awk '{print $9}' |sed -e 's/\(.*\)\(-\)\(.*$\)/\1/')
sed -e '0,/^'"$FLAG"'/d' $FILE_LST >/tmp/file_lst
mv /tmp/file_lst $FILE_LST
fi

grep "$TARGET_DIR/lib" /etc/ld.so.conf >/dev/null 2>&1
if [ "$?" -ne "0" ];then
echo $TARGET_DIR/lib >>/etc/ld.so.conf
fi

while read PKG_NAME VERSION;do
cd $BUILD_DIR
tar zxvf $SRC_DIR/$PKG_NAME-$VERSION.tar.gz >/dev/null 2>&1
cd $PKG_NAME-$VERSION
echo "Entering $PWD, now building package ${PWD##*/}"
make clear >/dev/null 2>&1
./configure --prefix=$TARGET_DIR >>$LOGS_DIR/${PWD##*/}.build.log 2>&1 \
&& make $MAKE_OPTS >>$LOGS_DIR/${PWD##*/}.build.log 2>&1 \
&& make $MAKE_OPTS install >>$LOGS_DIR/${PWD##*/}.build.log 2>&1;\
if [ "$PKG_NAME" = "xffm" ];then make $MAKE_OPTS install >>$LOGS_DIR/${PWD##*/}.build.log 2>&1 fi

if [ "$?" -eq "0" ];then
echo "===\"${PWD##*/}\" sucessfully built!==="
echo "===\"${PWD##*/}\" sucessfully built!===" >>$SUMMARY_LOG
else
echo "===\"${PWD##*/}\" built fail, check \"$LOGS_DIR/${PWD##*/}.build.log\" for detail!==="
echo "===\"${PWD##*/}\" built fail, check \"$LOGS_DIR/${PWD##*/}.build.log\" for detail!===" >>$SUMMARY_LOG
exit 1
fi

/sbin/ldconfig
rm -f $SRC_DIR/$PKG_NAME-$VERSION.tar.gz
done <$FILE_LST
#cat $SUMMARY_LOG

echo -n "Now setting XFce4 startup environment, do you want to set it? [y/n]--> "
read ans
if [ "$ans" = "[yY]" -o "$ans" = "[yY][eE][eS]" ];then
mkdir -p ~/.XFce4
echo '#!/bin/sh' >~/.XFce4/xinitrc
echo 'xfce-mcs-manager' >>~/.XFce4/xinitrc
echo 'xfwm4 --daemon' >>~/.XFce4/xinitrc
echo 'xftaskbar4 &' >>~/.XFce4/xinitrc
echo 'xfdesktop &' >>~/.XFce4/xinitrc
echo 'xfce4-panel' >>~/.XFce4/xinitrc
chmod a+x ~/.XFce4/xinitrc
echo 'exec $TARGET_DIR/bin/startxfce4' >~/.xinitrc
chmod a+x ~/.xinitrc
echo "\nCongratulations, XFce4 has been finished built and set!"
else
echo "\nCongratulations, XFce4 has been finished built, but you must set the startup environment before using it"
fi

NeoHsu 2004-07-12 12:09 PM

大大你用 ksh 的 shell 丫?現在大都用bash吧,不過在 bash 媕雩茪]沒問題
話說回來,XFce 看起來的感覺還真清爽,改天用Gentoo Linux編編看

http://www.xfce.org/images/screenshots/default.png

mini 2004-07-12 02:10 PM

比較喜歡漂亮的圖形介面
畢竟現在的 PC 主流規格都不低了


所有時間均為台北時間。現在的時間是 09:50 AM

Powered by vBulletin® 版本 3.6.8
版權所有 ©2000 - 2024, Jelsoft Enterprises Ltd.

『服務條款』

* 有問題不知道該怎麼解決嗎?請聯絡本站的系統管理員 *


SEO by vBSEO 3.6.1