LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-16-2015, 03:36 PM   #1
ram_rajavarapu
Member
 
Registered: May 2008
Posts: 42

Rep: Reputation: 15
Making RPM's


Hello All,

In our organization I have to installing & upgrading packages through source files on Centos. I am moving to automation process to make rpms for those tar files. I stuck somewhere in composing spec files. Please clarify me some points are:

1) How to know which rpm to be placed in BuildRequires & Requires in spec file.

2) How to place which files be in "files" and what permissions should they have.

3) Can we upgrade the rpm which was already installed by rpm that will be made from spec file.


Thanks,
-Rama
 
Old 03-16-2015, 03:50 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 25,830

Rep: Reputation: 7761Reputation: 7761Reputation: 7761Reputation: 7761Reputation: 7761Reputation: 7761Reputation: 7761Reputation: 7761Reputation: 7761Reputation: 7761Reputation: 7761
Quote:
Originally Posted by ram_rajavarapu View Post
Hello All,
In our organization I have to installing & upgrading packages through source files on Centos. I am moving to automation process to make rpms for those tar files. I stuck somewhere in composing spec files. Please clarify me some points are:

1) How to know which rpm to be placed in BuildRequires & Requires in spec file.
Not sure what you're even asking here.
Quote:
2) How to place which files be in "files" and what permissions should they have.
They should have whatever permissions you WANT them to have, or need, to be able to run.
Quote:
3) Can we upgrade the rpm which was already installed by rpm that will be made from spec file.
Very obviously, yes, since your RPM won't be any different from any OTHER RPM. Since you'll update the versions/spec files of your RPM with new versions, it'l behave exactly as any other file would.

There are MANY easily-found tutorials about how to create RPM files for source code, binaries, or even shell scripts. Have you looked at ANY of them?
http://www.thegeekstuff.com/2015/02/...ckage-example/
http://tecadmin.net/create-rpm-of-yo...-centosredhat/

After using Linux for seven years now, you should be comfortable with doing minor things and easily be able to follow those instructions.
 
Old 03-16-2015, 06:53 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
Quote:
Originally Posted by ram_rajavarapu View Post
How to know which rpm to be placed in BuildRequires & Requires in spec file.
BuildRequires are the names of the packages required to build the package you're building, think of the checks done at the './configure' stage, and Requires are the dependencies, the names of the packages required to run your packages contents. Please read How to create an RPM package as its the best doc around IMHO.


Quote:
Originally Posted by ram_rajavarapu View Post
How to place which files be in "files"
At the end of the "%install" stage use
Code:
find $RPM_BUILD_ROOT -not -type d -printf "%%%attr(%%m,root,root) %%p\n" | sed -e "s|$RPM_BUILD_ROOT||g" > %{_tmppath}/%{name}_contents.txt
and then at "%files" refer to it as
Code:
%files -f %{_tmppath}/%{name}_contents.txt
Note the "%files" section can also take a
Code:
%defattr(-,root,root)

Quote:
Originally Posted by ram_rajavarapu View Post
and what permissions should they have.
That depends on the purpose of the item. If you'r rebuilding a RPM please have a look at the .spec file from the .src.rpm, else what sane defaults your system provides and else create your own sane defaults and test:
Code:
%files
%defattr(-,root,root)
%doc faq/* README ChangeLog QUICKSTART doc/*
%attr(755,root,root) /usr/local/bin/item
%attr(644,root,root) /usr/local/etc/item.conf

Quote:
Originally Posted by ram_rajavarapu View Post
Can we upgrade the rpm which was already installed by rpm that will be made from spec file.
In theory yes but in practice "it depends". For example you should not mess with custom built packages that overwrite items vital to a system like the kernel, glibc (or Python on RHEL or equivalent) unless there's no alternative, and until you're well-versed and will offer support during installation / use of your package(s). You better not mess with custom built (replacement) packages especially if the system comes with licensed vendor support. You should test installing RPM packages in a staging area and not on Production. Think you can do that? OK, then do read this paragraph again and let the implications of what you're about to do sink in good before proceeding.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Making an rpm replace another rpm arizonagroovejet Linux - General 3 07-21-2011 07:41 AM
Making RPM package vikasumit Programming 1 09-02-2006 06:17 AM
Making a RPM Kryptow Linux - Software 1 09-20-2002 09:56 PM
about making rpm oldbee Programming 2 01-10-2002 02:53 PM
Making rpm saleem Linux - General 5 11-12-2001 05:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration