5

In the package that I'm building, there are symbolic links within the Buildroot directory. For instance this:

 /home/sg/impkg/buildroot/dir1/bin/w_be -> /home/sg/impkg/buildroot/dir2/targ/be

This is making rpmbuild to fail with the error:

 RPM build errors:
 Symlink points to BuildRoot: 
 /home/sg/impkg/buildroot/dir1/bin/w_be -> /home/sg/impkg/buildroot/dir2/targ/be

In my %files section, I have only included the buildroot directory, which is what I want. Following is a snippet from my spec-file:

Summary:                research compiler tool set
License:                GPL
Name:                   %{name}
Version:                %{version}
Release:                %{release}
Source:                 %{name}-%{version}.tar.gz
Prefix:                 /usr
Group:                  Development/Tools
Autoreq:                0
Autoprov:               0

%description
research compiler tool set

%prep
%setup -q

%build
rm -rf %{buildroot}/%{name}-%{version}
mkdir %{buildroot}/%{name}-%{version}
cd %{buildroot}/%{name}-%{version} && %{_builddir}/%{name}-%{version}/./configure --     prefix=%{buildroot}/%{name}-%{version}
make %{?_smp_mflags} -C %{buildroot}/%{name}-%{version}

%install
cd %{buildroot}/%{name}-%{version} && make DESTDIR=%{buildroot}/%{name}-%{version}  install

%clean
rm -rf %{buildroot}/%{name}-%{version}

%files
%defattr(755,-,-)
/%{name}-%{version}

I have to adhere to the logic, which means I cannot remove these links from the Makefiles...how do I solve this problem and generate the RPM?

3

Symlinks must be relative so that the package will work when installed. Patch the makefile to fix this.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.