• VMware

    Learn about VMware virtualization for its products like vsphere ESX and ESXi, vCenter Server, VMware View, VMware P2V and many more

  • Linux

    Step by step configuration tutorials for many of the Linux services like DNS, DHCP, FTP, Samba4 etc including many tips and tricks in Red Hat Linux.

  • Database

    Learn installation and configuration of databases like Oracle, My SQL, Postgresql, etc including many other related tutorials in Linux.

  • How to change rpmbuild (_tmppath) in a spec file (rpmbuild ignored directory) Linux

    Below article explains in detail

    Step by Step Guide to build an rpm from scratch by building a source archive using Red Hat Linux
    By default when we attempt to build an rpm, the rpmbuild command will look for the below directories under /root/ or the user home folder
    drwxr-xr-x 4 root root  46 May 13 00:55 BUILD
    drwxr-xr-x 2 root root   6 May 13 00:55 BUILDROOT
    drwxr-xr-x 3 root root  20 May 12 21:07 RPMS
    drwxr-xr-x 3 root root  84 May 13 00:32 SOURCES
    drwxr-xr-x 2 root root  25 May 13 01:36 SPECS
    drwxr-xr-x 2 root root 100 May 13 00:55 SRPMS

    But if you have created these under some other path then rpmbuild will most likely fail with below error message
    # rpmbuild -ba deepak.spec
    error: File /root/rpmbuild/SOURCES/deepak-1.0.0-1.tar.gz: No such file or directory

    which mean rpmbuild is looking at the wrong place for the source file






    Solution:

    To change the location of the sourcepath modify or create a new rpmmacros in the user home folder as shown below

    Here I have changed my rpmbuild path
    # vim /root/.rpmmacros
    %_topdir /tmp/rpmbuild
    %_tmppath %{_topdir}/tmp

    Save and exit and re-attempt to build the rpm

    I hope the article was useful.

    Deepak Prasad

    is a techie and an author who is still trying to survive in this IT generation with very little knowledge he has on Linux/Unix, VMware, SAN Storage, Automation, networking etc

    You can follow him on Facebook or Google+


    Do you also have something to share here?
    Join GoLinuxHub Team as an Author, Click here for more information
    How to change rpmbuild (_tmppath) in a spec file (rpmbuild ignored directory) Linux How to change rpmbuild (_tmppath) in a spec file (rpmbuild ignored directory) Linux Reviewed by Deepak Prasad on Sunday, May 13, 2018 Rating: 5

    No comments:

    Powered by Blogger.