Brett
Brett

Reputation: 386

Rpmbuild can't find file. Is missing folder in path

Hi im trying to create my own rpm with rpmbuild. I have gone throught the basics no problem, But now im trying to make my own vim rpm, everything seem to go fine until the end when i get this output

+ '[' '%{buildarch}' = noarch ']'
+ QA_CHECK_RPATHS=1
+ case "${QA_CHECK_RPATHS:-}" in
+ /usr/lib/rpm/check-rpaths
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: vim-7.4-1.el7.x86_64
error: File not found: /home/me/rpmbuild/BUILDROOT/vim-7.4-1.el7.x86_64/usr/bin/vim


RPM build errors:
    File not found: /home/me/rpmbuild/BUILDROOT/vim-7.4-1.el7.x86_64/usr/bin/vim

Here also is my spec file

Name:       vim
Version:    7.4
Release:    1%{?dist}
Summary:    A text editor


License:    GPLv3+
URL:        https://blog.packagecloude.io
Source0:    vim.tar.gz


%description
A wicked text editor

%prep
%setup

%build
make PREFIX=/usr/local %{?_smp_mflags}

%install
make PREFIX=/usr/local DESTDIR=%{?buildroot} install

%clean
rm -rf %{buildroot}

%files
%{_bindir}/vim

I think im missing something simple. This is the path i have

RPM build errors:
    File not found: /home/me/rpmbuild/BUILDROOT/vim-7.4-1.el7.x86_64/usr/bin/vim

How can i change it to /home/me/rpmbuild/BUILDROOT/vim-7.4-1.el7.x86_64/usr/local/bin/vim .

Upvotes: 0

Views: 1426

Answers (1)

Chris Maes
Chris Maes

Reputation: 37792

Probably if you analyze the output correctly you would see lines like:

installing vim to /home/me/rpmbuild/BUILDROOT/vim-7.4-1.el7.x86_64/usr/local/bin/vim

(note that he is installing to /usr/local/bin since you specified that.

however the macro %_bindir that you are using in the %files section expands to /usr/bin. So you have two options:

  1. don't install under /usr/local; remove the PREFIX=/usr/local directives
  2. keep installing in /usr/local; then you need to adapt your %files section

like this:

%files
/usr/local/bin/vim

Upvotes: 1

Related Questions