Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

migrated from serverfault.com Feb 3 '12 at 21:44

This question came from our site for professional system and network administrators.

1 Answer 1

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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