LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 02-18-2011, 12:19 AM   #1
Teibidh
LQ Newbie
 
Registered: Feb 2011
Posts: 7

Rep: Reputation: 0
Yet another how do I build an SRPM thread...


Okay, I can use rpmbuild --help ... and I'm fairly confident that I can figure out how to unpack an SRPM, or simply build straight from one. What I can't seem to locate is a clear reference that explains all the options for rpmmacros or rpmrc files. I want to play around with rebuilding Fedora from source using very specific optimizations (I have to use the i686 variant on a Phenom II X4 because x86_64 doesn't work with some Wine stuff I want to run) so I at least want to squeeze whatever I can out of it.... That, and it's fun for me.

So, if it's easier for someone to answer: What file(s) would I modify to force a specific set of CFLAGS and CXXFLAGS on the rpmbuild process or where can I find documentation that would explain it to me (at least somewhat clearly, like, with examples..)?

Another question... assuming I get the packages that I want built I will probably just rebuild my entire local mirror worth of SRPMs. These would be called something like <package>-<version>.tei.i686. How would I go about making yum prefer those versions over versions offered by other repos? So if I were to use 'su -c yum install foo', how would I insure that it uses foo-1.1.tei.i686.rpm instead of foo-1.1.i686.rpm assuming both are available in visible repositories? Would I just have to disable all the other repos or what?
 
Old 02-18-2011, 12:02 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Versions : Example grub-0.97-66.fc14.src.rpm : 0.97 is the "major" version number.
66 is "minor" = build version. "66" can be changed in the file 'grub.spec',
thus indicating a later build : The command 'rpm -Uvh <package', that yum uses,
should the upgrade the package.
Say you are using 'minor's starting with 500, no Fedora package would ever
come close to that with a later build number.

About CFLAGS : Please look into the spec file. Example, a random grub :
Code:
CFLAGS="-Os -g -fno-strict-aliasing -Wall -Werror -Wno-shadow"
if [ "$GCCVERS" == "4" ]; then
	CFLAGS="$CFLAGS -Wno-pointer-sign"
fi
%ifarch x86_64
CFLAGS="$CFLAGS -static" 
%endif
export CFLAGS
%configure --sbindir=/sbin --disable-auto-linux-mem-opt
make
And the rpm account : "Setting up an unpreviledged rpmbuild account in /home/<name>/":
http://www.linuxquestions.org/questi...1-a-766486/#13
→ post # 13.
 
Old 02-18-2011, 03:01 PM   #3
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Rep: Reputation: 56
Sorry if this seems obvious, but it is where I picked up most of my rpm knowledge. For more in depth documentation on rpm, I would take a look at the links on www.rpm.org. I found the Maximum RPM and Fedora RPM Guide most helpful. They also have a community of users using their mailing lists and you might even try the irc channel.

What you will probably end up doing with yum is building a local repository and then creating a repo file for it. There are then two options for determining which repository takes preference. You could enable or disable the ones you want and don't want. Another option is a package called yum-priorities.
 
  


Reply



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 build RPM from Postfix SRPM with PostgreSQL Support? justemail Linux - General 5 05-31-2009 12:46 PM
ffmpeg srpm build error texi2html dtra Linux - Software 0 10-21-2005 12:39 AM
finding srpm edgjerp Linux - Software 1 06-26-2005 02:59 PM
Srpm? halechris Linux - Newbie 2 11-16-2004 10:04 PM
gnome 2.4 srpm build order on redhat AS 3.0 dnraikes Linux - General 1 12-19-2003 06:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 08:39 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