有没有可能让rpmbuild保留打包上的符号链接?
当前的行为是创建文件的副本,这是我想要避免的。
发布于 2012-04-25 05:42:22
当然,它支持符号链接。但实际上您必须打包symlink,而不是将内容复制到buildroot。将指向名为/newbin的/bin目录的符号链接打包的示例规范
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您还需要在SOURCES目录中使用nothing文件才能成功构建rpm。使用rpm 4.9.1.2测试
发布于 2021-09-03 16:39:10
我知道这个Q很老,但我是这么做的。
在%install部分中,只需触摸将作为符号链接的文件。
touch %{buildroot}[path to your file]在%files部分中,将其指定为%ghost文件:
%ghost [path to symlink file]这样做,它将作为软件包文件的一部分列出,并在卸载软件包时自动删除。
最后,在%post部分中创建符号链接:
ln -sf [file to link to] [symlink]发布于 2011-09-27 05:50:53
我不这样认为。我已经使用安装后脚本在我的包中设置了符号链接。
https://stackoverflow.com/questions/7521980
复制相似问题