How do I get Vim to build in the OBS for Fedora 22 and 23 too?

Hi,

I have a vim package in the OBS that is building fine on openSUSE 13.2, 42.1 and Tumbleweed but failing to build on Fedora. I have fixed the dependency issues I could myself identify (e.g., there was once a Perl issue which I fixed by adding a few dependencies from The Fedora Project spec for Vim). But now I keep getting the error message:


  239s] cp vim /usr/bin
  239s] cp: cannot create regular file '/usr/bin/vim': Permission denied
  239s] Makefile:2093: recipe for target 'installvimbin' failed
  239s] make[1]: *** [installvimbin] Error 1
  239s] make[1]: Leaving directory '/home/abuild/rpmbuild/BUILD/vim-7.4.1320/src'
  239s] Makefile:36: recipe for target 'install' failed
  239s] make: *** [install] Error 2
  239s] error: Bad exit status from /var/tmp/rpm-tmp.PWRtRf (%install)
  239s] 
  239s] 
  239s] RPM build errors:
  239s]     Bad exit status from /var/tmp/rpm-tmp.PWRtRf (%install)
  239s] 
  239s] cloud114 failed "build vim.spec" at Mon Feb 15 05:08:59 UTC 2016.
  239s] 
  239s] ### WATCHDOG MARKER START ###
  240s] Powering off.
  240s]   215.295831] reboot: Power down
  242s] ### WATCHDOG MARKER END ###
  242s] 
  242s] cloud114 failed "build vim.spec" at Mon Feb 15 05:09:02 UTC 2016.
  242s] 

and I haven’t the foggiest why. Here is my spec file: http://paste2.org/sIzCE6hG.

Thanks for your time,
Brenton

On Mon 15 Feb 2016 05:16:01 AM CST, fusion809 wrote:

Hi,

I have a ‘vim package’
(Welcome - openSUSE Build Service) in the OBS
that is building fine on openSUSE 13.2, 42.1 and Tumbleweed but failing
to build on Fedora. I have fixed the dependency issues I could myself
identify (e.g., there was once a Perl issue which I fixed by adding a
few dependencies from ‘The Fedora Project spec for Vim’
(https://apps.fedoraproject.org/packages/vim/sources/spec/)). But now I
keep getting the error message:

Code:

239s] cp vim /usr/bin
239s] cp: cannot create regular file ‘/usr/bin/vim’: Permission
denied 239s] Makefile:2093: recipe for target ‘installvimbin’ failed
239s] make[1]: *** [installvimbin] Error 1
239s] make[1]: Leaving directory
‘/home/abuild/rpmbuild/BUILD/vim-7.4.1320/src’ 239s] Makefile:36:
recipe for target ‘install’ failed 239s] make: *** [install] Error 2
239s] error: Bad exit status from /var/tmp/rpm-tmp.PWRtRf
(%install) 239s]
239s]
239s] RPM build errors:
239s] Bad exit status from /var/tmp/rpm-tmp.PWRtRf (%install)
239s]
239s] cloud114 failed “build vim.spec” at Mon Feb 15 05:08:59 UTC
2016. 239s]
239s] ### WATCHDOG MARKER START ###
240s] Powering off.
240s] 215.295831] reboot: Power down
242s] ### WATCHDOG MARKER END ###
242s]
242s] cloud114 failed “build vim.spec” at Mon Feb 15 05:09:02 UTC
2016. 242s]


and I haven’t the foggiest why. Here is my spec file:
Paste2.org - Viewing Paste sIzCE6hG.

Thanks for your time,
Brenton

Hi
You always need to work in the %{buildroot} If creating symlinks I
always pushd and popd into the relevant directories.


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 SP1|GNOME 3.10.4|3.12.51-60.25-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

Ah, sorry but I’m still confused. I wouldn’t suppose you could show me what sort of changes you think would fix this spec file? Do you mean that these lines:


install -D -m 0755 vim %{buildroot}/bin/vim


# compat symlinks
ln -s -f /bin/vim   %{buildroot}/bin/vi
ln -s -f /bin/vim   %{buildroot}%{_bindir}/vim
ln -s -f /bin/vim   %{buildroot}%{_bindir}/vi
ln -s -f vim        %{buildroot}%{_bindir}/edit
ln -s -f /bin/vim   %{buildroot}/bin/ex


# man pages
ln -s -f vim.1.gz %{buildroot}%{_mandir}/man1/vi.1.gz
ln -s -f vim.1.gz %{buildroot}%{_mandir}/man1/ex.1.gz

should be preceded by:


pushd %{buildroot}

and followed by:


popd

?

Well, it looks like %makeinstall is different on openSUSE and Fedora. Your package fails in Makefile, and apparently make invocation on Fedora lacks information about destination prefix. To quote vim Makefile:

#	If you install Vim, not to install for real but to prepare a package
#	or RPM, set DESTDIR to the root of the tree.

Thanks, so I amended the

%makeinstall STRIP=:

line to

%if 0%{?suse_version}
%makeinstall STRIP=:
%else
%makeinstall STRIP=: DESTDIR=%{buildroot}/usr
%endif

it’s just I am uncertain as to my DESTDIR assignment, should it be %{buildroot}/usr or %{buildroot}?

I pushed this change (including the DESTDIR=%{buildroot}/usr) to the OBS and now it is returning the error:


  181s] make[1]: Leaving directory '/home/abuild/rpmbuild/BUILD/vim-7.4.1320/src'
  181s] + install -d -m 0755 /home/abuild/rpmbuild/BUILDROOT/vim-7.4.1320-30.1.x86_64/usr/share/icons/hicolor/scalable/apps
  181s] + install -d -m 0755 /home/abuild/rpmbuild/BUILDROOT/vim-7.4.1320-30.1.x86_64/usr/share/icons/hicolor/1024x1024/apps/
  181s] + install -m 0644 /home/abuild/rpmbuild/SOURCES/gvim.png /home/abuild/rpmbuild/BUILDROOT/vim-7.4.1320-30.1.x86_64/usr/share/icons/hicolor/1024x1024/apps/gvim.png
  181s] + mv /home/abuild/rpmbuild/BUILDROOT/vim-7.4.1320-30.1.x86_64/usr/bin/vim /home/abuild/rpmbuild/BUILDROOT/vim-7.4.1320-30.1.x86_64/usr/bin/gvim
  181s] mv: cannot stat '/home/abuild/rpmbuild/BUILDROOT/vim-7.4.1320-30.1.x86_64/usr/bin/vim': No such file or directory
  181s] error: Bad exit status from /var/tmp/rpm-tmp.OCIF9b (%install)
  181s] 
  181s] 
  181s] RPM build errors:
  181s]     Macro expanded in comment on line 459: # THIS BREAKS THE BUILD: %{_datadir}/vim/current/tools/missing-vim-client
  181s] 
  181s]     Macro expanded in comment on line 479: #%{_datadir}/vim/%{VIM_SUBDIR}/tools/blink.c
  181s] 
  181s]     Macro expanded in comment on line 481: #%{_datadir}/vim/%{VIM_SUBDIR}/tools/ccfilter.c
  181s] 
  181s]     Macro expanded in comment on line 499: #%{_datadir}/vim/%{VIM_SUBDIR}/tools/xcmdsrv_client.c
  181s] 
  181s]     Bad exit status from /var/tmp/rpm-tmp.OCIF9b (%install)
  181s] 
  181s] lamb17 failed "build vim.spec" at Mon Feb 15 08:51:24 UTC 2016.
  181s] 
  181s] ### WATCHDOG MARKER START ###
  182s] Powering off.
  182s]   167.199806] reboot: Power down
  182s] ### WATCHDOG MARKER END ###
  182s] 
  182s] lamb17 failed "build vim.spec" at Mon Feb 15 08:51:26 UTC 2016.

This should be %{buildroot} - i.e. virtual root of destination filesystem. You could also check what successful build on openSUSE does in this case (for some reason I cannot download full logs via web interface) or simply “rpm --eval %makeinstall” on openSUSE.

@arvidjaar thanks a million! I managed to get the OBS to successfully build the packages for F22 an F23 without issue.