1

I am practicing in rpmbuild and I run the example Hello RPM package the example run well, however, I build my own gnuplot.spec with this:

Files:

SOURCES/
gnuplot-5.0.5.tar.gz

SPECS/
gnuplot.spec

Spec file:

Name:           gnuplot
Version:        5.0.5
Release:        1%{?dist}
Summary:        The gnuplot 

License:        GPLv3+
Source0:        gnuplot-5.0.5.tar.gz

BuildRequires: gettext
      
Requires(post): info
Requires(preun): info

%description 
gnuplot

%prep
%autosetup

%build
%configure
make 

%install
%make_install

%doc AUTHORS ChangeLog NEWS README THANKS TODO
%license COPYING

%changelog
* Tue Sep 06 2011 The Coon of Ty <Ty@coon.org> 2.8-1
- Initial version of the package

I run the next command:

rpmbuild -ba gnuplot.spec

Error:  /var/tmp/rpm-tmp.oAdSqX (%install)
hlovdal
  • 26,565
  • 10
  • 94
  • 165

1 Answers1

0

The error seems to indicate problems inside the install section, and the macro used there is %make_install. I would assume that this macro is not present on your system.

In my Fedora 32 machine, running

rpm -qa | grep ^rpm | sort | xargs rpm -ql | xargs grep -l make_install | sort -u

and looking into the files listed shows that it is defined in /usr/lib/rpm/macros and two of the other files gives hints like

if [[ $rpmver -ge 40800 ]] ; then # >= 4.8 (RHEL >= 6, Fedora >= 13)

and

- Use %make_install for rpm >= 4.8 in -newspec (#828455).

so that indicates that you need at least version 4.8 of rpm. However version is not necessarily everything, there are many macros that are defined in extra packages (like fedora-rpm-macros, cmake-rpm-macros, python-rpm-macros, etc).

The /usr/lib/rpm/macros file belongs to the rpm package though, although sometimes it depends on other packages to work correctly.

So check if you are using rpm version 4.8 or above and verify that your /usr/lib/rpm/macros file contains a make_install macro.

hlovdal
  • 26,565
  • 10
  • 94
  • 165