how to build a rpm .
Hi all,
I want to make one RPM,I want to create one application. I am having doubts in all the stages of creating RPM as i know first you have to create a spec file. can any one tell me a simple example of spec file as I have a file called uselib.c and the purpose of this file is to print a message. so I want to create a RPM which will install this application to the location /root/myrpm/bin/ and when i run this this will print that message. I have only the .C file. Now I want the steps to create a RPM and also tell me a basic spec file structure for this application. and i am confused that in spec file what is given in $prep section there is somethig called %setup -b but my doubt is who will compile my .c file and what i have to write in spec file for this.also in SOURCE folder of RPM directory a zip will be there so what i will put inside that zip the .C file or the .o file if .C then who will compile that and how everything will happen kindly tell me this whole procedure. Thanks |
|
Hi TobiSGD,
Thanks for reply. I got that links before asking this thread i am having these doubts after reading all that. Thanks |
Then I suggest you post your .spec file contents and then ask for comments. You should have one by now as the offered docs are easy to read and besides you were given links to RPM documentation months ago already.
|
hi,
Bellow is the content of my spec file,I am just coping the content of the folder where my .out file is present to a desired location. what i understood ,to create rpm means just to give some command which will be executed during the installation in the form of an RPM file.If this is correct then here I am doing the .out file by myself and just want a copy operation each time I install a rpm ,no validation checking nothing ,I have the .out file in the source folder before making this rpm ,The spec file is in /root/MYRPMBUILD/rpmbuild/SPECS,it is my own build dir.Is this correct. But since i am getting error during this is this correct,If not kindly tell me a simple example ,about this RPM creation process. mysepc file ---------------- Summary: My first RPM Name: mylib Version: 0.1 Release: 1 Group: own Vendor: Pradiptart License: Pradita %description It is my first RPM which will install an application to show the hello message on the screen %prep %build %install cp /root/sharedlib/uselib /opt/my/ %clean %files Error I am getting ------------------------ Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.44508 + umask 022 + cd /usr/src/redhat/BUILD + LANG=C + export LANG + unset DISPLAY + $'\r' : command not found508: line 27: error: Bad exit status from /var/tmp/rpm-tmp.44508 (%prep) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.44508 (%prep) |
Quote:
- Do not build packages as root but as unprivileged user. - Do not enter garbage or bogus information. - Do not skip any packaging stage. Do things as they were intended. - Respect OS-specific carriage returns and line endings for file contents (see 'dos2unix'). Code:
%define debug_packages %{nil} Before you ask questions please reread the links TobiSGD gave you. Most of what you saw above could have been learned from there. |
All times are GMT -5. The time now is 12:16 AM. |