LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 10-05-2005, 02:31 AM   #1
dtra
Member
 
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 dag.wieers.com
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)

thanks
dave

Last edited by dtra; 10-05-2005 at 02:36 AM.
 
Old 10-05-2005, 07:34 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,766
Blog Entries: 54

Rep: Reputation: 2976Reputation: 2976Reputation: 2976Reputation: 2976Reputation: 2976Reputation: 2976Reputation: 2976Reputation: 2976Reputation: 2976Reputation: 2976Reputation: 2976
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:

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

Summary: %{name}
Name: %name
Version: %ver
Release: %rel
Copyright: GPL
Group: Console/Applications
URL: http://www.One.com/~Some/app.html
Source: %{name}-%{ver}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}
Provides: %{name}

%description
This is a useful app.

%prep
%setup -q

%build
./configure --prefix=/usr/local
make

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

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root)
%doc AUTHORS COPYING ChangeLog NEWS README doc/*
%{config}/etc/app.conf
%{prefix}/sbin/app


%changelog
* Sat Sep 11 1999 Some One <Some@One.com>
- 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, 07:38 PM   #3
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 51
See also:
http://qa.mandriva.com/twiki/bin/view/Main/RpmHowTo - Mandriva RPM HOWTO
http://www.rpm.org/RPM-HOWTO/ - RPM.org RPM Howto
 
Old 10-20-2005, 08:44 PM   #4
dtra
Member
 
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-21-2005, 12:46 AM   #5
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

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


Reply


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


All times are GMT -5. The time now is 12:26 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration