Вопрос

I have a question about the RPM spec file.

  1. what is the point of view of execution of the spec file? Is the spec file meant controls what happens when rpmbuild is executed on the source machine, or what happens when the RPM is installed on the target machine?
  2. If my idea is just to take the folders and files in the tar.gz, put them in a RPM and them at at the RPM install point have those folders and files deployed. What do I do in the %build and %install sections?
  3. How do I reference the files I want to ultimately be deployed on the target machine in the %files section? Do I reference them as the are on the source machine or on the target machine.

I'm sorry of these questions seem vague or amateurish but I really have issues with the concept and the various site I referenced all use make install

Это было полезно?

Решение

  1. Both (If I understand your question correctly). In the %prep, %build %install you control what is running on the build server. In the %pre,post,preun,postun you control what is running on the target server during RPM un/install.
  2. If you don't build anything, the %build can be empty. Do you want to pack tar files in the RPM and untar them in the target server? This is not a good approach. It is better to pack the files in the tar and let RPM handle changes, etc.
  3. As they will be on the target machine.

Другие советы

ad 2.: In one of the stages, you unpack your tar into the %buildroot, and the others remain empty. The tasks for the stages are more or less deliberate: in %prep, you normally unpack your source, in %build you build the binaries and in %install you put the binaries into your build root. As you have no build process here, you can leave this empty.

Now it gets philosophical: is unpacking your tar into the destination folder %prep "unpacking" or "installing"? I think it is both, so you can choose either one.

The pure theory would be to unpack the source onto your working space in %prep and to copy the files over in %install, but that seems academical and unnecessary to me.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top