提交ukylin打包指南.md

This commit is contained in:
luoyaoming 2022-01-12 11:16:33 +08:00
parent d50ab9f354
commit ab24c7dd49
1 changed files with 23 additions and 23 deletions

View File

@ -106,21 +106,21 @@ ukylin遵循Upstream First原则。
对于下面这样的上游源代码示例,我们在这里给出使用 **debmake** 处理时一些典型的
multiarch 软件包拆分的场景和做法:
- 一个软件库源码 *libfoo-1.0***.tar.gz**
- 一个软件库源码 *libfoo-1.0*\*\*.tar.gz\*\*
- 一个软件工具源码 *bar-1.0***.tar.gz**,软件由编译型语言编写
- 一个软件工具源码 *bar-1.0*\*\*.tar.gz\*\*,软件由编译型语言编写
- 一个软件工具源码 *baz-1.0***.tar.gz**,软件由解释型语言编写
- 一个软件工具源码 *baz-1.0*\*\*.tar.gz\*\*,软件由解释型语言编写
| 二进制软件包 | 类型 | Architecture: | Multi-Arch: | 软件包内容 |
|------------------|----------|-----------------|--------------|------------------------------------------|
| lib foo1 | lib \* | any | same | 共享库,可共同安装 |
| lib foo -dev | dev \* | any | same | 共享库头文件及相关开发文件,可共同安装 |
| lib foo -tools | bin \* | any | foreign | 运行时支持程序,不可共同安装 |
| lib foo -doc | doc \* | all | foreign | 共享库文档 |
| bar | bin \* | any | foreign | 编译好的程序文件,不可共同安装 |
| bar -doc | doc \* | all | foreign | 程序的配套文档文件 |
| baz | script | all | foreign | 解释型程序文件 |
| 二进制软件包 | 类型 | Architecture: | Multi-Arch: | 软件包内容 |
|----------------|--------|---------------|-------------|----------------------------------------|
| lib foo1 | lib \* | any | same | 共享库,可共同安装 |
| lib foo -dev | dev \* | any | same | 共享库头文件及相关开发文件,可共同安装 |
| lib foo -tools | bin \* | any | foreign | 运行时支持程序,不可共同安装 |
| lib foo -doc | doc \* | all | foreign | 共享库文档 |
| bar | bin \* | any | foreign | 编译好的程序文件,不可共同安装 |
| bar -doc | doc \* | all | foreign | 程序的配套文档文件 |
| baz | script | all | foreign | 解释型程序文件 |
**3. 打包验证**
@ -202,7 +202,7 @@ check自测用例通过。
- 为所有二进制软件包在 **debian/control** 文件中创建对应的二进制软件包条目。
- 在对应的 **debian/***二进制软件包名***.install** 文件中列出所有文件的路径
- 在对应的 **debian/二进制软件包名.install** 文件中列出所有文件的路径
**4.4. 命名规则**
@ -298,14 +298,14 @@ ukylin 修订版本(**-r** [0-9][+.\~a-z0-9A-Z]\*
- **debian/rules**
脚本重新封装了上游的构建系统,用来编译源码文件,将文件安装至
**\$(DESTDIR)**并将生成的文件存入各个 **deb** 二进制包文件中的目的。
\*\*\$(DESTDIR)\*\*并将生成的文件存入各个 **deb** 二进制包文件中的目的。
- 通过添加合适的 **override_dh\_**\*
目标target并编写对应的规则可以实现对 **debian/rules** 脚本的灵活定制。
- 如果需要在 **dh** 命令调用某些特定的 **dh\_***foo*
- 如果需要在 **dh** 命令调用某些特定的 \*\*dh_\*\**foo*
命令时采取某些特别的操作,则任何自动执行的操作均可以被 **debian/rules**
中额外添加的 **override_dh\_***foo* 这样的 Makefile 目标所覆写。
中额外添加的 \*\*override_dh_\*\**foo* 这样的 Makefile 目标所覆写。
- 不要嵌入基于系统时间的时间戳。
@ -316,7 +316,7 @@ ukylin 修订版本(**-r** [0-9][+.\~a-z0-9A-Z]\*
- 对上游源代码中使用的时间戳,使用 debhelper 提供的环境变量
**\$SOURCE_DATE_EPOCH** 的值。
1. **一个例子**
**5. 打包规范**
**5.1. 总体流程**
@ -429,8 +429,8 @@ ukylin 修订版本(**-r** [0-9][+.\~a-z0-9A-Z]\*
**debian/rules维护者版本.**
| Bash \$ vim debhello-0.0/debian/rules ... hack, hack, hack, ... \$ cat debhello-0.0/debian/rules \#!/usr/bin/make -f export DH_VERBOSE = 1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed %: dh \$@ override_dh_auto_install: dh_auto_install -- prefix=/usr |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| \$ vim debhello-0.0/debian/rules ... hack, hack, hack, ... \$ cat debhello-0.0/debian/rules \#!/usr/bin/make -f export DH_VERBOSE = 1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed %: dh \$@ override_dh_auto_install: dh_auto_install -- prefix=/usr |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
如上在 **debian/rules** 文件中导出=**DH_VERBOSE** 环境变量可以强制 **debhelper**
工具输出细粒度的构建报告。
@ -453,8 +453,8 @@ DESTDIR=debian/debhello prefix=/usr**”。
**debian/control维护者版本.**
| Bash \$ vim debhello-0.0/debian/control ... hack, hack, hack, ... \$ cat debhello-0.0/debian/control Source: debhello Section: devel Priority: optional Maintainer: Osamu Aoki \<osamu@debian.org\> Build-Depends: debhelper-compat (= 13) Standards-Version: 4.5.1 Homepage: https://salsa.debian.org/debian/debmake-doc Rules-Requires-Root: no Package: debhello Architecture: any Multi-Arch: foreign Depends: \${misc:Depends}, \${shlibs:Depends} Description: Simple packaging example for debmake This Debian binary package is an example package. (This is an example only) |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| \$ vim debhello-0.0/debian/control ... hack, hack, hack, ... \$ cat debhello-0.0/debian/control Source: debhello Section: devel Priority: optional Maintainer: Osamu Aoki \<osamu@debian.org\> Build-Depends: debhelper-compat (= 13) Standards-Version: 4.5.1 Homepage: <https://salsa.debian.org/debian/debmake-doc> Rules-Requires-Root: no Package: debhello Architecture: any Multi-Arch: foreign Depends: \${misc:Depends}, \${shlibs:Depends} Description: Simple packaging example for debmake This Debian binary package is an example package. (This is an example only) |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
在 **debian/**
目录下还有一些其它的模板文件。根据具体场景,它们也需要进行更新。之后可以开始对软件包进行构建。
@ -466,8 +466,8 @@ DESTDIR=debian/debhello prefix=/usr**”。
**debhello 0.0 版使用 debuild 命令产生的文件:.**
| Bash \$ cd .. \$ tree -FL 1 . ├── debhello-0.0/ ├── debhello-0.0.tar.gz ├── debhello-dbgsym_0.0-1_amd64.deb ├── debhello_0.0-1.debian.tar.xz ├── debhello_0.0-1.dsc ├── debhello_0.0-1_amd64.build ├── debhello_0.0-1_amd64.buildinfo ├── debhello_0.0-1_amd64.changes ├── debhello_0.0-1_amd64.deb └── debhello_0.0.orig.tar.gz -\> debhello-0.0.tar.gz 1 directory, 9 files |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| \$ cd .. \$ tree -FL 1 . \|— debhello-0.0/ \|— debhello-0.0.tar.gz \|— debhello-dbgsym_0.0-1_amd64.deb \|— debhello_0.0-1.debian.tar.xz \|— debhello_0.0-1.dsc \|— debhello_0.0-1_amd64.build \|— debhello_0.0-1_amd64.buildinfo \|— debhello_0.0-1_amd64.changes \|— debhello_0.0-1_amd64.deb \|— debhello_0.0.orig.tar.gz -\> debhello-0.0.tar.gz 1 directory, 9 files |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
您可以看见生成的全部文件。