Astro-Lee / astro-lee.github.io

https://astro-lee.github.io/
0 stars 0 forks source link

Build deb package #1

Open Astro-Lee opened 2 months ago

Astro-Lee commented 2 months ago

本文介绍 deb 的构建方式

前期准备

创建GPG公钥和私钥

gpg --full-generate-key --expert
# 记住私钥的密码

image

gpg --armor --export GPG密钥ID

复制以 -----BEGIN PGP PUBLIC KEY BLOCK----- 开头并以 -----END PGP PUBLIC KEY BLOCK----- 结尾的 GPG 密钥。将内容提交到 keyserver

image

等待10分钟左右,进入 launchpadOpenPGP keys

image

运行一下命令获得fingerprint

gpg --fingerprint

image

将fingerprint填入OpenPGP keys

image

将以下内容写入到一个临时文件temp.txt中,并执行gpg -d temp.txt

image image image

设置环境变量

DEBMAIL="xxxx@gamil.com"
DEBFULLNAME="XXX"
DEBSIGN_KEYID="GPG密钥ID"
export DEBMAIL DEBFULLNAME DEBSIGN_KEYID
#DEBUILD_DPKG_BUILDPACKAGE_OPTS="-i -I -us -uc"
#DEBUILD_LINTIAN_OPTS="-i -I --show-overrides"

从项目源码构建

psfex-3.24.2.tar.gzpsfex-3.24.2

cd psfex-3.24.2
./autogen.sh && ./configure
dh_make -f ../psfex-3.24.2.tar.gz

修改debian目录中control, changelog和其他文件的内容

其中编辑debian/changelog image

dpkg-source --commit #修改过上游版本的源码,需要commit 
debuild -S -sa -k$DEBSIGN_KEYID | tee /tmp/debuild.log 2>&1 # 并输入签名的密码
dupload XXX.changes
dput -f ppa:ruizhi-li/XXXsoftware XXX.changes

参考