LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 11-26-2010, 05:39 PM   #1
yzhang738@hotmail.com
LQ Newbie
 
Registered: Oct 2010
Posts: 14

Rep: Reputation: 0
Question on rpm for ffmpeg


I have a rpm to install ffmpeg on linux, but I don't quite understand how it works. Please help me. Here is the spec for rpm:
Code:
Summary: Custom FFmpeg RPM
Name:ffmpeg
Version: 1.1.0
Release: 1
License: GPL
Group: Development/Tools
Source: ffmpeg-1.1.0.tar.gz
BuildRoot: %{_builddir}/%{name}-root
%description
Custom FFMPEG RPM.
%prep
%setup -c -q
%build
%install
cp -a ./ $RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
/usr/lib/libfaac.so.0
/usr/lib/libmp3lame.so.0
/usr/lib/libfaad.so.0
/usr/lib/libxvidcore.so.4
/usr/lib/libxvidcore.so.4.1
/usr/bin/ffmpeg
/usr/lib/libvorbisenc.so.2
/usr/lib/libogg.so.0
/usr/lib/libvorbis.so.0
%doc
The questions are:
1. What is and how to set the value of _builddir?
2. What is and how to set the value of $RPM_BUILD_ROOT?
3. This rpm is supposed to be built in BuildRoot, what is the value of BuildRoot?
4. How does it copy binary of ffmpeg to /usr/bin and libraries to /usr/lib?
5. What is the meaning of /usr/lib/libfaac.so.0... under %defattr(-,root,root)? Are they libraries to be built or already exist and to be linked?

Thanks.

Last edited by yzhang738@hotmail.com; 11-26-2010 at 07:50 PM.
 
Old 11-27-2010, 01:50 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,564
Blog Entries: 54

Rep: Reputation: 2928Reputation: 2928Reputation: 2928Reputation: 2928Reputation: 2928Reputation: 2928Reputation: 2928Reputation: 2928Reputation: 2928Reputation: 2928Reputation: 2928
Quote:
Originally Posted by yzhang738@hotmail.com View Post
I have a rpm to install ffmpeg on linux, but I don't quite understand how it works.
If you don't then you are probably better off installing the standard software. In addition no answer will make you understand things the way you could by reading your distributions package building documentation, http://wiki.centos.org/PackageManagement/Rpm, http://fedoraproject.org/wiki/Docs/D...gPackagesGuide, http://www.rpm.org/wiki/Docs#PackagerDocumentation, rpm5.org/docs/rpm-guide.pdf and rpm5.org/docs/max-rpm.pdf.


Quote:
Originally Posted by yzhang738@hotmail.com View Post
What is and how to set the value of _builddir?
%_builddir as set in your ~/.rpmmacros or package.spec file and shown by 'rpmbuild --showrc' (also see "%%dump").


Quote:
Originally Posted by yzhang738@hotmail.com View Post
What is and how to set the value of $RPM_BUILD_ROOT?
%BuildRoot.


Quote:
Originally Posted by yzhang738@hotmail.com View Post
This rpm is supposed to be built in BuildRoot, what is the value of BuildRoot?
That depends on what "%{_builddir}" expands to. One good reason to NOT build packages as root account user.


Quote:
Originally Posted by yzhang738@hotmail.com View Post
How does it copy binary of ffmpeg to /usr/bin and libraries to /usr/lib?
See the %install section. This package simply runs 'cp -a ./ $RPM_BUILD_ROOT' (while ffmpeg comes with a 'make' script that has an "install" target).


Quote:
Originally Posted by yzhang738@hotmail.com View Post
What is the meaning of /usr/lib/libfaac.so.0... under %defattr(-,root,root)? Are they libraries to be built or already exist and to be linked?
The %files section lists files (to be) installed that belong to this package. This .specs %files section lists libraries that on a sane system belong to several other packages, meaning problems with dependency resolution, updating, de-installation, RPMDB corruption and whatnot may all be yours for free if you install this package. (Saying the person who wrote this spec file needs to read a few docs is an understatement.)
 
Old 12-04-2010, 12:55 AM   #3
yzhang738@hotmail.com
LQ Newbie
 
Registered: Oct 2010
Posts: 14

Original Poster
Rep: Reputation: 0
My qustion is: how to create rpm for ffmpeg that builds other libraries too. For example, we need to build libfaac, libxvidcore, libx264, libogg, libvorbis and etc. How to build these libraries along with ffmpeg because ffmpeg need them to run?
 
Old 12-04-2010, 04:06 AM   #4
yzhang738@hotmail.com
LQ Newbie
 
Registered: Oct 2010
Posts: 14

Original Poster
Rep: Reputation: 0
If x264, lame, ogg, ... are installed through separate rpm, how in rpm to install ffmpeg know if they are installed already?
 
Old 12-04-2010, 05:23 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,564
Blog Entries: 54

Rep: Reputation: 2928Reputation: 2928Reputation: 2928Reputation: 2928Reputation: 2928Reputation: 2928Reputation: 2928Reputation: 2928Reputation: 2928Reputation: 2928Reputation: 2928
Quote:
Originally Posted by yzhang738@hotmail.com View Post
If x264, lame, ogg, ... are installed through separate rpm, how in rpm to install ffmpeg know if they are installed already?
By the %requires tag. BTW did you read any of the docs I linked to?
 
Old 12-04-2010, 04:28 PM   #6
yzhang738@hotmail.com
LQ Newbie
 
Registered: Oct 2010
Posts: 14

Original Poster
Rep: Reputation: 0
Yes, I have read the pdf file about rpm that is the best I've seen. Many thanks unSpawn. My understanding is that separate rpm to install x264, ogg, vorbis, ... should be created and put to ffmpeg.spec as:
Code:
%require x264-.rpm
%require ogg-.rpm
...
So ffmpeg rpm is dependent on other rpms, right?

My question is:
1. If x264-.rpm is not installed, can it detect in ffmpeg rpm?
2. In order to install ffmpeg.rpm, other rpms must be installed separately. Is it possible to create a single rpm to install everything?
3. Can multiple rpms be installed at same time, eg rpm -i x264-rpm ogg-rpm...?
 
  


Reply

Tags
ffmpeg, rpm


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 Mass Conversion Question Bonken Linux - Newbie 13 08-05-2009 09:35 AM
Help me in installing ffmpeg, ffmpeg-PHP, Mplayer, Mencoder, flv2tool, LAME MP3 Encod mitesh.ever Red Hat 5 05-16-2009 01:14 PM
ffmpeg amr support rpm !!! riccisit Mandriva 3 10-09-2006 12:39 PM
howto create rpm (ffmpeg in particular) dtra Linux - Software 4 10-21-2005 12:46 AM


All times are GMT -5. The time now is 12:41 AM.

Main Menu
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