如何将debian社区的软件包添加到deepin社区

如何将debian社区的软件包添加到deepin社区

  1. 首先选取相比与debian仓库,deepin仓库中缺少的软件包

    https://ci.deepin.com/repo/deepin/deepin-ports/deb/pkg-list.txt

    从中挑选一个自己喜欢的软件包进行接下来的操作

  2. 在debian社区中找到对应的软件包

    Debian -- Packages

    选择bookworm类型,一般而言选择该版本

  3. 将源代码下载到本地

    ling@ling-PC:~/shixi/bao/12-rust-tempfile$ dget http://deb.debian.org/debian/pool/main/r/rust-tempfile/rust-tempfile_3.3.0-1.dsc

  4. 解压文件

    ling@ling-PC:~/shixi/bao/12-rust-tempfile$ dpkg-source -x rust-tempfile_3.3.0-1.dsc 

    注意:此时应该将解压后的文件夹另存到本地,因为此后需要上传的是源码,但我们接下来的编译等操作会将源文件污染

  5. 切换deepin的源

    换源:
    $ vim /etc/apt/sources.list
    ​
    ​
    添加如下链接
    deb [trusted=yes] https://ci.deepin.com/repo/obs/deepin:/Develop:/main/standard/ ./
    deb-src [trusted=yes] https://ci.deepin.com/repo/obs/deepin:/Develop:/main/standard/ ./
    deb [trusted=yes] https://ci.deepin.com/repo/obs/deepin:/Develop:/community/deepin_develop/ ./
    deb-src [trusted=yes] https://ci.deepin.com/repo/obs/deepin:/Develop:/community/deepin_develop/ ./
    deb [trusted=yes] https://ci.deepin.com/repo/obs/deepin:/Develop:/dde/deepin_develop/ ./
    deb-src [trusted=yes] https://ci.deepin.com/repo/obs/deepin:/Develop:/dde/deepin_develop/ ./
    其余均可注释掉
    ​
    $ sudo apt update 

  6. 进入源代码文件,测试缺少的依赖

    ling@ling-PC:~/shixi/bao/12-rust-tempfile/rust-tempfile-3.3.0$ sudo apt build-dep .

    如果缺少依赖,如下图,进入7

    如果不缺少依赖,那么直接打包安装

    注意:仍旧需要保留源代码,只要是从debian社区下载的,都需要上传到deepin

    ling@ling-PC:~/shixi/bao/17-rust-num-cpus/rust-num-cpus-1.14.0$ dpkg-buildpackage -us -nc

    打包成功后,会在上层目录生成deb文件,安装即可

  7. 首先将目标软件包缺少的依赖做好记录

    这很重要,因为很有可能依赖依旧需要依赖,不断迭代,为了方便以后查找,就需要列出表格

    此时rust-tempfile 就缺少2个软件包

    注意:有的时候,由于版本等问题,缺少的依赖也有可能在deepin社区已经有对应的仓库了,此时我们需要对上述两个软件包进行验证,去掉在社区也有的仓库

    例如:deepin-community · GitHub 中,能够搜索到“rust-cfg-if”这个仓库,然后在debian/control 文件里查看provides,如果有对应的包,那么所以就可以不用再去debian社区下载,上图中展示为标黄的部分

     

  8. 将缺少的包重复上述过程

    此时,缺少的包我们要重复以上过程去debian社区中下载,再测试是否缺少依赖,直到保证所有依赖的最终子节点为不缺少依赖

    标黄为deepin社区中存在的,灰色代表可以正常构建(不考虑deepin社区的包的情况下)

  9. 接下来,如果是团队合作,就需要在表格中标注自己的issue​​​​​​​

  10. 向团队管理员提出构建仓库请求

    1. fork manager仓库,克隆到本地​​​​​​​

    2. 准备好建库说明

      用于修改repos.yml文件
      - repo: golang-github-go-macaron-toolbox   /* 仓库名称 */
          group: deepin-sysdev-team           /* 建库者(一般管理者会限定) */
          info: Rhealth check, pprof, profile and statistic services for Macaron      /* 在源码/debian/control文件中的description 部分 */
          
          
      用于建库 git commit 时的描述,参照上述信息
      feat: add golang-github-go-macaron-toolbox
      ​
      Rhealth check, pprof, profile and statistic services for Macaron
      ​
      Log: golang-github-go-macaron-toolbox would be added.
      ​
      Issue: 
          https://github.com/deepin-community/sig-deepin-sysdev-team/issues/302      /* 这个就是第九步建立的issue链接 */
          
          
          
          
          
      用于提交源码 git commit 时的描述,参照上述信息
      feat: add golang-github-go-macaron-toolbox SRC
      ​
      Rhealth check, pprof, profile and statistic services for Macaron
      ​
      Log: golang-github-go-macaron-toolbox SRC would be added.
      ​
      Issue: 
          https://github.com/deepin-community/sig-deepin-sysdev-team/issues/302      /* 这个就是第九步建立的issue链接 */
    3. 提交建库申请

      //从添加上游库
      git remote add upstream
      ​
      // 查看是否有权限上传或下载
      ling@ling-PC:~/shixi/manager/Repository-Manager$ git remote -v
      origin  git@github.com:AKUN001-HI/Repository-Manager.git (fetch)
      origin  git@github.com:AKUN001-HI/Repository-Manager.git (push)
      upstream        git@github.com:deepin-community/Repository-Manager.git (fetch)
      upstream        git@github.com:deepin-community/Repository-Manager.git (push)
      ​
      // 更新信息到本地
      git log  找到稍前的提交信息对应的hash码
      git reset 14856407479b  --hard       目的是防止冲突
      git pull upstream master   更新到最新的上游仓库
      ​
      修改repos.yml文件,再上传
      git add .
      git commit
      git push -f
      ​
      在自己github上克隆的manager仓库提出pr,等待管理员检查即可
      ​
      ​
      ​
  11. 仓库申请之后在本地修改从debian下载的源码文件,再上传

    注意!!要用没有编译过的,从debian社区直接下载下来的源码

    1. fork申请后的仓库,克隆到本地

    2. 源码目录进行删除补丁操作   quilt pop -af

    3. 将克隆的新仓库中的debian/deepin 目录复制到 源码 的debian/ 目录下

    4. 将源码的除 .pc .github 外的文件全部复制到新仓库中,其中要覆盖掉新仓库中的README.md 文件和 debian目录,若源码本身没有README.md文件,那么直接修改原本的文件

    5. 上传,提出pr即可

      上传的时候,commit的描述格式在上面 10.2

    注意:提交源码之后,进行obs检查,一般而言如果报错,都是缺少相应的软件包

    1. 可能是自己提交的依赖包还未被合并到上游仓库

    2. 合并了,但是该包还没有被构建到obs检测系统中

    3. 仓库名可能写错了

    4. 上传了编译后的代码

第一次发文章,在格式和内容上可能有诸多问题,请见谅。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值