deb包制作
制作deb包
方法一:checkinstall
checkinstall的原理就是将make install的内容放到一个临时目录然后打包,只要能执行make install就能创建deb包,如果代码已经make install了,需要先执行make uninstall,不然会出现只打包库文件的软连接而没有打包库文件的情况。通过dpkg-deb -c可以查看deb包的文件是否正常。
- 设置打包环境
sudo apt-get install checkinstall
- 制作deb包
checkinstall make install
- 检查deb包
dpkg-deb -c XX.deb
方法二: dpkg-buildpackage
- 设置打包环境
$ sudo apt-get install -y dh-make dpkg-dev devscripts
- 创建控制文件
$ wget http://zlib.net/zlib-1.2.8.tar.gz
$ tar xzf zlib-1.2.8.tar.gz
# 命令将在当前目录下生成debian目录
$ dh_make --createorig --copyright gpl3 --email fwdssg@gmail.com --single
- 编辑debian/control
Source: zlib
Section: unknow
Priority: optional
Maintainer: ubuntu <fwdssg@gmail.com>
Build-Depends: debhelper (>=9),autotools-dev
Standards-Version: 3.9.6
Homepage: http://zlib.net/
#Vcs-Git: git://anonscm.debian.org/collab-maint/zlib.git
#Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/zlib.git
Package: zlib
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: <insert up to 60 chars description>
<insert long description, indented with spaces>
| 属性 | 说明 |
|---|---|
| Section | 软件的类别,常见的有utils、net、mail、text、x11等 |
| Architecture | 软件包结构,如基于i386、amd64、m68k、sparc、alpha、powerpc等 |
- 编辑debian/postinst.ex
# deb安装完成时需要执行的脚本
$ mv postinst.ex postinst
$ sed -i '/ configure)/a\ echo -e \"zlib deb test\" > $HOME/zlib.log' postinst
- 编辑debian/rules
# zlib比较特殊很多参数不支持,所以需要自定义configure,用--prefix=/usr/local会报错也是坑
echo -e "override_dh_auto_configure:\n\t./configure --prefix=/usr" >> rules
- 制作deb包
$ cd zlib-1.2.8
# 自己测试完就不签名-uc -us
$ dpkg-buildpackage -rfakeroot -tc -uc -us -b
- 检查deb包
dpkg-deb -c XX.deb
dpkg-buildpackage使用技巧
- 编辑rules文件添加
export DEB_BUILD_MAINT_OPTIONS = hardening=-all可以去掉编译时候自动添加的-Werror=XX参数
参考资料
从源码构建deb包
为现有的二进制文件制作deb包
官方文档
为Debian和Ubuntu制作软件包
构建软件包
官方文档
官方文档
官方文档
官方文档
Linux 的源码安装工具 CheckInstall
deb包制作的更多相关文章
- deb包制作(转)
deb 包已被广泛应用但是也在不断的更新,这里介绍Ubuntu deb包安装设置使用,帮助大家安装更新Ubuntu deb包系统.制作Ubuntu deb包的三种方法 | Sean's Blog [转 ...
- s3-sftp-proxy goreleaser rpm &&deb 包制作
上次写过简单的s3-sftp-proxy基于容器构建以及使用goreleaser构建跨平台二进制文件的,下边演示下关于 rpm&&deb 包的制作,我们只需要简单的配置就可以生成方便安 ...
- vigil deb 包制作
前边有写过简单rpm 包的制作,现在制作一个简单的deb 包. deb 包的制作是通过源码编译+ fpm 环境准备 rust curl https://sh.rustup.rs -sSf | sh 配 ...
- rpm和deb包制作和升级执行步骤
deb安装包升级和安装都是dpkg -i .deb命令,升级时直接覆盖安装新包安装步骤:1 preinst install2 postinst configure升级步骤:1 先执行旧包prerm u ...
- ubuntu 制作deb 包
ubuntu下打包制作deb安装包 http://www.th7.cn/system/lin/201406/61012.shtml 2014-06-22 20:16:45CSDN-yangbing ...
- deb包+软件图标+添加到系统菜单+举例安装卸载
本文介绍的内容和实验一下: 1. 制造deb包.2. 为了使软件图标.3. 开始菜单中添加到系统中的软件:4. 安装和卸载制作的deb包. 1. 制作deb包 制作deb包的方法可能有多种,本文使用的 ...
- 从源代码制作deb包的两种方法以及修改已有deb包(转载)
From:http://yysfire.github.io/linux/%E4%BB%8E%E6%BA%90%E4%BB%A3%E7%A0%81%E5%88%B6%E4%BD%9Cdeb%E5%8C% ...
- QT程序制作deb包并安装在应用程序菜单
制作原理:打包:将QT制作的源程序(没有编译的)用debian压缩打包(这里是用脚本对源程序再编译)安装:将deb包中的源程序解压(默认解压到根目录)到规定系统文件中并编译(postinst脚本)卸载 ...
- [deb]制作deb包
转自:http://www.cnblogs.com/Genesis-007/p/5219960.html 查看系统安装了哪些deb包: dpkg -l 打包: dpkg -b dir result.d ...
随机推荐
- mysql系列之9.mysql日志&存储引擎
mysqlbinlog 是什么? 数据目录下的如下文件: mysql-bin.xxxxxx 作用? 记录数据库内部增删改查对mysql数据库有更新的内容的记录 三种模式? statement leve ...
- 修正IE6中FIXED不能用的办法,转载
.fixed-top /* 头部固定 */{position:fixed;bottom:auto;top:0px;} .fixed-bottom /* 底部固定 */{position:fixed;b ...
- 利用wxpython显示OpenCV图像
核心代码 import wx, cv2 import numpy as np # Start with a numpy array style image I'll call "source ...
- web 全栈 学习 1 工程师成长思路图
第一部分: 技术的三个阶段 实现 ---> 借鉴 ---> 优化 实现:为了实现功能,不考虑可读性.借鉴:阅读开源代码,开源程序,学到编程思想.优化:可读性,可执行. 阶段一:实现多做事, ...
- 畅游HttpCore
欢迎 非常欢迎阅读本文,本文主要介绍HttpCore是如何工作的. 你应该知道HTTP是一种用于在客户端与服务端进行消息交换的协议.它使用的特别广泛,它通常运行在TCP/IP或者安全的TLS/SSL之 ...
- LVS与Keepalived
lvs与Nginx区别 LVS的负载能力强,因为其工作方式逻辑非常简单,仅进行请求分发,而且工作在网络的第4层,没有流量,所以其效率不需要有过多的忧虑. LVS基本能支持所有应用,因为工作在第4层,所 ...
- 虚拟化技术及ip netns简介
虚拟化技术: Iass:infrastructure as a server 直接启动一个虚拟机,需要什么程序自己安装 Paas:platform as a servicce 启动一个虚拟机,并安装了 ...
- 我的.emacs文件,用于C/C++及shell编程。
1. [代码]我的.emacs文件,用于C/C++及shell编程.;;我的配置;;1.基本配置;;外观配置***************;;禁用启动画面(setq inhibit-startup-m ...
- 监听输入框变化(oninput,onpropertychange,onchange)
oninput,onpropertychange,onchange: oninput是onpropertychange的非IE浏览器版本,支持firefox和opera等浏览器,但有一点不同,它绑定于 ...
- Linux下Fork与Exec
一.引言 对于没有接触过Unix/Linux操作系统的人来说,fork是最难理解的概念之一:它执行一次却返回两个值.fork函数是Unix系统最杰出的成就之一,它是七十年代UNIX早期的开发者经过长期 ...