Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 10-05-2005, 01:31 AM   #1
Registered: Nov 2004
Distribution: fc4
Posts: 104

Rep: Reputation: 15
howto create rpm (ffmpeg in particular)

hi all

i want to find out how to create an rpm, i am a linux novice, but i don't think that that should stop me

i need to create an ffmpeg rpm because the ones that i have been using are getting a little outdated and do not provide all that i need

the version that i am currently using is the latest one for rhel3 from
created from the src rpm so that i could enable amr_nb

the problem is, it doesn't seem to convert some videos correctly, and it may be because the build is too old

so i just want to find out if this can be done by someone like me, and if it is easy enough to do over and over (so i can upgrade the build if necessary)

i know that ffmpeg has a lot of third party libraries that need to be installed as well

these i would just install as normal from rpm (eg. amr_nb, mp3, etc)


Last edited by dtra; 10-05-2005 at 01:36 AM.
Old 10-05-2005, 06:34 PM   #2
Registered: May 2001
Posts: 29,359
Blog Entries: 55

Rep: Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545
Sure, why not. It's not that hard.
If the system is unchanged rpm's are built in the /usr/src/redhat tree:
BUILD -> here are rpm's unpacked, configured and compiled
RPMS -> packaged rpm's are stored here
SOURCES -> tarballs and patches
SPECS -> the .spec files with which to script building an rpm
SRPMS -> packaged rpm's are stored here (tarball+patches+spec file)

BTW, before I continue, some tarballs come with a spec file (zcat tarball.tgz|tar -t|grep -ie "\.spec$"). Then you can build it straight away with "rpm -tb app.spec" and forget the rest below.

OK. You already know you will have to install the dependencies like development libraries. Next grab the last .src.rpm (or the spec file, get the latest tarball separately) and install/place it. This will leave you with the tarball (+patches if any) in SOURCES and the .spec file in SPECS. Unpack the tarball manually, apply patches, then configure and compile it to see if there are no errors. If there aren't any continue looking at the .spec file. Here is a crude example:

%define name     app
%define ver      0.1
%define rel      1

Summary: %{name}
Name: %name
Version: %ver
Release: %rel
Copyright: GPL
Group: Console/Applications
Source: %{name}-%{ver}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}
Provides: %{name}

This is a useful app.

%setup -q

./configure --prefix=/usr/local

make prefix=$RPM_BUILD_ROOT%{prefix} install-strip


%defattr(-, root, root)

* Sat Sep 11 1999 Some One <>
- First rpm
Check the topmost defines so the %{name} and %{ver} is in sync with the version of your tarball, else rpm can't find and unpack it. Usually you don't have to tweak the rest above %prep and %setup unless you got patching to do. Under %build you'll find the commands you previously ran on the commandline to get the package to build: replace 'em here if necessary. Now try "rpm -bb app.spec" (bb=build only binary rpm) and see if it will build. If it fails the commands can be seen in tmpfiles in the %{_tmppath} (see: rpmbuild --showrc|grep -ie topdir). Post any errors here and we'll see.

This looks like a lot, but it isn't. And you're right, when you got the spec file right for one rpm you usually don't have to tweak much afterwards.

* If you think you will want to build more rpm's have a look at this IBM developerWorks doc Packaging software with RPM, Part 2: Building without root. Because if you keep building rpm's as root account user you will probably fsck up one time polluting your system.
Old 10-05-2005, 06:38 PM   #3
Senior Member
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
See also: - Mandriva RPM HOWTO - RPM Howto
Old 10-20-2005, 07:44 PM   #4
Registered: Nov 2004
Distribution: fc4
Posts: 104

Original Poster
Rep: Reputation: 15
oops, thank you, didn't realise i got a response
hopefully i can pull this off
Old 10-20-2005, 11:46 PM   #5
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 75
For Redhat/FEdora rpms take a look at the Fedora Developers Guide.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
ffmpeg amr support rpm !!! riccisit Mandriva 3 10-09-2006 11:39 AM
Howto Create a PhotoCD shoekstr Linux - Software 3 03-23-2005 06:41 AM
How to create my own font -tool/howto? bröggle Linux - Software 0 12-06-2004 04:13 PM
Howto create a distro like DSL? muczy Linux - Software 2 06-17-2004 10:09 PM
HowTo create manpages sguenneur Linux - General 0 03-31-2004 09:41 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:42 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration