首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Debian包规则文件:Debian似乎没有像预期的那样被调用

Debian包规则文件:Debian似乎没有像预期的那样被调用
EN

Unix & Linux用户
提问于 2022-09-26 09:26:51
回答 1查看 138关注 0票数 1

我想使用debhelper和dh_installsystemd安装一个系统单元。

我的控制文件:

代码语言:javascript
复制
Package: prometheus-wireguard-exporter
Version: 3.6.3-###CI_JOB_ID###
Maintainer: Ronny Forberger
Architecture: amd64
Build-Depends: debhelper, dh-systemd (>= 1.5)
Description: Prometheus Wireguard Exporter

我的规则档案:

代码语言:javascript
复制
#!/usr/bin/make -f
export DH_VERBOSE = 1

%:
        dh $@ --with systemd

override_dh_installsystemd:
        dh_installsystemd --name=prometheus-wireguard-exporter

目录树:

代码语言:javascript
复制
prometheus_wireguard_exporter_amd64
├── debian -> DEBIAN
└── DEBIAN
    ├── control
    ├── postinst
    ├── prometheus-wireguard-exporter.prometheus-wireguard-exporter.service -> prometheus-wireguard-exporter.service
    ├── prometheus-wireguard-exporter.service
    └── rules

2 directories, 5 files

我的后记:

代码语言:javascript
复制
#!/bin/sh
set -e

# source debconf library
. /usr/share/debconf/confmodule

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

db_stop

exit 0

我用dpkg-deb --build --root-owner-group -v prometheus_wireguard_exporter_amd64构建这个包

postinst脚本运行,但似乎没有调用debhelper。

有人知道是怎么回事吗?

EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2022-09-26 09:42:28

如果要从debhelper中受益,则需要从源包构建,而不是直接构建二进制包:

  • debian符号链接删除到DEBIAN
  • DEBIAN重命名为debian
  • prometheus_wireguard_exporter_amd64重命名为prometheus-wireguard-exporter
  • 添加一个debian/changelog文件(dch --create)
  • 使用dpkg-buildpackage (dpkg-buildpackage -us -uc)构建包
票数 2
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/718729

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档