2011-09-22 90 views

回答

18

当然,它支持符号链接。但是你实际上必须打包符号链接而不是将内容复制到buildroot。例如规格包装一个符号链接到/ bin目录名为/ newbin

Name:   test 
Version:  1.0 
Release:  1%{?dist} 
Summary:  nothing 
License:  GPLv2 
Source0:  nothing 

%description 

%install 
rm -rf %{buildroot} 
mkdir %{buildroot} 
ln -sf /bin %{buildroot}/newbin 

%files 
/newbin 

您还需要nothing文件在你的源代码目录中成功地建立转出这一点。用rpm测试4.9.1.2

+0

我会对上面Stan所说的做一个改动,因为-f在创建链接中,所以不需要删除。 – Jane

+0

@Jane - 我不同意。清理buildroot以删除'%install'开头处的垃圾通常是一个好主意。例如,假设软件包的以前版本安装了第二个文件“'{buildroot}/newlib”,但当前版本不安装该文件。当前版本的软件包不会知道该文件,因此它不会从buildroot中删除(按照您的建议)。一般来说,当前的rpmbuild实例并不知道可能存在于构建根目录中的任何旧版本。更好的做法是在安装步骤之前核实整个buildroot。 – jayhendren

-1

我不这么认为。我已经使用安装后脚本在我的包中设置了符号链接。