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


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

Reply With Quote
Old 4th August 2005, 12: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


and the relative sources in


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
Old 4th August 2005, 03: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
Old 4th August 2005, 03:51 PM
eggsy85 Offline
Registered User
Join Date: Sep 2004
Age: 33
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
Old 4th August 2005, 04:36 PM
foolish Offline
Retired Community Manager
Join Date: Feb 2004
Location: Aalesund, Norway
Age: 30
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:
yum install fedora-rpmdevtools yum-utils
Now make a build tree, as the user who'll build the packages (Not root!), run:
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:
yumdownloader --source bchunk
Install the downloaded src.rpm:
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:
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:
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

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 15th October 2008 11:22 PM
Create own rpm - need help with spec file den23513 Using Fedora 2 6th July 2008 08:25 PM
About the spec file in emacs-21.4-2.src.rpm AlaxMAX Using Fedora 2 19th April 2005 08:41 AM

Current GMT-time: 20:46 (Tuesday, 22-08-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive

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