当前位置:操作系统 > Unix/Linux >>

redhatas4几个原代码包的编译

非正版的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

  

上一个:基于Linux的集群系统环境构建过程
下一个:如何手动设置修改X-Window的显示模式

更多Unix/Linux疑问解答:
路由原理介绍
子网掩码快速算法
改变网络接口的速度和协商方式的工具miitool和ethtool
Loopback口的作用汇总
OSPF的童话
增强的ACL修改功能
三层交换机和路由器的比较
用三层交换机组建校园网
4到7层交换识别内容
SPARC中如何安装Linux系统(2)
SPARC中如何安装Linux系统(1)
用Swatch做Linux日志分析
实战多种Linux操作系统共存
浅析Linux系统帐户的管理和审计
Linux2.6对新型CPU的支持(2)
电脑通通透
玩转网络
IE/注册表
DOS/Win9x
Windows Xp
Windows 2000
Windows 2003
Windows Vista
Windows 2008
Windows7
Unix/Linux
苹果机Mac OS
windows8
安卓/Android
Windows10
如果你遇到操作系统难题:
访问www.zzzyk.com 试试
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,