|
很多人都说LFS没有包管理是一个弊病,其实,这些弊病只要Linuxsir论坛就可以解决:
1.LFS的软件包均为散兵游勇:解决方法为建立民间{,C}{,B}LFS服务器。
2.无成型包管理:可以下列方法制作:
制作一个简单的shell或ncurses外壳,并将tar.bz2软件包中加入以下脚本:
chkdep 检查依赖
mkprogram 编译
mkinstall 安装
mkuninstall 反安装
这样一来,就可以同时使用预编译包与非预编译包
另:本人建议将包装入/usr/local代替/usr或/usr/X11R6
下面是脚本举例:
Firefox3 zh_CN 预编译:
#! /bin/bash
# this file is 'chkdep'
rm -rfp .chkdep > /dev/null 2>&1
mkdir -p .chkdep > /dev/null 2>&1
if [ -d '../alsa' ]
then
touch .chkdep/alsa
else
exit 1
fi
if [ -d '../gtk2' ]
then
touch .chkdep/gtk2
else
exit 1
fi
if [ -d '../dbus-glib' ]
then
touch .chkdep/dbus-glib
else
exit 1
fi
#! /bin/bash
# this file is 'mkprogram'
tar xf main.tar.bz2
#! /bin/bash
# this file is 'mkinstall'
cp -R maindir /opt/firefox
rm -rf maindir
#! /bin/bash
# this file is 'mkuninstall'
rm -rf /opt/firefox
Gtk2 Librarys 自编译
#! /bin/bash
# this file is 'chkdep'
rm -rfp .chkdep > /dev/null 2>&1
mkdir -p .chkdep > /dev/null 2>&1
if [ -d '../pango' ]
then
touch .chkdep/pango
else
exit 1
fi
if [ -d '../atk' ]
then
touch .chkdep/atk
else
exit 1
fi
if [ -e '../pango/.chkdep/cairo' ]
then
touch .chkdep/pangocairo
else
exit 1
fi
if [ -d '../tiff' ]
then
touch .chkdep/tiff
fi
if [ -d '../jpeg' ]
then
touch .chkdep/jpeg
fi
#! /bin/bash
# this file is 'mkprogram'
printf ’./configure --prefix=/usr/local ‘ > config
if [ -e '.chkdep/tiff' ]
then
echo "" > /dev/null
else
printf ’ --without-libtiff‘ > config
fi
if [ -e '.chkdep/jpeg' ]
then
echo "" > /dev/null
else
printf ’ --without-libjpeg‘ > config
fi
echo "" >> config
echo 'exit $?' >> config
if bash config
then
if make
then
echo "" > /dev/null
else
exit 1
fi
else
exit 1
fi
#! /bin/bash
# this file is 'mkinstall'
make install &&
install -v -m755 -d /usr/share/doc/gtk+-2.10.13/{faq,tutorial} &&
cp -v -R docs/faq/html/* /usr/share/doc/gtk+-2.10.13/faq &&
cp -v -R docs/tutorial/html/* /usr/share/doc/gtk+-2.10.13/tutorial &&
install -v -m644 docs/*.txt /usr/share/doc/gtk+-2.10.13
make clean
#! /bin/bash
# this file is 'mkuninstall'
make uninstall
当然,在实际使用中,他们应在一个源码树下的隐藏目录里(比如.lpkg)
这就是我的设想,概括:
1.安装后保留文件夹以检查依赖
2.检查依赖、编译、安装脚本分离,同时设卸载脚本 |
|