LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-05-2012, 11:41 PM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 36
How to create rpm?


I m referring below article for creating rpm.
http://rpmbuildtut.wordpress.com/ins...ion-and-setup/
As per the document i will need rpmdevtools and rpmlint to begin with.

However i have yum installed and whenever i run them i get below output.
Code:
# yum install rpmdevtools rpmlint
Setting up Install Process
Parsing package install arguments
No package rpmdevtools available.
No package rpmlint available.
Nothing to do
However i tried using rpm-devel package.
Code:
# yum install rpm-devel
Setting up Install Process
Parsing package install arguments
Package rpm-devel-4.4.2.3-9.el5.i386 already installed and latest version
Nothing to do
Is rpm-devel and rpmdevtools different as i m not able to execute other commands such as rpmdev-setuptree.

m i heading in right direction?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 03-06-2012, 12:55 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

What distro and version are you using? And are your repositories set up correctly? You might need the epel repositories enabled if you don't have them already. I've just checked on a CentOS 5.7 server and in the base repositories those packages are not available but they are in the EPEL repos. Have a look here with regards to the EPEL repos under CentOS.

Kind regards,

Eric
 
Old 03-06-2012, 02:03 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,683

Rep: Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284
Quote:
# yum install rpmdevtools rpmlint

Actually you can build a lot of rpm packages, until you
( after years ? ) find one that requires rpmdevtools, rpmlint.
 
Old 03-06-2012, 02:50 AM   #4
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by knudfl View Post
Actually you can build a lot of rpm packages, until you
( after years ? ) find one that requires rpmdevtools, rpmlint.
Didn't get you.
Can you be more specific?
 
Old 03-06-2012, 02:52 AM   #5
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by EricTRA View Post
Hello,

What distro and version are you using? And are your repositories set up correctly? You might need the epel repositories enabled if you don't have them already. I've just checked on a CentOS 5.7 server and in the base repositories those packages are not available but they are in the EPEL repos. Have a look here with regards to the EPEL repos under CentOS.

Kind regards,

Eric
Code:
# lsb_release -a
LSB Version:    :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: OracleVMserver
Description:    Oracle VM server release 2.2.0
Release:        2.2.0
Codename:       n/a
Code:
# uname -r
2.6.18-128.2.1.4.9.el5xen
 
Old 03-06-2012, 03:12 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,683

Rep: Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284
# 4.

Most rpm packages are built from SRC.RPMS.
Only a very few require rpmdevtools, rpmlint. ( BuildRequires ).


Setting up the unprivileged rpms account in /home/<name>/, post #13:
http://www.linuxquestions.org/questi...1-a-766486/#13
That's all. I have never used rpmdevtools, rpmlint.
.
 
Old 03-06-2012, 03:13 AM   #7
jimtony
Member
 
Registered: Jan 2011
Location: Shanghai,China
Distribution: fedora
Posts: 73
Blog Entries: 1

Rep: Reputation: 2
If your software format is rpm.
You just need rpmbuild to build and create rpms.
In fedora,rpmbuild can be used to build and create rpms.
 
Old 03-06-2012, 04:09 AM   #8
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by jimtony View Post
If your software format is rpm.
You just need rpmbuild to build and create rpms.
In fedora,rpmbuild can be used to build and create rpms.
but i dont have rpmbuild installed which package should i install ?
Code:
# rpmbuild
-bash: rpmbuild: command not found
..
 
Old 03-06-2012, 04:43 AM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,683

Rep: Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284
Quote:
rpmbuild: command not found
# yum install rpm-build
 
Old 03-06-2012, 04:55 AM   #10
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by knudfl View Post
# yum install rpm-build
One more issue.

Able to get a distribution where rpmbuild is already there but not able to run rpmdev-setuptree command .
As per the article this command needed for following purpose.
http://fedoraproject.org/wiki/How_to...lo_RPM_package
"sets up a RPM build area in your ~/rpmbuild. This directory will contain several subdirectories, for the project source code, RPM configuration files and for the resulting source and binary packages."


Code:
# rpmbuild
rpmbuild: no spec files given for build
# rpmdev-setuptree
bash: rpmdev-setuptree: command not found

I have below rpm command in this distribution.

Code:
# rpm
rpm        rpm2cpio   rpmbuild   rpmdb      rpmdiff    rpmgraph   rpmlint    rpmquery   rpmsign    rpmverify
new distribution details

Code:
# lsb_release -a
LSB Version:    :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: EnterpriseEnterpriseServer
Description:    Enterprise Linux Enterprise Linux Server release 5.2 (Carthage)
Release:        5.2
Codename:       Carthage
New query:
will the rpm developed on this distribution work on other rpm supported systems?

Last edited by pinga123; 03-06-2012 at 04:59 AM.
 
Old 03-06-2012, 05:13 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,683

Rep: Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284
Quote:
"sets up a RPM build area in your ~/rpmbuild.
That's what these simple commands do
http://www.linuxquestions.org/questi...1-a-766486/#13

( The rpmbuild folder can have any name.
In the above link it's /home/<name>/rpms/ ).


And by the way : You are not supposed to be root, when you run 'rpmbuild'.
All package creation should be done as ordinary user.

.

Last edited by knudfl; 03-06-2012 at 05:14 AM.
 
Old 03-06-2012, 05:59 AM   #12
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,415

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
Quote:
will the rpm developed on this distribution work on other rpm supported systems?
Ofcourse.
 
Old 03-06-2012, 06:05 AM   #13
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 36
Wink

Quote:
Originally Posted by knudfl View Post
That's what these simple commands do
http://www.linuxquestions.org/questi...1-a-766486/#13

( The rpmbuild folder can have any name.
In the above link it's /home/<name>/rpms/ ).


And by the way : You are not supposed to be root, when you run 'rpmbuild'.
All package creation should be done as ordinary user.

.
Created new user and now trying to create file in /home/usrname/.rpmmacros
with below contents .
Code:
%_topdir        $HOME/rpms
%_builddir      %{_topdir}/BUILD
%_rpmdir        %{_topdir}/RPMS
%_sourcedir     %{_topdir}/SOURCES
%_specdir       %{_topdir}/SPECS
%_srcrpmdir     %{_topdir}/SRPMS
%_tmppath       %{_topdir}/tmp
But whenever i execute the file it says.
Code:
$ sh .rpmmacros
.rpmmacros: line 1: fg: no job control
.rpmmacros: line 2: fg: no job control
.rpmmacros: line 3: fg: no job control
.rpmmacros: line 4: fg: no job control
.rpmmacros: line 5: fg: no job control
.rpmmacros: line 6: fg: no job control
.rpmmacros: line 7: fg: no job control
Not so sure about what m i doing
 
Old 03-06-2012, 06:35 AM   #14
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,683

Rep: Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284
Quote:
But whenever I execute the file it says.
'.rpmmacros' : It's a text file. Never to be run or seen. ( Hidden file.)

Please do :
1) touch .rpmmacros ( creates an empty file, if not already present.)
2) gedit .rpmmacros
.... then copy / paste the text into the file,
and edit <username> to actual user.
 
Old 03-06-2012, 02:26 PM   #15
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,093

Rep: Reputation: 197Reputation: 197
Quote:
Originally Posted by pinga123 View Post
will the rpm developed on this distribution work on other rpm supported systems?
Quote:
Originally Posted by Satyaveer Arya View Post
Ofcourse.
No, not 'ofcourse'. It depends on what's in the rpm. For example if the rpm contains binaries that a dynamically linked to shared libraries that aren't in the rpm then the rpm is only going to work on other systems which have the same versions (or compatible) of those libraries in the same locations. If the rpm depends on other packages then the rpm will only work on other systems where those packages are available.

I use SLED and openSUSE. Some rpms built for openSUSE will work on SLED but some won't. It very much depends on the rpm and which version of openSUSE it was built for and which version of SLED you're trying to use it on. I once found some software that was only available as an rpm which it was indicated was for use on RedHat. As it happened it worked on the version of SLED I was using, but there was no guarantee that it would.

If you find yourself wanting to create an rpm from a bunch of arbitrary files rather than from a source tarball check out
https://www.linuxquestions.org/quest...0/#post3680054

Last edited by arizonagroovejet; 03-06-2012 at 02:27 PM. Reason: (or compatible)
 
3 members found this post helpful.
  


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
How to create RPM jaikris Linux - Software 22 06-08-2010 02:53 PM
create rpm in mandriva munna_dude Programming 2 10-03-2007 11:59 PM
how to create a RPM jp-lack Linux - General 1 05-04-2007 06:57 AM
Create Rpm sjacobs Linux - Software 0 11-03-2005 07:19 AM
how to create .rpm package shalin Programming 1 07-13-2004 10:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:05 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration