How to setup multimedia on CentOS-5

CentOS ships with basic sound support for audio content encoded with codecs for a variety of sound formats, including .wav and .ogg files. The alsa-utils and sox audio players are included for a TUI (CLI) environment; xmms is trivial to rebuild SRPMs. The popular full featured xmms player is omitted by the upstream, probably in light of the so-called Fraunhofer restrictions and non-free license requirements to address.

For those in jurisdictions not affected by such, the following procedures will describe how to setup multimedia support under CentOS 5. After completing the steps below, you should be able to play dvds on your computer. You'll also be able to view different media formats, for example Xvid, dvix, quicktime etc. You will also have mplayer integrated as a browser plugin which will allow you to view streaming video/audio content from within Firefox.

Some recommendations should be mentioned pertaining to the yum priorities plug-in. This will prevent accidentally overwriting packages from the base repositories. Also note the following needs to be performed as root user in a command line or terminal.

Please consider following the wiki document to assist in setting up the priorities plug-in, due to the fact that we are adding some third party repositories, described in the Priorities article.

Step 1: Add RPMforge repository access for your CentOS system. (Required for the majority of multimedia packages.)

You can read the installation instructions at Installing RPMForge.

Step 2: Install the multimedia applications.

The following steps will use yum to install all the packages needed to have full multimedia support. Note there will be a lot of dependencies.

yum install compat-libstdc++-33 libdvdcss libdvdread libdvdplay libdvdnav lsdvd libquicktime
yum install flash-plugin mplayerplug-in mplayer mplayer-gui gstreamer-ffmpeg gstreamer-plugins-bad gstreamer-plugins-ugly

Step 3: Install the w32Codecs. (Required for xvid and other proprietary formats.)

wget www1.mplayerhq.hu/MPlayer/releases/codecs/mplayer-codecs-20061022-1.i386.rpm
rpm -ivh mplayer-codecs-20061022-1.i386.rpm
wget www1.mplayerhq.hu/MPlayer/releases/codecs/mplayer-codecs-extra-20061022-1.i386.rpm
rpm -ivh mplayer-codecs-extra-20061022-1.i386.rpm

You should now have full multimedia and video support for most popular formats.

RPMForge is now RepoForge.

You want to spin out some fancy RepoForge action yourself. Test rebuilding SPEC files before asking for a pull request perhaps. Here is a quick start guide with the possible commands you might run:

  • Spin out a new RHEL/CentOS machine

    KVM is your friend if you do not have a spare physical box.

  • Software development tools

      yum groupinstall "Development Tools"
    yum install git
  • Setup mock (available at RepoForge) and use RepoForge mock configuration to build packages

      yum install mock
  • Create a build user

      useradd -G mock repoforge
    sudo -u repoforge -i
  • Checkout the RepoForge RPMs repository (or fork our repo, & checkout your own fork - especially if you plan to submit patches back to us)

      git clone git://github.com/repoforge/rpms.git
  • Setup a build environment

      mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
    mkdir -p ~/rpmbuild/RPMS/{i386,i486,i586,i686,noarch,athlon}
  • Build an RPM for your platform

      rpmbuild -bs file.spec
    mock -r <configfile> rebuild package-1.2-3.src.rpm
  • To build an RPM for an older platform (EL5 package on an EL6 machine):

      mkdir ~/bin
    vi ~/bin/rpmbuild-old
  • Paste the following contents

      #!/bin/bash
    rpmbuild \
    --define "_source_filedigest_algorithm 1" \
    --define "_binary_filedigest_algorithm 1" \
    --define "_binary_payload w9.gzdio" \
    --define="dist .el5" \
    --define="el5 1" \
    $*
  • Make the file executable

      chmod +x ~/bin/rpmbuild-old
  • Now build for EL5

      rpmbuild-old -bs file.spec

For those serious about doing a good job - build and test at least on RHEL4, RHEL5 and RHEL6 by specifying correct config files to mock builder

Manually rebuilding a package from RepoForge

So, maybe you have requested that a package be added to RepoForge, and a maintainer has written back to you something like ”I’ve committed your package; it’ll be available once it’s rebuilt.” You may be thinking “But… How long will that take? I need this now!”

Alternately, perhaps like this guy you have discovered that shared libraries have changed under your feet, and a package no longer works, and people say things like “just rebuild it”.

One workaround for situations like these is to manually rebuild the package:

Set up your environment

First, make sure your system is configured to pull packages from RepoForge. If you have not already done so, install the latest rpmforge-release package for your distribution and architecture.

Next, make sure you have development tools installed. The most straightforward way to do this is the following command:

$ sudo yum groupinstall "Development Tools"

In addition, you will want the following packages:

$ sudo yum install rpm-build rpm-macros-rpmforge spectool yum-utils

Finally, set up your environment such that you can build RPMs as a non-root user. Russ Herrold has written a detailed guide; the parts relevant to this step are parts 2, 3, and 4. For the rest of this document, I will assume that you have set up your build directories as directed by Russ.

Download the package to be rebuilt

Determine whether this package is a brand new, never-before-built package (as in the first example at the top of the page) or whether you are rebuilding an existing package (as in the second example). If you are rebuilding an existing package, the process is easier, since you will have access to an SRPM; if you are rebuilding a brand new package, all you will have is the specfile.

Rebuilding a SRPM

Browse to http://packages.sw.be/ and download the SRPM for the desired package version. SRPMs are packages with names ending in .src.rpm.

Once you have downloaded the SRPM, make sure you have all the necessary dependencies to build it:

$ sudo yum-builddep <package>.src.rpm 

This process can take some time; if you find that there are dependencies that cannot be met, you may have to manually rebuild those packages as well.

Once you have the SRPM and all its dependencies installed, run the following command:

$ rpmbuild --rebuild <package>.src.rpm 

You will see a lot of output; if the process completes successfully, you will see that among the last of the status messages are lines telling you where rpmbuild has put your newly build RPMs. Here is an example from a build of the rabbitvcs package:

...
Checking for unpackaged file(s): /usr/lib/rpm/check-files /tmp/rpmbuild/rabbitvcs-0.13.3-1.el5-root
Wrote: /home/shuff/rpmbuild/SRPMS/rabbitvcs-0.13.3-1.el5.src.rpm
Wrote: /home/shuff/rpmbuild/RPMS/i386/rabbitvcs-0.13.3-1.el5.i386.rpm
Wrote: /home/shuff/rpmbuild/RPMS/i386/rabbitvcs-nautilus-0.13.3-1.el5.i386.rpm
Wrote: /home/shuff/rpmbuild/RPMS/i386/rabbitvcs-gedit-0.13.3-1.el5.i386.rpm
Wrote: /home/shuff/rpmbuild/RPMS/i386/rabbitvcs-debuginfo-0.13.3-1.el5.i386.rpm
Executing(%clean): /bin/sh -e /tmp/rpmbuild/rpm-tmp.40244
+ umask 022
+ cd /home/shuff/rpmbuild/BUILD
+ cd rabbitvcs-0.13.3
+ /bin/rm -rf /tmp/rpmbuild/rabbitvcs-0.13.3-1.el5-root
+ exit 0

As you can see, the successful conclusion of this process has dumped a new SRPM and several binary RPMs into the appropriate places in my build tree. At this point, you are all set; just install the newly built RPM.

Rebuilding from a specfile

If there is no SRPM available, you will need to find the specfile for the package. To do this, browse the RepoForge repository, e.g.

https://github.com/repoforge/rpms/blob/master/specs/<package name>/ 

Download the specfile (.spec) and any included patch files, and put them in the SOURCES directory inside your RPM build tree.

Next, download the source tarball for the package, as follows:

$ cd ~/rpmbuild/SOURCES
$ spectool -g -R <package name>.spec

You should see one or more source tarballs being downloaded.

Finally, try to build the package from the specfile:

$ rpmbuild -ba <package name>.spec 

If rpm complains about unmet dependencies, use yum to install them; unfortunately, you cannot use yum-builddep to automate the process when building from a specfile.

From here on, the process is the same as when rebuilding a SRPM.

RPMForge——Quick Start build system的更多相关文章

  1. sublime text 配置 builder [build system]

    有时候需要用运行一段 PHP 代码,比如测试某个函数返回值等等,如果启动 Http Server,再打开浏览器,那黄花菜都凉了.我们可以在 Sublime Text 3 中创建 PHP 的 build ...

  2. Android Build System

    归类一些Android build system 相关的知识. http://elinux.org/Android_Build_System make <local_module> - m ...

  3. Gradle: The New Android Build System

    Gradle: The New Android Build System Google selected Gradle as the foundation of the Android SDK bui ...

  4. Android uiautomator gradle build system

    This will guide you through the steps to write your first uiautomator test using gradle as it build ...

  5. lua语言入门之Sublime Text设置lua的Build System

    转自: http://blog.csdn.net/wangbin_jxust/article/details/8911956 最近开始学习LUA语言,使用Sublime Text作为编辑器,不得不说, ...

  6. 【转】Android ROM研究---Android build system增加模块

    原文网址:http://hualang.iteye.com/blog/1141315 Android build system就是编译系统的意思 在我们需要向自己编译的源代码中增加模块的时候,需要一些 ...

  7. The Contiki build system 编译系统

    The Contiki build system======================== The Contiki build system is designed to make it eas ...

  8. Sublime Text 2 新建C++ build system

    首先要有个MinGW(我这里借用ceemple的编译器 ,mingw32) 设置环境变量 右击我的电脑,点属性->高级->环境变量. 在系统环境变量在PATH里加入D:\Ceemple\m ...

  9. sublime C++ build system配置体验

    近期准备实习,于是终于步入了sublime的阵营,sublime确实性感. 在配置win7下C++编译运行集成环境的时候遇到点问题,于是接触了一下JSON格式,最后终于自己搞定了.. 参考文档:htt ...

随机推荐

  1. JSP实现数据库(MySQL)查询——Java Web练习(二)

    1.创建数据库表student(数据库test01) 2.修改success.jsp页面,修改后的页面整体代码如下: <%@ page language="java" imp ...

  2. 常用对象API、附加:集合补充

    基本数据类型对象包装类: 为了方便操作基本数据类型值,将其封装成了对象,在对象中定义了属性和行为丰富了该数据的操作. 用于描述该对象的类就称为基本数据类型对象包装类. byte——Byte short ...

  3. JavaScript- 省市联动代码

    以下是JS省市联动菜单代码: 代码一: <html> <head> <title></title> <script language=" ...

  4. Linux的文件属性

    在Linux中,文件的拥有者可以将文件的属性设置成三种属性,可读(r).可写(w)和可执行(x).文件又分为三个不同的用户级别,文件的拥有者(u),文件的所属组(g),其他用户(o). 第一个字符显示 ...

  5. GWT 实现文件上传和下载

    首先下载两个包 commons-fileupload-?.jar和commons-io-?.jar  将他们配置到你的项目中 先把它们放在 "项目名/war/WEB-INF/lib" ...

  6. 【转】Android异常:that was originally added here

    ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 02-19 15:08:02.228: E/WindowManager(22172): Activity  ...

  7. POJ 1185 炮兵

    是中国标题.大家都说水问题.但是,良好的1A它? 标题效果: 给出n*m的矩阵,当某个单元格有炮兵部队时它的上下左右两格(不包含斜着的方向)是这支部队的攻击范围.问在两支部队之间不可能相互攻击到的情况 ...

  8. Hadoop-2.2.0中文文档—— Common - 服务层认证

    目的 此文档描写叙述了怎样为Hadoop配置和管理 Service Level Authorization . 预备条件 确保已经安装Hadoop,配置和设置都正确了. 很多其它细节,请看:* 首次使 ...

  9. App升级时数据库的迁移更新

    前一段时间在进行App升级的时候,由于一开始版本初期没有考虑完善,导致走了很多弯路,后来经过自己的一些思考,总结出了一些在app升级的时候,数据库内文件同步保持更新的经验,希望能给大家带来帮助. 总体 ...

  10. Java基础知识强化之网络编程笔记06:TCP之TCP协议发送数据 和 接收数据

    1. TCP协议发送数据 和 接收数据 TCP协议接收数据:• 创建接收端的Socket对象• 监听客户端连接.返回一个对应的Socket对象• 获取输入流,读取数据显示在控制台• 释放资源 TCP协 ...