Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

symlink in particular directory using rpm spec

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?

like image 921
Kevin Parker Avatar asked Aug 18 '15 08:08

Kevin Parker


1 Answers

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

%files
%{_sharedstatedir}/directory1
%{_sharedstatedir}/directory2
like image 195
msuchy Avatar answered Oct 21 '22 15:10

msuchy