rpmbuild is searching files in %_buildrootdir/“package name” and there is nothing there

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I need to put the kernel headers in a non standard location, and I want to do it automatically with yum, so I downloaded the rpm corresponding to the current headers in the latest version of CentOS, and made the following SPEC file:



%global PKG_NAME linux-headers
%global SRC_NAME kernel-headers

%global RISE_DISTRIBUTED_PATH /opt/distributed_tools

%global SRC_PATH %_sourcedir
%global BUILD_PATH %_builddir
%global INSTALL_PATH %_buildrootdir%DISTRIBUTED_PATH

%global PKG_VER %(uname -r | sed 's/-/./g')

Name: distributed_kernel_headers
Version: %PKG_VER
Release: 1%?dist
Summary: The Linux kernel Headers


License: GPLv2
Group: System Environment/Kernel

URL: http://www.kernel.org/

Source: kernel.rpm

BuildRequires: yum-utils, sed, rpmdev-tools
Provides: distributed_headers

%description
Kernel-headers includes the C header files that specify the interface
between the Linux kernel and userspace libraries and programs. The
header files define structures and constants that are needed for
building most standard programs and are also needed for rebuilding the
glibc package.


%prep
cd %BUILD_PATH
mkdir %PKG_NAME

%build
cd %BUILD_PATH/%PKG_NAME
rpm2cpio %SRC_PATH/%(SRC_NAME)* | cpio -idvm --owner=$(whoami) &> /dev/null

%install
##rm -rf %buildroot
mkdir -pv %INSTALL_PATH/%PKG_NAME"-$(uname -r)"
mkdir -pv %INSTALL_PATH/include/%PKG_NAME/
cp -R %BUILD_PATH/%PKG_NAME/usr/include/* %INSTALL_PATH/%PKG_NAME"-$(uname -r)"
# ln -s %INSTALL_PATH/%PKG_NAME"-$(uname -r)"/* %INSTALL_PATH/include/%PKG_NAME/

%files
%defattr(-,root,root,-)
/opt/

%clean
rm -Rf %BUILD_PATH %_buildrootdir

%changelog


Everything works fine with rpmbuild -ba until the file section, in which the following error appears:



 error: File not found by glob: /home/make_toolchain/rpmbuild/BUILDROOT/distributed_kernel_headers-3.10.0.693.21.1.el7.x86_64-1.el7.centos.x86_64/opt


According to everything that I've read, the file section looks for the files in %_buildrootdir, but in this case this is not happening, and I do not know what is causing this error.



Also there is no special variable set for the rpmbuild enviroment. And every file gets writen to %_builrootdir/opt/distributed_tools/







share|improve this question


























    up vote
    0
    down vote

    favorite












    I need to put the kernel headers in a non standard location, and I want to do it automatically with yum, so I downloaded the rpm corresponding to the current headers in the latest version of CentOS, and made the following SPEC file:



    %global PKG_NAME linux-headers
    %global SRC_NAME kernel-headers

    %global RISE_DISTRIBUTED_PATH /opt/distributed_tools

    %global SRC_PATH %_sourcedir
    %global BUILD_PATH %_builddir
    %global INSTALL_PATH %_buildrootdir%DISTRIBUTED_PATH

    %global PKG_VER %(uname -r | sed 's/-/./g')

    Name: distributed_kernel_headers
    Version: %PKG_VER
    Release: 1%?dist
    Summary: The Linux kernel Headers


    License: GPLv2
    Group: System Environment/Kernel

    URL: http://www.kernel.org/

    Source: kernel.rpm

    BuildRequires: yum-utils, sed, rpmdev-tools
    Provides: distributed_headers

    %description
    Kernel-headers includes the C header files that specify the interface
    between the Linux kernel and userspace libraries and programs. The
    header files define structures and constants that are needed for
    building most standard programs and are also needed for rebuilding the
    glibc package.


    %prep
    cd %BUILD_PATH
    mkdir %PKG_NAME

    %build
    cd %BUILD_PATH/%PKG_NAME
    rpm2cpio %SRC_PATH/%(SRC_NAME)* | cpio -idvm --owner=$(whoami) &> /dev/null

    %install
    ##rm -rf %buildroot
    mkdir -pv %INSTALL_PATH/%PKG_NAME"-$(uname -r)"
    mkdir -pv %INSTALL_PATH/include/%PKG_NAME/
    cp -R %BUILD_PATH/%PKG_NAME/usr/include/* %INSTALL_PATH/%PKG_NAME"-$(uname -r)"
    # ln -s %INSTALL_PATH/%PKG_NAME"-$(uname -r)"/* %INSTALL_PATH/include/%PKG_NAME/

    %files
    %defattr(-,root,root,-)
    /opt/

    %clean
    rm -Rf %BUILD_PATH %_buildrootdir

    %changelog


    Everything works fine with rpmbuild -ba until the file section, in which the following error appears:



     error: File not found by glob: /home/make_toolchain/rpmbuild/BUILDROOT/distributed_kernel_headers-3.10.0.693.21.1.el7.x86_64-1.el7.centos.x86_64/opt


    According to everything that I've read, the file section looks for the files in %_buildrootdir, but in this case this is not happening, and I do not know what is causing this error.



    Also there is no special variable set for the rpmbuild enviroment. And every file gets writen to %_builrootdir/opt/distributed_tools/







    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I need to put the kernel headers in a non standard location, and I want to do it automatically with yum, so I downloaded the rpm corresponding to the current headers in the latest version of CentOS, and made the following SPEC file:



      %global PKG_NAME linux-headers
      %global SRC_NAME kernel-headers

      %global RISE_DISTRIBUTED_PATH /opt/distributed_tools

      %global SRC_PATH %_sourcedir
      %global BUILD_PATH %_builddir
      %global INSTALL_PATH %_buildrootdir%DISTRIBUTED_PATH

      %global PKG_VER %(uname -r | sed 's/-/./g')

      Name: distributed_kernel_headers
      Version: %PKG_VER
      Release: 1%?dist
      Summary: The Linux kernel Headers


      License: GPLv2
      Group: System Environment/Kernel

      URL: http://www.kernel.org/

      Source: kernel.rpm

      BuildRequires: yum-utils, sed, rpmdev-tools
      Provides: distributed_headers

      %description
      Kernel-headers includes the C header files that specify the interface
      between the Linux kernel and userspace libraries and programs. The
      header files define structures and constants that are needed for
      building most standard programs and are also needed for rebuilding the
      glibc package.


      %prep
      cd %BUILD_PATH
      mkdir %PKG_NAME

      %build
      cd %BUILD_PATH/%PKG_NAME
      rpm2cpio %SRC_PATH/%(SRC_NAME)* | cpio -idvm --owner=$(whoami) &> /dev/null

      %install
      ##rm -rf %buildroot
      mkdir -pv %INSTALL_PATH/%PKG_NAME"-$(uname -r)"
      mkdir -pv %INSTALL_PATH/include/%PKG_NAME/
      cp -R %BUILD_PATH/%PKG_NAME/usr/include/* %INSTALL_PATH/%PKG_NAME"-$(uname -r)"
      # ln -s %INSTALL_PATH/%PKG_NAME"-$(uname -r)"/* %INSTALL_PATH/include/%PKG_NAME/

      %files
      %defattr(-,root,root,-)
      /opt/

      %clean
      rm -Rf %BUILD_PATH %_buildrootdir

      %changelog


      Everything works fine with rpmbuild -ba until the file section, in which the following error appears:



       error: File not found by glob: /home/make_toolchain/rpmbuild/BUILDROOT/distributed_kernel_headers-3.10.0.693.21.1.el7.x86_64-1.el7.centos.x86_64/opt


      According to everything that I've read, the file section looks for the files in %_buildrootdir, but in this case this is not happening, and I do not know what is causing this error.



      Also there is no special variable set for the rpmbuild enviroment. And every file gets writen to %_builrootdir/opt/distributed_tools/







      share|improve this question














      I need to put the kernel headers in a non standard location, and I want to do it automatically with yum, so I downloaded the rpm corresponding to the current headers in the latest version of CentOS, and made the following SPEC file:



      %global PKG_NAME linux-headers
      %global SRC_NAME kernel-headers

      %global RISE_DISTRIBUTED_PATH /opt/distributed_tools

      %global SRC_PATH %_sourcedir
      %global BUILD_PATH %_builddir
      %global INSTALL_PATH %_buildrootdir%DISTRIBUTED_PATH

      %global PKG_VER %(uname -r | sed 's/-/./g')

      Name: distributed_kernel_headers
      Version: %PKG_VER
      Release: 1%?dist
      Summary: The Linux kernel Headers


      License: GPLv2
      Group: System Environment/Kernel

      URL: http://www.kernel.org/

      Source: kernel.rpm

      BuildRequires: yum-utils, sed, rpmdev-tools
      Provides: distributed_headers

      %description
      Kernel-headers includes the C header files that specify the interface
      between the Linux kernel and userspace libraries and programs. The
      header files define structures and constants that are needed for
      building most standard programs and are also needed for rebuilding the
      glibc package.


      %prep
      cd %BUILD_PATH
      mkdir %PKG_NAME

      %build
      cd %BUILD_PATH/%PKG_NAME
      rpm2cpio %SRC_PATH/%(SRC_NAME)* | cpio -idvm --owner=$(whoami) &> /dev/null

      %install
      ##rm -rf %buildroot
      mkdir -pv %INSTALL_PATH/%PKG_NAME"-$(uname -r)"
      mkdir -pv %INSTALL_PATH/include/%PKG_NAME/
      cp -R %BUILD_PATH/%PKG_NAME/usr/include/* %INSTALL_PATH/%PKG_NAME"-$(uname -r)"
      # ln -s %INSTALL_PATH/%PKG_NAME"-$(uname -r)"/* %INSTALL_PATH/include/%PKG_NAME/

      %files
      %defattr(-,root,root,-)
      /opt/

      %clean
      rm -Rf %BUILD_PATH %_buildrootdir

      %changelog


      Everything works fine with rpmbuild -ba until the file section, in which the following error appears:



       error: File not found by glob: /home/make_toolchain/rpmbuild/BUILDROOT/distributed_kernel_headers-3.10.0.693.21.1.el7.x86_64-1.el7.centos.x86_64/opt


      According to everything that I've read, the file section looks for the files in %_buildrootdir, but in this case this is not happening, and I do not know what is causing this error.



      Also there is no special variable set for the rpmbuild enviroment. And every file gets writen to %_builrootdir/opt/distributed_tools/









      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 15 at 22:04









      guntbert

      9651817




      9651817










      asked Mar 15 at 21:19









      fmcga

      11




      11

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f430492%2frpmbuild-is-searching-files-in-buildrootdir-package-name-and-there-is-noth%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f430492%2frpmbuild-is-searching-files-in-buildrootdir-package-name-and-there-is-noth%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay