非正版的AS4无法下载更新包,我们只能自己到ftp://updates.redhat.com/enterprise/4AS/en/os/SRPMS 目录下去下载src.rpm来自己编译。多数包都可以顺利编译通过,但是在我编译过程中有以下几个包花了些功夫
1 thunderbird-1.0.2-1.4.1.src.rpm 直接rpmbuild --rebuild thunderbird-1.0.2-1.4.1.src.rpm可以顺利编译,但是就是无法安装提示
error: unpacking of archive failed on file /usr/lib/thunderbird-1.0.2/defaults/pref/all-redhat.js;42ae6fc9: cpio: MD5 sum mismatch
解决办法:
修改thunderbird.spec文件146-147行:
代码:
%{__cat} %{SOURCE10} | %{__sed} -e 's,THUNDERBIRD_RPM_VR,%{version}-%{release},g' %{__sed} -e 's,COMMAND,%{tbdir}/open-browser.sh,g' > rh-default-prefs
为
代码:
%{__cat} %{SOURCE10} | %{__sed} -e 's,THUNDERBIRD_RPM_VR,%{version}-%{release},g' | %{__sed} -e 's,COMMAND,%{tbdir}/open-browser.sh,g' > rh-default-prefs
然后用rpmbuild -ba thunderbird.spec即可顺利安装
2 comps-4AS-0.20050525.src.rpm 这个文件很麻烦,因为这个文件是redhat发行版的,这个文件记录了发行版的comps文件(也就是我们在软件包管理器里看到的各种分类)以及文件的头信息,而相信大家的机器上不可能有redhat的编译打包目录,所以找不到编译这个包需要.discnfo,hdlist,hdlist2以及comps.xml,我采用了变通的办法,利用系统原来的comps文件来编译新的comps文件,因为我对发行版制作不是很熟悉因此不敢担保这么作以后会不会对system-config-packages有影响,至少我升级后我的系统没发现有什么问题。
解决方法:
cd /usr/share/comps/i386
cp .discinfo ../..
rpm -ivh comps-4AS-0.20050525.src.rpm
rpmbuild --define="basedir /usr/share/comps/i386" --define="compsversion 4AS" -ba comps-redhat.spec
即可成功编译
这个包升级不升级都无所谓,只是我不想看见rh升级提醒那个红灯
3 rpmdb-redhat-4-0.20050525.src.rpm 这个包需要修改specs文件否则也无法编译过去
rpm -ivh rpmdb-redhat-4-0.20050525.src.rpm
vi /usr/src/redhat/SPECS/rpmdb-redhat-rhel4.spec.in 加入
%define rpmdbtree /usr/src/redhat/RPMS
%define rpmdbname redhat
%define rpmdbversion 4
此外还得将:
代码:
cat > ${RPM_BUILD_ROOT}%{_sysconfdir}/rpm/macros.solve <
# The path to the dependency universe database. The default value
# is the rpmdb-redhat location. The macro is usually defined in
# /etc/rpm/macros.solve, installed with the rpmdb-redhat package.
%%_solve_dbpath /usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/redhat
# The path to the dependency universe packages. This should
# be a path to the packages contained in the solve database.
%%_solve_pkgsdir /var/spool/up2date
# The output binary package file name template used when suggesting
# binary packages that solve a dependency. The macro is usually defined
# in /etc/rpm/macros.solve, installed with the rpmdb-redhat package.
#
# XXX Note: escaped %%% for use in headerSprintf()
%%_solve_name_fmt %{?_solve_pkgsdir}%%%{NAME}-%%%{VERSION}-%%%{RELEASE}.%%%{ARCH}.rpm
EOF
改为代码:
cat > ${RPM_BUILD_ROOT}%{_sysconfdir}/rpm/macros.solve < # The path to the dependency universe database. The default value
# is the rpmdb-redhat location. The macro is usually defined in
# /etc/rpm/macros.solve, installed with the rpmdb-redhat package.
%%_solve_dbpath /usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/redhat
# The path to the dependency universe packages. This should
# be a path to the packages contained in the solve database.
%%_solve_pkgsdir /var/spool/up2date
# The output binary package file name template used when suggesting
# binary packages that solve a dependency. The macro is usually defined
# in /etc/rpm/macros.solve, installed with the rpmdb-redhat package.
#
# XXX Note: escaped %%% for use in headerSprintf()
%%_solve_name_fmt %{?_solve_pkgsdir}%%%{NAME}-%%%{VERSION}-%%%{RELEASE}.%%%{ARCH}.rpm
EOF