当前位置: 首页 > 工具软件 > 文泉驿 > 使用案例 >

linux文泉驿字体调用,Ubuntu 上安装文泉驿字体的脚本

向泽语
2023-12-01

Ubuntu 上安装文泉驿字体的脚本

发布时间:2008-02-10 21:04:10来源:红联作者:weiji300200

gedit build_wqy_for_ubuntu.sh

粘贴以下内容,保存.

DEBDIFF="http://archive.ubuntu.com/ubuntu/pool/universe/x/xfonts-wqy/xfonts-wqy_0.7.0-6-1ubuntu1.diff.gz"

NBDLURL="http://wenq.org/daily/"

ROOTDIR=$(dirname $0)

cd $ROOTDIR

echo //

echo // Please run "apt-get build-dep xfonts-wqy" to get

echo // build-depend packages. You also need dpkg-dev and

echo // fakeroot.

echo "Do you have them? (y/n)"

if [[ $1 = "--default" ]]; then

REQ=Y

else

read REQ

fi

case "$REQ" in

"Y" | "y" )

echo Continue...

;;

* )

echo Sorry.

exit 1

;;

esac

echo //

echo // Cleaning last build...

rm -rf ./wqy_temp

mkdir wqy_temp

cd wqy_temp

echo // Getting info from ubuntu.com ...

if wget --quiet $DEBDIFF -O wqy_deb_diff.gz; then

zcat wqy_deb_diff.gz | patch --quiet -p1

rm wqy_deb_diff.gz

else

echo // Found error

exit 1

fi

DEBVER=$(head -1 debian/changelog | sed 's/.*(//g' | sed 's/).*//g')

WQYVER=$(echo $DEBVER | sed 's/-[a-z0-9.]*$//g')

NBVER=$DEBVER.nightly$(date -u +%Y%m%d)

echo // src pkg is ./wqy_temp/xfonts-wqy_$WQYVER.orig.tar.gz

echo // nightly build deb version is $NBVER

echo // Downloading source tarball...

if wget $NBDLURL -O xfonts-wqy_$WQYVER.orig.tar.gz; then

tar zxf xfonts-wqy_$WQYVER.orig.tar.gz

else

echo // Found error

exit 1

fi

echo // Generating new version entry...

mv debian wqy-bitmapfont/

cd wqy-bitmapfont

dch -v $NBVER "New nightly build"

chmod +x debian/rules

echo // Building nightly deb package...

if dpkg-buildpackage -rfakeroot -i -us -uc ; then

echo //

echo // Please run "sudo dpkg -i ./wqy_temp/xfonts-wqy_"$NBVER"_all.deb"

echo // Thanks for testing!

else

echo // Found error

exit 1

fi

exit 0

* . 给脚本增加运行权限

chmod +x build_wqy_for_ubuntu.sh

* . 安装脚本运行环境

sudo apt-get build-dep xfonts-wqy

sudo apt-get install dpkg-dev fakeroot

* . 运行脚本,将生成wqy的deb安装包

./build_wqy_for_ubuntu.sh

* . 安装wqy

sudo dpkg -i ./wqy_temp/*.deb

 类似资料: