在linux下的包管理系统很多,有rpm,deb等。但这两个包管理工具的使用相对windows都比较复杂。makeself是一个小巧的shell工具,它将你的程序打成一个可执行的shell包,安装更加容易方便。
- $ makeself --help
- Usage: /usr/bin/makeself [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
- --gzip : Compress using gzip (default if detected)
- --bzip2 : Compress using bzip2 instead of gzip
- --compress : Compress using the UNIX 'compress' command
- --nocomp : Do not compress the data
- --notemp : The archive will create archive_dir in the
- current directory and uncompress in ./archive_dir
- --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
- --current : Files will be extracted to the current directory.
- Implies --notemp.
- --nomd5 : Don't calculate an MD5 for archive
- --nocrc : Don't calculate a CRC for archive
- --header file : Specify location of the header script
- --follow : Follow the symlinks in the archive
- --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
- Do not forget to give a fully qualified startup script name
- (i.e. with a ./ prefix if inside the archive).
比如我们将example目录下的程序打包
- $ makeself example example.sh test-makeself ./example/setup.sh
包打好后
- $ chmod a+x example.sh
- $ ./example.sh --help
可以看到如何列出(list)包中的文件,解压(--target)包中的文件到某特定目录等
- $ ./example.sh --info ## 打印和该软件包相关的信息
- $ ./example.sh --list ## 列出包中所有文件
- $ ./example.sh --target example.new --keep ## 解压到example.new目录并安装,安装完成后不删除该目录
相关连接:
阅读(965) | 评论(0) | 转发(0) |