symlink in particular directory using rpm spec

2019-06-25 23:50发布

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

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

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

1条回答
smile是对你的礼貌
2楼-- · 2019-06-26 00:24
%install
mkdir -p %{buildroot}/%{_sharedstatedir}/directory1
ln -s directory1 %{buildroot}/%{_sharedstatedir}/directory2

%files
%{_sharedstatedir}/directory1
%{_sharedstatedir}/directory2
查看更多
登录 后发表回答