1

I am a newbie in generating a rpm package. I am trying to create a rpm file which require so many modules such as php, mysql, Apache, etc.

I have tried a lot but as I found that there is .spec file, makefile, configure file to build rpm. In my case, there is no such file as I just want to install some third party package all in one rpm file.

I am really stuck and don't getting a proper way to do this stuff. Please help me I am very thankful to you.

I have visited some links, https://access.redhat.com/sites/default/files/attachments/rpm_building_howto.pdf

http://www.logiqwest.com/TechnicalPapers/rpmScriptInstall.html

http://www.linuxquestions.org/questions/linux-general-1/creating-an-rpm-without-source-734490/

No one providing a better solution to fulfill my motto.

In simple, I just want to integrate all my steps in rpm package which can be install using script.

Please suggest a proper way or let me know Is it possible or not?

2
  • I am very grateful if anybody gives a hint for this.. Jan 4, 2016 at 4:39
  • Update your question that you want yum install package_name. yum requires a repository that need to be setup.
    – dlmeetei
    Sep 7, 2017 at 5:47

2 Answers 2

0

You would tar up your source to be the main Source and have your RPM Require the various servers you need. In the %install stanza, you would copy all your files to the staging area equivalent of your destination.

3
  • I want to just install specific packages and some third party tar.gz files. There is no specific source code. I want this rpm to install some package using "yum install packagename" and can install third party source from their tar.gz which has all make, config, install files. I want to make this all in one rpm. Is it possible? Dec 23, 2015 at 12:44
  • Hi brother!! it's admired if you can suggest something in my specification. Dec 26, 2015 at 3:35
  • When you say ' I want this rpm to install some package using "yum install packagename" ', I think you're wanting to run yum inside the rpm installation process. This isn't allowed (it's a really bad idea and the files are locked anyway). What you may want to do is to build dependencies into your RPM, as Aaron suggested. If ALL you're doing is requiring some other packages, then you're set if you follow Aaron's advice. But, you are free to also unpack and copy-in some tarballed data as well -- that's perfectly okay. Aug 24, 2017 at 2:39
0

Create a appropriate spec file. This describes rpm for developer.

You should pay attention to %require. This is where you specify the dependencies like php, mysql. You don't have to bundle every package in your rpm. rpm is smart to figure out what package are being needed. Chapter 14 of the link describes this.

The resulting rpm can be installed using rpm install pkg_name.rpm but if you want yum install pkg_name, then you need set up a yum repo.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.