sashang
sashang

Reputation: 12234

symlinks are not included in BUILDROOT when using rpmbuild

I'm using rpmbuild to build a set of rpms from source code that uses autotools. As part of the make install procedure symlinks are generated in the rpms/BUILD directory, however those symlinks are not copied into the BUILDROOT directory. As a result I get error: file not found messages from the rpmbuild process. My spec file includes the symlinks in the %files section, therefore rpmbuild expects the files to be there. For some reasons the rpmbuild process is not copying over the symlinks from the BUILD to the BUILDROOT directory. How do I fix this?

Upvotes: 0

Views: 1878

Answers (1)

Edwin Buck
Edwin Buck

Reputation: 70949

When you copy a symlink, typically the simlink itself isn't copied because it is a link. The "contents" of the symlink is copied, which is the file.

To fix this, use the %install section to create the desired symlinks in the %{buildroot} directory

ln -sf target %{buildroot}/link

and then package the link normally within the %files directive

%files
/link

Upvotes: 0

Related Questions