使用 rpm 规范在特定目录中的符号链接 [英] symlink in particular directory using rpm spec

查看:71
本文介绍了使用 rpm 规范在特定目录中的符号链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用spec文件创建的rpm将创建目录directory1"和/var/lib/directory1中的所有文件.

rpm created using spec file will create directory "directory1" and all files in /var/lib/directory1.

对于另一个用例,我想在/var/lib"中创建另一个目录,它应该是指向目录 1 的符号链接.

For another use case i want to create another directory in "/var/lib" which should be a symlink to directory1.

eg: 
cd /var/lib/
ls -la
directory2 -> directory1 
directory1

如何在不使用 spec 文件中的绝对路径的情况下实现这一点?

how is it possible to do achieve this without using absolute paths in spec file?

推荐答案

%install
mkdir -p %{buildroot}/%{_sharedstatedir}/directory1
ln -s directory1 %{buildroot}/%{_sharedstatedir}/directory2

%files
%{_sharedstatedir}/directory1
%{_sharedstatedir}/directory2

这篇关于使用 rpm 规范在特定目录中的符号链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆