Skip to content

A simple demo tool, show how to create deb packages

Notifications You must be signed in to change notification settings

getiot/hello-deb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hello-deb - Deb 包制作演示工具

这是一个简单的演示工具,用于展示如何制作 Ubuntu deb 安装包。

工具说明

hello-deb 是一个简单的 shell 脚本工具,它会:

  • 显示问候信息
  • 读取配置文件
  • 显示当前时间
  • 支持命令行参数

文件结构

hello-deb/
├── hello-deb          # 主可执行脚本
├── config.conf        # 配置文件
├── build-deb.sh       # deb 包构建脚本
├── debian/
│   └── control        # deb 包元数据文件
└── README.md          # 说明文档

快速开始

构建 deb 包

直接运行构建脚本:

./build-deb.sh

构建完成后,会生成 hello-deb_1.0-1.deb 文件。

安装

sudo dpkg -i hello-deb_1.0-1.deb

或者:

sudo apt install ./hello-deb_1.0-1.deb

使用

安装后,可以直接运行:

hello-deb

或者传入参数:

hello-deb "你的名字"

自定义配置

修改版本号

编辑 debian/control 文件,修改 Version 字段:

Version: 1.0.0

修改包信息

编辑 debian/control 文件,可以修改:

  • Package: 包名
  • Version: 版本号
  • Maintainer: 维护者信息
  • Description: 包描述

添加文件

如果需要添加更多文件到 deb 包中,编辑 build-deb.sh 脚本,在相应位置添加复制命令。

打包说明

这个工具的设计完全符合教程中描述的 deb 包结构:

  • 可执行文件放在 /usr/local/bin/
  • 资源文件放在 /usr/local/share/hello-deb/
  • 文档文件放在 /usr/share/doc/hello-deb/

非常适合用于学习和演示 deb 包的制作过程,也可以作为你开发新工具的模板。

About

A simple demo tool, show how to create deb packages

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages