Find the answer to your Linux question:
Results 1 to 4 of 4
I am trying to build the rpm package for the first time and I am not completely clear with the spec file, the way it works and have couple of ...
  1. #1
    Just Joined!
    Join Date
    Sep 2011
    Posts
    2

    Questions regarding building Rpm package.

    I am trying to build the rpm package for the first time and I am not completely clear with the spec file, the way it works and have couple of questions.

    1. What do I need to put in the install section of the spec file?Can anyone explain me the use of it please.

    2. Do we need a "make install" always? The way I install is run "./configure" and "make". This installs it for the current user. But now when I am making a rpm for this, Do I need to have an "make install" in my spec file or this will work?

    3. By default if I am not including any of the files in %file sections, what all files are copied in my rpm package?

    4. When we run the "rpm -i package_name.rpm" command what exactly happens. I mean does it look into the %install section of the spec file or somewhere else and as I am just using the make command not the make install, where does it install and copy my files?

    Thanks,
    Nitin

  2. #2
    Just Joined!
    Join Date
    Sep 2011
    Posts
    52
    Check this out:
    Creating the Spec File

    I hope it answers all your questions

  3. #3
    Linux Guru
    Join Date
    May 2011
    Posts
    1,843
    This was confusing to me at first, too, and I used the link posted by zackwasa a lot. But in a nutshell:

    The %install section is literally where you copy your files (or make dirs or symlinks or whatever you want to do) to the target system. But it is key to remember two things:

    a) know where your source location is - it is relative to wherever you unpackaged the files in the %prep section

    b) the destination is relative to your buildroot - ie., don't copy files to /usr/bin, copy them to %{buildroot}/usr/bin (and you have to make that %{buildroot}/usr/bin dir first, if it does not exist)

    You don't need to use 'make install' and I never do, b/c I prefer to have control over where the files are getting installed.

    No files will be included if you don't include any in %files section. Whatever is copied in the %install section must be covered in the %files section, or rpmbuild will barf.

    I think your fourth question is answered by the 1st three answers.

  4. #4
    Just Joined!
    Join Date
    Sep 2011
    Posts
    2
    Thanks.... This helped me a lot... I figured it out....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...