Fedora Linux Support Community & Resources Center
  #1  
Old 4th August 2005, 01:33 PM
eggsy85 Offline
Registered User
 
Join Date: Sep 2004
Age: 30
Posts: 46
Viewing the spec file of RPMīs

Hi

I am currently building my own RPM file for some software I am making and find it best to learn from examples.

Is there any way to view the spec file of RPM files?

EG. If I d/l one from the net is there anyway I can view its spec file?

Thanks all

Eggsy
Reply With Quote
  #2  
Old 4th August 2005, 01:47 PM
daneel971 Offline
Registered User
 
Join Date: Jun 2005
Location: Italy
Posts: 1,108
just download a *.src.rpm and extract the specfile from it; if you install it, the spec file will be under

/usr/src/redhat/SPECS

and the relative sources in

/usr/src/redhat/SPECS

In the DAG repo you can find specfiles without having to download the entire package
__________________
- Captain...
- Yes, Spock?
- I can't believe my ears...
Reply With Quote
  #3  
Old 4th August 2005, 04:01 PM
viper8 Offline
Registered User
 
Join Date: Mar 2004
Location: Detroit Rock City!
Posts: 146
Yeah, I've been curious before as well...check: http://dag.wieers.com/packages/ and browse through the packages, each one has the .spec file so you can look through them without even installing the src
Reply With Quote
  #4  
Old 4th August 2005, 04:51 PM
eggsy85 Offline
Registered User
 
Join Date: Sep 2004
Age: 30
Posts: 46
Yeah thanks for the reply will have a look.

Another question leading on from this is looking at rpms and building one of your own, is there a way you can make the files 'install' to a directory of your choice such as modifying the install command or something similar?
Reply With Quote
  #5  
Old 4th August 2005, 05:36 PM
foolish Offline
Retired Community Manager
 
Join Date: Feb 2004
Location: Aalesund, Norway
Age: 28
Posts: 1,888
If learning how to make rpm packages, do learn it the proper, fedoraish way. First thing you should do is to install fedora-rpmdevtools and yum-utils:
Code:
yum install fedora-rpmdevtools yum-utils
Now make a build tree, as the user who'll build the packages (Not root!), run:
Code:
fedora-buildrpmtree
This will create the rpmbuild folder in the users home directory, the rpmbulld folder contains the following subfolders: RPMS SRPMS SPECS SOURCES BUILD. When you install a src.rpm it will place the source and eventual patches in the SOURCE folder, the spec in the SPEC folder. When you build packages the finished binary RPMS will be placed in RPMS. You ge t the picture.

Now get a src.rpm from fedora core or extras as an example. It's good to get a package fairly similar to the one you're bulding. If your packaging a python application, get a python example and so forth. I'll use a very simple package, bchunk, in my examples:
Code:
yumdownloader --source bchunk
Install the downloaded src.rpm:
Code:
rpm -ivh bchunk*.rpm
Now have a look at the spec in the SPECS folder. Use a text editor with syntax highlightning to make it easier to catch errors, personally I use gvim.

To create a new spec file, go the the SPECS directory and use the fedora-newrpmspec command with the name of what you are building:
Code:
fedora-newrpmspec <name of software>
Open the new .spec and start editing the template. Do remember to read the fedora extras wiki for pointers: http://www.fedoraproject.org/wiki/Extras

Once you get the hang of packaging, there are plenty of tools to ensure the quality of a package. The first one is called rpmlint and it will point out the most obvious errors. Another great tool is mock, which builds a small but complete environment and tries to build and install the package in this environment. Mock does take a bit of time to run, but if your package builds in mock it's pretty solid. Install both tools using yum:
Code:
yum install rpmlint mock
Hopefully this'll get you started in building packages, and doing it the right way from the start.
__________________
Sindre Pedersen Bjørdal || http://www.fedorasolved.org || Hardware Profile
- Please adhere to the FedoraForum Guidelines.
Reply With Quote
Reply

Tags
file, rpmīs, spec, viewing

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I need help with my FCEUX spec file uncholowapo Gamers' Lounge 4 26th December 2008 06:06 PM
Can someone check my spec file? uncholowapo Gamers' Lounge 2 16th October 2008 12:22 AM
Create own rpm - need help with spec file den23513 Using Fedora 2 6th July 2008 09:25 PM
About the spec file in emacs-21.4-2.src.rpm AlaxMAX Using Fedora 2 19th April 2005 09:41 AM


Current GMT-time: 04:40 (Friday, 19-12-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletinŪ Copyright Đ2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Creek Side - Stockholm-Arlanda Airport (ARN) Travel Photos on Instagram - Marina of Koper Travel Photos - Te Whiti Park Instagram Photos - Texas State Fair Photos on Instagram