LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-18-2009, 01:11 AM   #1
vibhor_agarwalin
LQ Newbie
 
Registered: Apr 2009
Posts: 15

Rep: Reputation: 0
Help in building RPM


Hi,

My directory structure is /home/user/rpm
Inside rpm i have many different RPM build directories like: a, b & c

Have rpm sources inside each directory like BUILD, RPMS, SPECS, SOURCE, SRPMS

Have defined %_topdir in ~/.rpmmacros
/home/user/rpm/a
This builds the RPM in "a" directory, however, i will have to change it to "b" if i need to build RPM in "b" directory.

I have to change this variable everytime as i build the RPM in directory a, b or c.
How can this be done without changing this variable everytime.

Thanks
 
Old 05-18-2009, 03:23 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
With the "--macros /path/to/.rpmmacros" switch?
 
Old 05-18-2009, 06:01 AM   #3
vibhor_agarwalin
LQ Newbie
 
Registered: Apr 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks

That means i'll have to create a rpmmacro file for each & every directory i will use to build RPMS.
Am i right?

Isn't there a way to pick it up automatically?
 
Old 05-18-2009, 09:09 AM   #4
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
Interesting ....

Any particular reason not to stick to the default

like .. "/usr/src/r**/BUILD/<application>" .. ? ?

.....
 
Old 05-18-2009, 10:55 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by vibhor_agarwalin View Post
That means i'll have to create a rpmmacro file for each & every directory i will use to build RPMS.
Or use a define something like 'rpmbuild --define="_topdir /path/to/A/dir"'.
 
Old 05-18-2009, 11:59 PM   #6
vibhor_agarwalin
LQ Newbie
 
Registered: Apr 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks

The --define tag worked.
I am not using the default dir as in "/usr/src/r**/BUILD/<application>" the <application> will be a no. of folders.
Will that still work?
 
Old 05-20-2009, 07:25 AM   #7
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
Quote:
Will that still work?
I use it all the time, that's the default.

Example : PCLOS 2009, /usr/src/rpm/SOURCES, 73 files
from about 12 different applications. The spec file
commands will use files from the specified application only.

/usr/src/rpm/BUILD : 16 folders = 16 different applications.
.....
 
Old 05-20-2009, 09:39 AM   #8
*******
Member
 
Registered: Feb 2009
Posts: 63

Rep: Reputation: 16
Quote:
Originally Posted by knudfl View Post
/usr/src/rpm/SOURCES
Using /usr/src/rpm/BUILD means building packages as root. That an unnecessary risk.
 
Old 05-21-2009, 01:47 AM   #9
vibhor_agarwalin
LQ Newbie
 
Registered: Apr 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Yup,
That will be a point, I don't want to build packages via root.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help building an .rpm from a .src.rpm ssenuta Linux - Software 6 04-10-2006 10:36 PM
Need help building my own rpm Hungry ghost Linux - Software 4 02-27-2006 09:30 PM
Building RPM via src.Rpm ivanatora Linux - Newbie 2 02-20-2006 04:29 PM
building rpm nearfar Linux - Newbie 1 12-29-2003 09:21 PM
building rpm saleem Programming 1 11-12-2001 05:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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