`
nathan.wu
  • 浏览: 48779 次
  • 性别: Icon_minigender_1
  • 来自: 南京
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

how to rebuild a Debian / Ubuntu package

阅读更多
Q. I'd like to rebuild a Debian / Ubuntu package called foo with additional option. How do I recompile .deb packages?

A. To build a Debian package, you need the following packages / software installed on system
[a] fakeroot : fakeroot package - runs a command in an environment wherein it appears to have root privileges for file manipulation. This is useful for allowing users to create archives (tar, ar, .deb etc.) with files in them with root permissions/ownership.

[b] dpkg-dev : package building tools for Debian

[c] Development environment - You need gcc, make and all other compiler collection installed on system. Under Debian / Ubuntu package build-essential takes care of everything.
Step #1: Install required packages

Type the following command
$ sudo apt-get install build-essential fakeroot dpkg-dev
Step #2: Install source code package

First, create a directory to store source package, enter:
$ mkdir build
$ cd build
Use apt-get command to install source code for a package called foo
$ sudo apt-get source foo
Install all build-dependencies, enter:
$ sudo apt-get build-dep foo
Unpacks Debian / Ubuntu source archives with Debian source package (.dsc) manipulation tool, enter:
$ dpkg-source -x foo_version-revision.dsc
To just compile the package, you need cd into foo-version directory and issue the command
$ dpkg-buildpackage -rfakeroot -b
If you want to pass custom additonal options to configure, you can set up the DEB_BUILD_OPTIONS environment variable. For instance, if you want pass option called --enable-radio --enable-gui, enter:
$ DEB_BUILD_OPTIONS="--enable-gui --enable-radio" fakeroot debian/rules binary
You can also pass some variables to the Makefile. For example, if you want to compile with gcc v3.4, enter:
$ CC=gcc-3.4 DEB_BUILD_OPTIONS="--enable-gui --enable-radio" fakeroot debian/rules binary
A complete example - mplayer

Let us see how to rebuild mplayer media player package with --enable-radio --disable-ivt options:
# sudo apt-get source mplayer
# sudo apt-get build-dep mplayer
# dpkg-source -x mplayer_version-revision.dsc
# DEB_BUILD_OPTIONS="--enable-gui --enable-radio --disable-ivt" fakeroot debian/rules binary
Now wait for some time as compile procedure going to take its own time. To install the newly-built package, enter:
# dpkg -i ../mplayer_version-revision_arch.deb
分享到:
评论

相关推荐

    ubuntu编译安装.txt

    根据提供的文件信息,本文将详细解析与Ubuntu系统配置、Android资源编译以及开发环境搭建相关的知识点。 ### Ubuntu系统源配置 在进行任何Android资源编译之前,确保Ubuntu系统的软件源配置正确是至关重要的一步。...

    debian维护人员手册

    - 第6章:指导如何使用Debian工具链进行软件包构建,包括`qr{rebuild`、`O¤rebuild`、`debuild`、`dpatch`和`orig.tar.gz`的使用。 - 第7章:介绍软件包验证和调试工具,如`lintian`、`mc`、`debdiff`、`...

    KsDumper_rebuild_Kernel_

    Kernelmode dumperFeatures Dump any process main module using a kernel driver (both x86 and x64) Rebuild PE32/PE64 header and sections Works on protected system processes & processes with stripped ...

    opencv3.2.0_vs2012

    D:\opencv_rebuild\msvc2012_86\include D:\opencv_rebuild\msvc2012_86\include\opencv D:\opencv_rebuild\msvc2012_86\include\opencv2 库目录: D:\opencv_rebuild\msvc2012_86\x86\vc11\lib 附加依赖库: opencv...

    rebuild_db-1.0-rc1.zip

    Ubuntu是基于Debian的开源操作系统,广泛应用于个人电脑和服务器。因此,`rebuild_db-1.0-rc1.zip`可能是专为Ubuntu优化的Adobe Air安装解决方案。 压缩包内的文件列表如下: 1. `rebuild_db.exe`:这是一个Windows...

    SQL置疑REPAIR_REBUILD修复

    SQL Server 修复工具 REPAIR_REBUILD SQL Server 是一个复杂的关系数据库管理系统,它提供了强大的数据存储和管理功能。但是,当 SQL Server 遇到 I/O 错误、磁盘问题或其他错误时,数据库可能会损坏,导致数据丢失...

    sbt in Action(Manning,2015)

    and with sbt’s unique incremental compilation feature, you can update only the parts of your project that change, without having to rebuild everything. Mastering sbt, along with the right patterns ...

    DELL_服务器硬盘掉线后的REBUILD修复操作全过程

    ### DELL服务器硬盘掉线后的REBUILD修复操作详解 在企业级服务器运维中,RAID技术作为数据冗余和性能提升的重要手段,被广泛应用。然而,在长时间运行或遇到突发状况时,服务器硬盘可能会出现故障,导致RAID阵列...

    DelphiSpeedUpV16

    Do you want to rebuild?" dialog that appears if you have accidentally changed a file while debugging the application. === How to install === Simply start the InstallDelphiSpeedUpX.exe where X is ...

    apktool documentation

    This retains the apk is nearly original format, but will make rebuild more than likely not work due to ignoring the changes that newer aapt requires After [d]ecode, there will be new folders ...

    node_xslt:一个简单的针对节点的XSLT插件

    在根目录中,运行node-gyp rebuild ./build/Release/node_xslt.node node-gyp rebuild生成./build/Release/node_xslt.node 然后: var xslt = require ( 'node_xslt' ) 要求 (基于Debian的发行版的libxml2-dev...

    rebuild-CRM-ERP-库存生产管理系统.zip

    开始使用 REBUILD 非常简单,不需要配置复杂的运行环境,零依赖快速部署,超简单! 1. 使用已发布版本 生产环境强烈推荐使用此方式 !!! 首先 下载 安装包,我们同时提供 standalone 与 boot 两种安装包。...

    ubuntu终端命令大全

    * src.rpm 的安装需要使用 rpmbuild 命令加上 –rebuild 参数,如 rpmbuild –rebuild *.src.rpm,然后在/usr/src/下找到 FC3 下 iso 程序安装:system-config-packages –isodir=iso 所在目录 RH 下 iso 程序安装:...

    electron-rebuild:用于针对当前安装的Electron版本重建本机Node.js模块的软件包

    使用--save-dev安装软件包: npm install --save-dev electron-rebuild 然后,每当您安装新的npm软件包时,请重新运行electron-rebuild: $( npm bin ) /electron-rebuild 或者,如果您使用的是Windows: ....

    Solar Board Rebuild on TI part4

    Solar Board Rebuild on TI part4

    generate_descriptor_proto.rar_rebuild

    This script is used to rebuild the Linux 32-bit cross-toolchain that allows you to generate 32-bit binaries that target Ubuntu 8.04.

    W589_Rebuild_Tool.exe

    W589_Rebuild_Tool.exe

    linux.chm文档

    10}t${Package}n' | sort -k1,1n 以大小为依据显示已安装的deb包所使用的空间 (ubuntu, debian类系统) 返回顶部索引 ^ 用户和群组 groupadd group_name 创建一个新用户组 groupdel group_name 删除一个用户组 ...

    通过弗里曼链码算法提取图像边界

    里面有代码和数据集I = imread('coins.png');...% Example II : how to rebuild the boundary image from the boundary coordinates vectorbound_img2 = zeros(size(I));for k = 1:numel(bound_coord)

    REBUILD 通过创新的业务流程引擎帮助你快速搭建各类企业管理系统,全图形化配置无需了解技术

    高度可配置化的企业管理系统!可免费商用!...REBUILD 侧重于业务需求实现,而非基础技术框架或项目启动模板,通过 REBUILD 可以真正实现零代码快速搭建!无需编程、无需编译代码,甚至无需了解任何技术。

Global site tag (gtag.js) - Google Analytics