关键词:checkinstall、dpkg、deb/rpm、makeself等等。

checkinstall记录make install安装的文件,生成相应的(Slackware/RPM/Debian)安装包;安装后加入系统包数据库中,方便从系统中移除以及发布。

checkinstall从源码编译,生成一个可发行的安装包。

1. checkinstall

1.1 安装checkinstall

Ubuntu下安装checkinstall如下:

sudo apt install checkinstall

1.2 使用方法

checkinstall -h可以得到试用方法,对checkinstal生成安装包行为进行配置,同时对安装包信息进行设置。

最终生成Slackware/RPM/Debian安装包。

checkinstall 1.6., Copyright  Felipe Eduardo Sanchez Diaz Duran
This software is released under the GNU GPL. Usage: checkinstall [options] [command [command arguments]]
Options: *Package type selection* -t,--type=<slackware|rpm|debian> Choose packaging system
-S Build a Slackware package
-R Build a RPM package
-D Build a Debian package *Install options* --install=<yes|no> Toggle created package installation------------------默认会将执行一次make install,会将这些安装到系统中。no表示只生成安装包,不进行安装。
--fstrans=<yes|no> Enable/disable the filesystem translation code *Scripting options* -y, --default Accept default answers to all questions--------------对选项默认采取y。
--pkgname=<name> Set name---------------------------------------------安装包名称。
--pkgversion=<version> Set version------------------------------------------安装包版本号。
-A, --arch, --pkgarch=<arch> Set architecture
--pkgrelease=<release> Set release
--pkglicense=<license> Set license
--pkggroup=<group> Set software group
--pkgsource=<source> Set source location
--pkgaltsource=<altsource> Set alternate source location
--pakdir=<directory> The new package will be saved here
--maintainer=<email addr> The package maintainer (.deb)
--provides=<list> Features provided by this package
--requires=<list> Features required by this package
...

1.3 使用介绍

1.3.1 准备源码

checkinstall依赖于当前Makefile,需要Makefile支持make install命令。

获取hello-2.10.tar.gz然后解压,执行./configure即可获取checkinstall执行环境。

wget http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz

1.3.2 生成安装包

通过下面的命令模拟一次make install命令,然后生成hello-x.x-xxxxxxx_amd64.deb安装包。

sudo checkinstall -y  --backup=no --install=no --pkgname=hello --pkgversion=1.0 --pkgrelease=`date +"%Y%m%d%H"`  --pkggroup=XGroup --maintainer=lu.baoquan@intellif.com --provides=Intellif --pakdir .

1.3.3 使用安装包(Debian)

通过dpkg进行安装、删除、查看信息等。

sudo dpkg -i hello_1.-2019120614_amd64.deb
sudo dpkg -I hello_1.-2019120614_amd64.deb
sudo dpkg -r hello

参考文档:《How To Build Packages From Source Using CheckInstall》、《Checkinstall

2. makeself

makeself制作一个自解压的可执行包,生成的包类似一个脚本程序;在开头添加一些脚本,将一个目录中文件压缩,并指定一个执行脚本。

再运行可执行包的时候,首先将压缩目录解压到临时目录,然后执行指定脚本进行处理。

makefile详细介绍见https://makeself.io/

2.1 获取makeself工具

git clone https://github.com/megastep/makeself.git

2.2 使用makeself

makeself的使用选项较多,但是使用./makeself.sh archive/ runtime_installer.sh "SDK Installer" ./install.sh即可创建runtime_installer.sh可执行自解压包。

这个包的内容来自于archive目录,执行runtime_installer.sh的时候,主要是行archive目录中的install.sh脚本。

Usage: ./makeself.sh [params] archive_dir file_name label startup_script [args]
params can be one or more of the following :
--version | -v : Print out Makeself version number and exit
--help | -h : Print out this help message
--tar-quietly : Suppress verbose output from the tar command
--quiet | -q : Do not print any messages other than errors.
--gzip : Compress using gzip (default if detected)
--pigz : Compress with pigz
--bzip2 : Compress using bzip2 instead of gzip
--pbzip2 : Compress using pbzip2 instead of gzip
--xz : Compress using xz instead of gzip
--lzo : Compress using lzop instead of gzip
--lz4 : Compress using lz4 instead of gzip
--compress : Compress using the UNIX 'compress' command
--complevel lvl : Compression level for gzip pigz xz lzo lz4 bzip2 and pbzip2 (default )
--base64 : Instead of compressing, encode the data using base64
--gpg-encrypt : Instead of compressing, encrypt the data using GPG
--gpg-asymmetric-encrypt-sign
: Instead of compressing, asymmetrically encrypt and sign the data using GPG
--gpg-extra opt : Append more options to the gpg command line
--ssl-encrypt : Instead of compressing, encrypt the data using OpenSSL
--ssl-passwd pass : Use the given password to encrypt the data using OpenSSL
--ssl-pass-src src : Use the given src as the source of password to encrypt the data
using OpenSSL. See "PASS PHRASE ARGUMENTS" in man openssl.
If this option is not supplied, the user will be asked to enter
encryption password on the current terminal.
--ssl-no-md : Do not use "-md" option not supported by older OpenSSL.
--nochown : Do not give the target folder to the current user (default)
--chown : Give the target folder to the current user recursively
--nocomp : Do not compress the data
--notemp : The archive will create archive_dir in the
current directory and uncompress in ./archive_dir
--needroot : Check that the root user is extracting the archive before proceeding
--copy : Upon extraction, the archive will first copy itself to
a temporary directory
--append : Append more files to an existing Makeself archive
The label and startup scripts will then be ignored
--target dir : Extract directly to a target directory
directory path can be either absolute or relative
--nooverwrite : Do not extract the archive if the specified target directory exists
--current : Files will be extracted to the current directory
Both --current and --target imply --notemp
--tar-extra opt : Append more options to the tar command line
--untar-extra opt : Append more options to the during the extraction of the tar archive
--nomd5 : Don't calculate an MD5 for archive
--nocrc : Don't calculate a CRC for archive
--sha256 : Compute a SHA256 checksum for the archive
--header file : Specify location of the header script
--follow : Follow the symlinks in the archive
--noprogress : Do not show the progress during the decompression
--nox11 : Disable automatic spawn of a xterm
--nowait : Do not wait for user input after executing embedded
program from an xterm
--lsm file : LSM file describing the package
--license file : Append a license file
--help-header file : Add a header to the archive's --help output
--packaging-date date
: Use provided string as the packaging date
instead of the current date. --keep-umask : Keep the umask set to shell default, rather than overriding when executing self-extracting archive.
--export-conf : Export configuration variables to startup_script

2.3 使用自解压包

安装自解压包,直接运行./runtime_installer.sh即可。

如果要查看更多信息输入./runtime_installer.sh --help,可以查看自解压包的信息、文件列表、传递参数等等。

Makeself version 2.4.
) Getting help or info about ./runtime_installer.sh :
./runtime_installer.sh --help Print this message
./runtime_installer.sh --info Print embedded info : title, default target directory, embedded script ...
./runtime_installer.sh --lsm Print embedded lsm entry (or no LSM)
./runtime_installer.sh --list Print the list of files in the archive
./runtime_installer.sh --check Checks integrity of the archive ) Running ./runtime_installer.sh :
./runtime_installer.sh [options] [--] [additional arguments to embedded script]
with following options (in that order)
--confirm Ask before running embedded script
--quiet Do not print anything except error messages
--accept Accept the license
--noexec Do not run embedded script
--keep Do not erase target directory after running
the embedded script
--noprogress Do not show the progress during the decompression
--nox11 Do not spawn an xterm
--nochown Do not give the target folder to the current user
--chown Give the target folder to the current user recursively
--nodiskspace Do not check for available disk space
--target dir Extract directly to a target directory (absolute or relative)
This directory may undergo recursive chown (see --nochown).
--tar arg1 [arg2 ...] Access the contents of the archive through the tar command
--ssl-pass-src src Use the given src as the source of password to decrypt the data
using OpenSSL. See "PASS PHRASE ARGUMENTS" in man openssl.
Default is to prompt the user to enter decryption password
on the current terminal.
-- Following arguments will be passed to the embedded script

Linux安装包生成工具:checkinstall、makeself的更多相关文章

  1. 使用Setup Factory安装包制作工具制作安装包

    在我们开发完软件后,除了极个别案例我们把整个目录复制给客户用外,我们一般都需要做成安装包,方便整个软件的部署操作,以安装包的部署操作可能简单的是复制文件,也可能包括一些注册表.数据库等额外的操作,不过 ...

  2. 安装包制作工具 SetupFactory使用1 详解

    2014-11-19 Setup Factory 是一个强大的安装程序制作工具.提供了安装制作向导界面,即使你对安装制作不了解,也可以生成专业性质的安装程序.可建立快捷方式,也可直接在 Windows ...

  3. 安装包制作工具 SetupFactory 详解

    Setup Factory 是一个强大的安装程序制作工具.提供了安装制作向导界面,即使你对安装制作不了解,也可以生成专业性质的安装程序.可建立快捷方式,也可直接在 Windows 系统的注册表加入内容 ...

  4. Mac OS平台下应用程序安装包制作工具Packages的使用介绍

    一.介绍 Windows下面开发好的应用程序要进行分发时有很多打包工具可供选择,如Inno Setup, InstallShield, NSIS, Advanced Installer, Qt Ins ...

  5. Mac OS平台下应用程序安装包制作工具Packages的使用介绍(补充)

    上一篇:Mac OS平台下应用程序安装包制作工具Packages的使用介绍 补充说明 上一篇文章中介绍了如何使用Packages如何创建mac下的安装包.但是这样制作出来的安装包只能安装到系统的文件路 ...

  6. qt 安装包生成

    (Qt Installer Framework)程序简易打包教程 2017年06月19日 14:38:47 carman_风 阅读数:3559 标签: installerqt框架 更多 个人分类: 软 ...

  7. Navicat Premium 15 安装包&激活工具及安装教程(亲测可用)

    Navicat Premium 15 安装包及激活工具 网盘地址: 链接:https://pan.baidu.com/s/1GU9qgdG1dRCw9Un8H9Ba9A提取码:F1r9 开始安装 下载 ...

  8. CorelDRAW X8 如何破解激活(附国际版安装包+激活工具) 2016-12-15

    之前有位搞平面的好友“小瘦”说CDR X8无法破解,只能用X7.呃……呃……呃……好像是的 其实CDR8难激活主要在于一个点“没有离线激活了,只可以在线激活”,逆天不是专供逆向的,当然没能力去破解,这 ...

  9. Linux安装包

    关于SWT SWT首先要在Eclipse中添加SWT的安装包:Windowsbuilder Pro.下载路径:http://www.eclipse.org/windowbuilder/download ...

随机推荐

  1. DRF单表序列化和反序列化

    安装 djangorestframework pip install djangorestframework 将rest_framework注册到app上 INSTALLED_APPS = [ 're ...

  2. CSS 利用 `padding-bottom` 实现固定比例的容器

    复用 padding-bottom 可实现一块区域在窗口尺寸变化使始终保持自适应.对于响应式布局中的图片或视频来说比较有用. <div style="width: 100%; posi ...

  3. Leetcode 之 Mysql(day01)

    大四已经接近一半了,下学期就要准备找工作实习了.为了自己能找到一份比较满意的实习,今天开始要刷一下题目.今天就刷 MySQL 语言.以下就是我今天刷的题目.大家也可以去 leetcode 注册一个账号 ...

  4. latex 添加Bibtex 全解(使用TeXstudio)

    前提知识: 生成pdf的一般流程 在使用Latex之前,我们一般会借用已有的论文模板,在模板基础上加入我们自己的文章内容,随后编译成PDF文件,其基本流程就是:Latex->Bibtex-> ...

  5. 从0使用Ruby on Rails打造企业级RESTful API项目实战之我的云音乐

    本节对我们项目实现的功能和知识点做一个简单的介绍,因为是RESTful API项目,所以对于后端来说基本上没有什么UI界面可展示,那我们就在关键的点,使用客户端(Android)实现的效果图. 课程简 ...

  6. Zstack的安装部署

    ZStack是下一代开源的云计算IaaS(基础架构即服务)软件. 它主要面向的是未来的智能数据中心,通过提供全完善的API来管理包括计算.存储和网络在内的数据中心的各种资源.跟OpenStack相比, ...

  7. 拥抱自动化,CODING 2.0 持续集成全新上线

    在文章开始前,做一个小调查,在您的软件项目中集成一行新代码平均需要花多长时间? 15 分钟 一小时 半天 一天及以上 注意这里的集成是指将源码放在一起,并验证源码可以作为一个一致.运行可靠的软件的过程 ...

  8. linux添加磁盘分区做为swap分区

    在部署oracle时,根据内存的不同,会对swap分区大小有不同要求,具体参考https://www.cnblogs.com/chxmtl/p/11672053.html 下面为具体操作步骤. 1.新 ...

  9. 九、ITK-VTK混合编程--将序列dcm图像通过ITK读去并通过VTK显示出来

    一.初步介绍 上一个博客里面我记录了VTK的安装,以及相关的工程代码的构建,但是实际上上一个博客测试的代码的例子仅仅只是VTK程序的例子.而我实际上希望能够实现的是VTK和ITK混合编程. 在这里还是 ...

  10. 网页前端之CSS学习记录总结篇

    标签: 块级标签block:div, p, h1-h6, ul, ol,li, dl, dt, dd,table,tr等,独占一行,可以设置宽高,默认是父标签的100%:行内标签inline:a,sp ...