Scientific Linux Forum.org



  Reply to this topicStart new topicStart Poll

> Build a RPM from a SRPM - "The Basics"
AndrewSerk
 Posted: Apr 17 2011, 07:19 PM
Quote Post


SLF Moderator
******

Group: Moderators
Posts: 518
Member No.: 54
Joined: 14-April 11









Build a RPM from a SRPM - "The Basics"

Install the necessary packages, add user mockbuild and setup rpmbuild environment:

CODE
su -c 'yum install rpmdevtools yum-utils mock'

CODE
su -c 'useradd mockbuild'

CODE
rpmdev-setuptree


Download the .srpm of the package you want to build to your ~/rpmbuild/SRPMS/ folder and:

CODE
su -c 'yum-builddep /home/YOUR_USER_NAME/rpmbuild/SRPMS/PACKAGE<VERSION>.srpm.rpm'

CODE
cd ~/rpmbuild/SRPMS

CODE
rpmbuild –rebuild PACKAGE<VERSION>.srpm.rpm


When the above has completed you should have the new rpm/s in a sub-folder of ~/rpmbuild/RPMS/ . You can then install them with:
CODE
su -c 'yum localinstall –nogpgcheck /home/YOUR_USER_NAME/rpmbuild/RPMS/SUBFOLDER/PACKAGE<VERSION>.rpm'


This is a very basic how-to and often you may have to build a dependency before building a package. Just use the same steps to build the needed dependency.
For more info see
CODE
man rpmbuild
or
CODE
man mock


Hope this helps someone,
PM
^
joutlan
 Posted: Apr 17 2011, 08:45 PM
Quote Post


SLF Founder
********

Group: Admins
Posts: 1111
Member No.: 1
Joined: 8-April 11









Thanks Andrew! This can come in very handy because many progs are only out in the wild as src rpms... wink.gif


--------------------
DΞLL Precision M6700: 17 inch NB//i7-quad w/USB 3.0, 16.0GB, Quadro K5000M 2.0GB DDR3, RGBLED //W8P64/Scientific Linux 6.4 x64
DΞLL Vostro 3350 Nirvana: 13 inch NB w/ IntelSSD// W8Px64 (Work;Games)
Nexus 4 //Android
PMEmail PosterUsers WebsiteIntegrity Messenger IM
^
AndrewSerk
 Posted: Apr 17 2011, 11:28 PM
Quote Post


SLF Moderator
******

Group: Moderators
Posts: 518
Member No.: 54
Joined: 14-April 11









QUOTE (joutlan @ Apr 17 2011, 03:45 PM)
Thanks Andrew!  This can come in very handy because many progs are only out in the wild as src rpms... wink.gif

My pleasure,
Congrats and Great job with the forum
PM
^
spoovy
 Posted: Apr 18 2011, 09:47 PM
Quote Post


SLF Moderator
****

Group: Moderators
Posts: 258
Member No.: 5
Joined: 8-April 11









Thanks AndrewSerk. I did a similar thread using Transmission as the example. Interesting to me to see how different the process is as you do it.


--------------------
PMIntegrity Messenger IM
^
joutlan
 Posted: Apr 18 2011, 09:53 PM
Quote Post


SLF Founder
********

Group: Admins
Posts: 1111
Member No.: 1
Joined: 8-April 11









QUOTE (spoovy @ Apr 18 2011, 05:47 PM)
Thanks AndrewSerk.  I did a similar thread using Transmission as the example. Interesting to me to see how different the process is as you do it.


I did it differently too when I built the msttcorefonts linked here...I'll look at that closely when I get a chance smile.gif


--------------------
DΞLL Precision M6700: 17 inch NB//i7-quad w/USB 3.0, 16.0GB, Quadro K5000M 2.0GB DDR3, RGBLED //W8P64/Scientific Linux 6.4 x64
DΞLL Vostro 3350 Nirvana: 13 inch NB w/ IntelSSD// W8Px64 (Work;Games)
Nexus 4 //Android
PMEmail PosterUsers WebsiteIntegrity Messenger IM
^
AndrewSerk
 Posted: Apr 18 2011, 10:48 PM
Quote Post


SLF Moderator
******

Group: Moderators
Posts: 518
Member No.: 54
Joined: 14-April 11









You got to like Linux for all the different ways to achieve the same goal. smile.gif
PM
^
spoovy
 Posted: Apr 19 2011, 01:21 PM
Quote Post


SLF Moderator
****

Group: Moderators
Posts: 258
Member No.: 5
Joined: 8-April 11









QUOTE (AndrewSerk @ Apr 18 2011, 10:48 PM)
You got to like Linux for all the different ways to achieve the same goal. smile.gif


This is the core reason why I prefer Linux to Windows - you don't have to learn to operate a quirky and arbitrary machine to achieve a given task (then have to learn an entirely different machine 5 years later); you are handed a box of power tools instead and allowed to work it out for yourself.


--------------------
PMIntegrity Messenger IM
^
leigh123linux
 Posted: Apr 19 2011, 03:37 PM
Quote Post


SLF Junior
**

Group: Members
Posts: 45
Member No.: 48
Joined: 14-April 11









When I get the spare time I will post some more build methods

1. mock
2. koji
3. fedpkg
PM
^
spoovy
 Posted: Apr 19 2011, 03:56 PM
Quote Post


SLF Moderator
****

Group: Moderators
Posts: 258
Member No.: 5
Joined: 8-April 11









That would be great leigh.


--------------------
PMIntegrity Messenger IM
^
AndrewSerk
 Posted: Apr 19 2011, 05:54 PM
Quote Post


SLF Moderator
******

Group: Moderators
Posts: 518
Member No.: 54
Joined: 14-April 11









QUOTE (leigh123linux @ Apr 19 2011, 10:37 AM)
When I get the spare time I will post some more build methods

1. mock
2. koji
3. fedpkg


Yes, please do, as I have learned much form your well thought out guides though the years, and let me use this post to thank you for all you have done/do for the Linux community.
PM
^
U308
 Posted: Apr 19 2011, 06:21 PM
Quote Post


SLF Expert
******

Group: Members
Posts: 506
Member No.: 32
Joined: 11-April 11









I found this interesting site...rpmbuild command ref. etc.
Enough to ensure my perpetual absence from that 'do you have waaay to much time..' thread. biggrin.gif
PM
^
joutlan
 Posted: Apr 19 2011, 06:34 PM
Quote Post


SLF Founder
********

Group: Admins
Posts: 1111
Member No.: 1
Joined: 8-April 11









QUOTE (leigh123linux @ Apr 19 2011, 11:37 AM)
When I get the spare time I will post some more build methods

1. mock
2. koji
3. fedpkg


Tell you what....make it all inclusive and we can possibly sticky it.

Thanks much !


--------------------
DΞLL Precision M6700: 17 inch NB//i7-quad w/USB 3.0, 16.0GB, Quadro K5000M 2.0GB DDR3, RGBLED //W8P64/Scientific Linux 6.4 x64
DΞLL Vostro 3350 Nirvana: 13 inch NB w/ IntelSSD// W8Px64 (Work;Games)
Nexus 4 //Android
PMEmail PosterUsers WebsiteIntegrity Messenger IM
^
alexander.hunt
 Posted: May 26 2011, 04:44 AM
Quote Post


SLF Newbie


Group: Members
Posts: 11
Member No.: 149
Joined: 10-May 11









Thank you Andrew, This is just what I was looking for to build xfce 4.8 x86_64 from src.rpm files.
I'm very happy to have found it here.
Best regards and Thanks again
PM
^
AndrewSerk
 Posted: May 27 2011, 02:04 PM
Quote Post


SLF Moderator
******

Group: Moderators
Posts: 518
Member No.: 54
Joined: 14-April 11









QUOTE (alexander.hunt @ May 25 2011, 11:44 PM)
Thank you Andrew, This is just what I was looking for to build xfce 4.8 x86_64 from src.rpm files.
I'm very happy to have found it here.
Best regards and Thanks again


Hello,
You are very welcome.
Just a heads up, XFCE DE is being ported to SL. smile.gif
Check out this thread for more info: http://scientificlinuxforum.org/index.php?showtopic=381
PM
^
lebenskuenstler
 Posted: Jul 15 2011, 05:25 AM
Quote Post


SLF Newbie


Group: Members
Posts: 4
Member No.: 391
Joined: 6-July 11









QUOTE (AndrewSerk @ Apr 17 2011, 08:19 PM)
Build a RPM from a SRPM - "The Basics"

CODE
rpmbuild –rebuild PACKAGE<VERSION>.srpm.rpm




Hi,

for my understanding: Did you not mean this:

CODE
[U]mock[/U] –rebuild PACKAGE<VERSION>.srpm.rpm


I get something like this then:
CODE

ERROR: Exception(clutter-imcontext-0.1.6-4.fc15.src.rpm) Config(epel-6-x86_64) 0 minutes 2 seconds
INFO: Results and/or logs in: /var/lib/mock/epel-6-x86_64/result
ERROR: Command failed:
# ['/usr/bin/yum', '--installroot', '/var/lib/mock/epel-6-x86_64/root/', 'groupinstall', 'buildsys-build']
Error: Cannot retrieve repository metadata (repomd.xml) for repository: beta. Please verify its path and try again


What does this mean?

Also fedpkg local (following leigh) did not work, I get some error during compilation.

(All this trouble 'cause I need syncevolution ..... argh)

Many thanks,

LK


PM
^
AndrewSerk
 Posted: Jul 15 2011, 05:39 PM
Quote Post


SLF Moderator
******

Group: Moderators
Posts: 518
Member No.: 54
Joined: 14-April 11









QUOTE (lebenskuenstler @ Jul 15 2011, 12:25 AM)
QUOTE (AndrewSerk @ Apr 17 2011, 08:19 PM)
Build a RPM from a SRPM - "The Basics"

CODE
rpmbuild –rebuild PACKAGE<VERSION>.srpm.rpm




Hi,

for my understanding: Did you not mean this:

CODE
[U]mock[/U] –rebuild PACKAGE<VERSION>.srpm.rpm


I get something like this then:
CODE

ERROR: Exception(clutter-imcontext-0.1.6-4.fc15.src.rpm) Config(epel-6-x86_64) 0 minutes 2 seconds
INFO: Results and/or logs in: /var/lib/mock/epel-6-x86_64/result
ERROR: Command failed:
# ['/usr/bin/yum', '--installroot', '/var/lib/mock/epel-6-x86_64/root/', 'groupinstall', 'buildsys-build']
Error: Cannot retrieve repository metadata (repomd.xml) for repository: beta. Please verify its path and try again


What does this mean?

Also fedpkg local (following leigh) did not work, I get some error during compilation.

(All this trouble 'cause I need syncevolution ..... argh)

Many thanks,

LK



Hello,
This guide is a basic rpmbuild guide and I have not seen anyone post a mock build guide yet. Here is a draft document for rpm that has some useful info that may be pertinent. http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/

QUOTE
INFO: Results and/or logs in: /var/lib/mock/epel-6-x86_64/result

The logs may give a hint of the issue.

If I can find the time over the weekend I will give it a proper look.

PM
^
lebenskuenstler
 Posted: Jul 15 2011, 10:09 PM
Quote Post


SLF Newbie


Group: Members
Posts: 4
Member No.: 391
Joined: 6-July 11









QUOTE (AndrewSerk @ Jul 15 2011, 06:39 PM)
If I can find the time over the weekend I will give it a proper look.


Hi, thanks for the offer. I was (stupidly) a little to optimistic. I tried to compile the F15 packages, which will never work 'cause I'd had to portate the whole evolution stuff (....) with it.

I found out that the F13 packages will have a fair chance. They even install on SL6 using the yum --localinstall command, this means all dependencies are met by SL6 repo.
But I did not have yet any time to check if they work properly, too.

LK
PM
^
AndrewSerk
 Posted: Jul 16 2011, 06:13 PM
Quote Post


SLF Moderator
******

Group: Moderators
Posts: 518
Member No.: 54
Joined: 14-April 11









Glad you where able to solve the issue. smile.gif
PM
^
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll