|
xfce-4.2.3.2出了好一段时间了,等了好久,slackware-current都没更新,所以就自己用slackware官方Xfce 4.2.2的xfce.SlackBuild 修改了下,自己编译了xfce-4.2.3.2。
先去下载xfce-4.2.3.2的源码,并保存到/tmp里:
然后把解压xfce-4.2.3.2-src.tar.bz2:
/tmp#tar jxf xfce-4.2.3.2-src.tar.bz2
/tmp#cd xfce-4.2.3.2;ls
src
/tmp/xfce-4.2.3.2#cd src;ls
dbh-1.0.24.tar.gz xfce4-session-4.2.3.tar.gz
gtk-xfce-engine-2.2.8.tar.gz xfce4-systray-4.2.3.tar.gz
libxfce4mcs-4.2.3.tar.gz xfce4-toys-4.2.3.tar.gz
libxfce4util-4.2.3.2.tar.gz xfce4-trigger-launcher-4.2.3.tar.gz
libxfcegui4-4.2.3.tar.gz xfce-mcs-manager-4.2.3.tar.gz
xfcalendar-4.2.3.tar.gz xfce-mcs-plugins-4.2.3.tar.gz
xfce-4.2.3.2.md5 xfce-utils-4.2.3.tar.gz
xfce4-appfinder-4.2.3.tar.gz xfdesktop-4.2.3.tar.gz
xfce4-iconbox-4.2.3.tar.gz xffm-4.2.3.tar.gz
xfce4-icon-theme-4.2.3.tar.gz xfprint-4.2.3.tar.gz
xfce4-mixer-4.2.3.tar.gz xfwm4-4.2.3.2.tar.gz
xfce4-panel-4.2.3.tar.gz xfwm4-themes-4.2.3.tar.gz
再看看官方的xfce.SlackBuild,发现官方是用tar.bz2打包文件的。
于是用下面的脚本先把tar.gz都转换成tar.bz2的压缩方式(还有种方法是直接修改xfce.SlackBuild成解压tar.gz的模式,不过我喜欢这样多些):
#!/bin/sh
VERSION=4.2.3
for file in \
dbh-1.0.24.tar.gz \
libxfce4util-$VERSION.2.tar.gz \
libxfcegui4-$VERSION.tar.gz \
libxfce4mcs-$VERSION.tar.gz \
xfce-mcs-manager-$VERSION.tar.gz \
xfce4-panel-$VERSION.tar.gz \
gtk-xfce-engine-2.2.8.tar.gz \
xfce-mcs-plugins-$VERSION.tar.gz \
xfce-utils-$VERSION.tar.gz \
xfce4-appfinder-$VERSION.tar.gz \
xfce4-iconbox-$VERSION.tar.gz \
xfce4-icon-theme-$VERSION.tar.gz \
xfce4-mixer-$VERSION.tar.gz \
xfce4-systray-$VERSION.tar.gz \
xfce4-session-$VERSION.tar.gz \
xfce4-toys-$VERSION.tar.gz \
xfce4-trigger-launcher-$VERSION.tar.gz \
xfdesktop-$VERSION.tar.gz \
xffm-$VERSION.tar.gz \
xfprint-$VERSION.tar.gz \
xfwm4-$VERSION.2.tar.gz \
xfwm4-themes-$VERSION.tar.gz \
xfcalendar-$VERSION.tar.gz \
; do
( tar zxf src/$file
tar jcf `basename $file .tar.gz`.tar.bz2 `basename $file .tar.gz`
rm `basename $file .tar.gz` -rf
)
done
把这个脚本命名为xfce.gz_2_bz2放到xfce-4.2.3.2目录下(注意,不是src目录!)。然后执行:
#./xfce.gz_2_bz2
等2,3分钟后可以看到xfce-4.2.3.2目录下已经是用tar.bz2重新打包好的xfce源码包了。
然后就是用xfce.SlackBuild编译源码包了,将xfce.SlackBuild一样复制到xfce-4.2.3.2目录下:
#cp xfce.SlackBuild /tmp/xfce-4.2.3.2
然后当然要修改下xfce.SlackBuild才行,把VERSION,PKGVER等改了,另外我的编译参数也改成这样:
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-march=pentium-m -O3 -pipe -fomit-frame-pointer"
另外xfce.SlackBuild里面有这么一段:
# Strengthen resistance to /tmp attacks (low risk, but might as well...).
if [ "$file" = "xfce-utils-$VERSION.tar.bz2" ]; then
zcat $CWD/xfce-utils-xinitrc.diff.gz | patch -p1 --verbose
fi
是给xfce-utils打补丁的,觉得应该不用了。所以注释掉吧。
完整修改过的xfce.SlackBuild如下(编译参数请自己再修改下吧,直接用也可以):
#!/bin/sh
# Copyright 2003 Slackware Linux, Inc., Concord, CA, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
TMP=/tmp/xfce-build-dir
rm -rf $TMP
mkdir -p $TMP
PKG=$TMP/package-xfce
rm -rf $PKG
mkdir -p $PKG
CWD=`pwd`
VERSION=4.2.3
PKGVER=4.2.3
ARCH=${ARCH:-i686}
BUILD=1
if [ "$ARCH" = "i386" ]; then
SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O3 -pipe -fomit-frame-pointer"
elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2"
fi
for file in \
dbh-1.0.24.tar.bz2 \
libxfce4util-$VERSION.2.tar.bz2 \
libxfcegui4-$VERSION.tar.bz2 \
libxfce4mcs-$VERSION.tar.bz2 \
xfce-mcs-manager-$VERSION.tar.bz2 \
xfce4-panel-$VERSION.tar.bz2 \
gtk-xfce-engine-2.2.8.tar.bz2 \
xfce-mcs-plugins-$VERSION.tar.bz2 \
xfce-utils-$VERSION.tar.bz2 \
xfce4-appfinder-$VERSION.tar.bz2 \
xfce4-iconbox-$VERSION.tar.bz2 \
xfce4-icon-theme-$VERSION.tar.bz2 \
xfce4-mixer-$VERSION.tar.bz2 \
xfce4-systray-$VERSION.tar.bz2 \
xfce4-session-$VERSION.tar.bz2 \
xfce4-toys-$VERSION.tar.bz2 \
xfce4-trigger-launcher-$VERSION.tar.bz2 \
xfdesktop-$VERSION.tar.bz2 \
xffm-$VERSION.tar.bz2 \
xfprint-$VERSION.tar.bz2 \
xfwm4-$VERSION.2.tar.bz2 \
xfwm4-themes-$VERSION.tar.bz2 \
xfcalendar-$VERSION.tar.bz2 \
; do
( cd $TMP
tar xjf $CWD/$file
cd `basename $file .tar.bz2`
# Strengthen resistance to /tmp attacks (low risk, but might as well...).
#if [ "$file" = "xfce-utils-$VERSION.tar.bz2" ]; then
# zcat $CWD/xfce-utils-xinitrc.diff.gz | patch -p1 --verbose
#fi
chown -R root.root .
find . -perm 777 -exec chmod 755 {} \;
find . -perm 775 -exec chmod 755 {} \;
find . -perm 666 -exec chmod 644 {} \;
find . -perm 664 -exec chmod 644 {} \;
# From the COMPOSITOR file in xfwm4:
#
# xfwm4 now features a compositing manager. This code is new and has received only
# a moderate amount of testing, so it's disabled by default.
#
# So, if you want to stay safe, keep the compositor disabled...
#
# If you still want to try the compositor extensions with xfwm4, here follows how
# to enable the compositing manager in xfwm4.
#
# 1) Enabling the compositor manager in xfwm4
# -------------------------------------------
#
# To enable the compositing manager in xfwm4, add --enable-compositor when running
# the configure script.
#
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure --prefix=/usr \
--sysconfdir=/etc/X11 \
--enable-static=no \
--enable-xinerama
make -j6
make install
make install DESTDIR=$PKG
mkdir -p $PKG/usr/doc/`basename $file .tar.bz2`
cp -a \
AUTHORS COPYING INSTALL NEWS README TODO \
$PKG/usr/doc/`basename $file .tar.bz2`
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
for mandir in `find . -name man -type d` ; do
if [ -d $mandir ]; then
( cd $mandir
find . -type f -name "*.?" -exec gzip -9 {} \;
)
fi
done
)
)
done
( cd $PKG/usr/bin
ln -sf xffm xffstab4
ln -sf xffm xfapps
ln -sf xffm xfbook
ln -sf xffm xfsamba4
ln -sf xffm xftrash4
ln -sf xffm xfapps4
ln -sf xffm xfbook4
ln -sf xffm xffstab
ln -sf xffm xfglob4
ln -sf xffm xftree4
)
chown -R root.bin $PKG/usr/bin
( mkdir -p $PKG/etc/X11/xinit
cd $PKG/etc/X11/xinit
ln -sf ../xdg/xfce4/xinitrc xinitrc.xfce
chmod 755 ../xdg/xfce4/xinitrc
)
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
makepkg -l y -c n $TMP/xfce-$PKGVER-$ARCH-$BUILD.tgz
ok,执行编译:
#./xfce.SlackBuild
先在我已经用上xfce-4.2.3.2了,不过没有发现什么大改动哈哈~ |
|