From So
dh_installman works by reading the file debian/manpages, or debian/nameofyourpackage.manpages. This file has a list of paths pointing to the man pages of your package. The paths are relative to the root of your package. Here you have an example of a real package. Then, this program will properly install your man pages in the right directory.
So, to sum up, you only have to create the debian/package.manpages and fill it with the paths to your man pages. These paths have to be relative to the root of your package. If you, the packager, are writing the man pages, then they have to be placed in the Debian/ directory.
Hello Bo!
If you look when running sbuild/debuild, in the debian/python3-whey/usr/bin directory there is a binary called whey. When usptrem doesn’t give the manual on the command line, we have to.
In that case, you:
2.create a file called whey.txt with the manual.
follow this example here: https://salsa.debian.org/nilsonfsilva/cplay-ng/-/blob/debian/master/debian/manpage/cplay-ng.txt
Whey commands are available here: https://whey.readthedocs.io/en/latest/cli.html It’s just you adapt to whey.
https://mp.weixin.qq.com/s/4ysQbCH8W8ui6oOmDCeo0Q
三种层次的虚拟化: 1. 系统级别的; 2. 操作系统级别的; 3. 应用层次的
目前在修包过程中,经常会遇到需要升级的情况。目前来说,升级不是特别大的问题,反而在repack遇到了不小的阻扰,下面是一些总结。
过程:
等到有一个基本的雏形后,
filecheck (0.0.22-1) UNRELEASED; urgency=low
* Initial release. Closes: #nnnn
-- Bo YU <tsu.yubo@gmail.com> Fri, 22 Sep 2023 22:12:19 +0800
然后一直build,然后 lintian 可以报错:
filecheck source: source-is-missing [tests/integration/tools/FileCheck/FileCheck-8.0.1-Linux]
这个时候想办法排除:
1.
# cat d/watch
version=4
opts=\
repack,repacksuffix=+dfsg,\
compression=xz,\
filenamemangle=s/.*?(\d[\d\.-]*@ARCHIVE_EXT@)/FileCheck\.py-$1/ \
https://github.com/mull-project/FileCheck.py/tags .*/archive/.*/v?([\d\.]+).tar.gz
2. uscan --force-download --verbose
3. gbp import-orig --pristine-tar ../filecheck_0.0.23+dfsg.orig.tar.xz
What is the upstream version? [0.0.23+dfsg]
gbp:info: Importing '../filecheck_0.0.23+dfsg.orig.tar.xz' to branch 'upstream'...
gbp:info: Source package is filecheck
gbp:info: Upstream version is 0.0.23+dfsg
gbp:info: Replacing upstream source on 'debian/main'
gbp:info: Successfully imported version 0.0.23+dfsg of ../filecheck_0.0.23+dfsg.orig.tar.xz
(需要 gbp.conf 最好)
4. 这时候可以丢弃了upstream/xx 的tag,而直接使用 +dfsg 的upstream 分支
【解答问题】
W: filecheck source: debian-watch-not-mangling-version opts=repack,repacksuffix=+dfsg,compression=xz,filenamemangle=s/.*?(\d[\d\.-]*@ARCHIVE_EXT@)/FileCheck\.py-$1/ https://github.com/mull-project/FileCheck.py/tags .*/archive/.*/v?([\d\.]+).tar.gz [debian/watch:6]
这里可以使用的一个技巧是:如果遇到下载失败的问题,则可以提前把 orig tar包下载下来,然后 --force-download
即可。
...
$newfile = https://github.com/rems-project/linksem/archive/refs/tags/0.8.tar.gz
$newversion = 0.8
$lastversion = 0.8
uscan info: Matching target for downloadurlmangle: https://github.com/rems-project/linksem/archive/refs/tags/0.8.tar.gz
uscan info: Upstream URL(+tag) to download is identified as https://github.com/rems-project/linksem/archive/refs/tags/0.8.tar.gz
uscan info: Filename (filenamemangled) for downloaded file: 0.8.tar.gz
uscan info: Newest version of linksem on remote site is 0.8, local version is 0.8
(mangled local version is 0.8)
uscan info: => Package is up to date from:
=> https://github.com/rems-project/linksem/archive/refs/tags/0.8.tar.gz
uscan info: => Forcing download as requested
uscan info: New orig.tar.* tarball version (oversionmangled): 0.8
uscan info: Launch mk-origtargz with options:
--package linksem --version 0.8 --repack-suffix +dfsg --compression xz --directory .. --copyright-file debian/copyright ../0.8.tar.gz
Successfully repacked ../0.8.tar.gz as ../linksem_0.8+dfsg.orig.tar.xz, deleting 774 files from it.
uscan info: New orig.tar.* tarball version (after mk-origtargz): 0.8+dfsg
uscan info: Scan finished
vimer@dev:~/build/rfs/ocaml/package/for-debian/2_linksem/old/dfsg/linksem-0.8$ ls ../
0327 build-area linksem-0.8 tmp
0.8.tar.gz liblinksem-ocaml-dev.install linksem_0.8+dfsg.orig.tar.xz tmp.txt
可以参考: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=913761
这个主题需要后面具体补充。 TBD
首先建立git repo:
gbp import-dsc https://deb.debian.org/debian/pool/main/j/jamulus/jamulus_3.8.2+dfsg-1.dsc
接下来就需要看一下d/copyright的excluded-files
域,在新版本的upstream中,这里很有可能会有些变化。比如,
前期的exclde文件可能在新版本中已经不存在了,或者有新的文件不满足Debian policy,需要重新repack。我个人的做法是首先编辑d/copyright文件,利用uscan
的魔法去repack.
整理完d/copyright后,就可以使用:
$ gbp import-orig --pristine-tar --uscan
vimer@debian:~/build/gitlab/jamulus$ gbp import-orig --pristine-tar --uscan
gbp:info: Launching uscan...
uscan warn: The directory name distributions doesn't match the requirement of
--check-dirname-level=1 --check-dirname-regex=jamulus(-.+)? .
Set --check-dirname-level=0 to disable this sanity check feature., skipping
Can't exec "debian/repack": No such file or directory at /usr/share/perl5/Dpkg/IPC.pm line 311.
uscan: error: unable to execute debian/repack --upstream-version 3.9.1+dfsg: No such file or directory
uscan: error: debian/repack --upstream-version 3.9.1+dfsg subprocess returned exit status 255
gbp:error: Uscan failed - debug by running 'uscan --verbose'
如果repack失败了,则需要再次import tarball.
gbp import-orig --pristine-tar ../dfsg-*.tar.gz
注意,最好手动检查../dfsg-*tar.gz文件符不符合d/copyright 文件描述的。
如果不使用--uscan
repack, 可以使用:
mk-origtargz operates on local file. No question asked.
https://wiki.debian.org/BenFinney/software/repack https://wiki.debian.org/Javascript/Repacking
目前想看看glibc的东西,但是大部分都是这一点那一点,不算特别友好,所以我感觉还是先把使用的资料整理下来。
这是PLCT实验室的一个公开课程,挺不错的,课程主页 或者 github.
docker run -u root --volume ~/build/go_ld:/code -it golang:bullseye
上面这个命令就是快速使用docker搭建一个友好的开发环境,volume
参数可以将宿主机的环境映射到docker中。
Digest: sha256:2a80cda19fac1972f4c8d69516372b452062631f84854c223f1a164ce77b06d3
Status: Downloaded newer image for golang:bullseye
root@57403975e64f:/go# cd /code/
root@57403975e64f:/code# ls
然后安装工具:
apt install gcc-10-riscv64-linux-gnu qemu-user
简化一下命令:
ln -sf /usr/bin/riscv64-linux-gnu-gcc-10 /usr/bin/riscv64-linux-gnu-gcc
exit
退出容器。
1.
docker ps -a
docker start names(容器名字)
2. 进入容器
A. docker attach name/id 使用“docker attach”命令进入container(容器)有一个缺点,那就是每次从container中退出到前台时,container也跟着退出了。
B. docker exec -it (退出后台运行)
首先在容器中安装以下软件:
apt install gcc-10-riscv64-linux-gnu qemu-user
# 简化一下:
ln -sf /usr/bin/riscv64-linux-gnu-gcc-10 /usr/bin/riscv64-linux-gnu-gcc
写一个简单的go文件测试下环境:
package main
func main() {
println("hello,world")
}
因为映射了嘛,所以可以直接在~/code下写go文件,然后在容器中运行。
go run rvld.go
hello,world
root@57403975e64f:/code/rvld# go mod init github.com/yuzibo/go_ld
go: creating new go.mod: module github.com/yuzibo/go_ld
go: to add module requirements and sums:
go mod tidy
root@57403975e64f:/code/rvld# go mod tidy
接下来写一个c程序,使用 -c
只生成目标文件,不链接。
riscv64-linux-gnu-gcc main.c -c -o main.o
不过这样可能不方便,所以我们需要新建一个tests的目录。
现在归纳一下环境就是,在宿主机上目前为~/build/go_ld
而在docker里面为/code/
如果vscode报告权限问题的话,可以参考这里看一下: here
chmod -R 777 dir # is ok
在rvld/tests目录下,使用以下demo,就可以快速改写自己的测试文件。
#!/bin/bash
echo "$0"
test_name=$(basename "$0" .sh)
t=out/tests/$test_name
mkdir -p "$t"
cat <<EOF | riscv64-linux-gnu-gcc -o $t/a.o -c -xc -
#include <stdio.h>
int main(){
printf("hello,world");
return 0;
}
EOF
./go_ld "$t/a.o"
# 在测试文件中直接调用rvld,因为一开始没有使用 go mod,这里导致go的可执行文件不一致
测试:
package main
import (
"os";
"fmt"
)
func main() {
fmt.Printf("%v\n", os.Args)
if len(os.Args) < 2{
println("wrong args")
os.Exit(1)
}
}
并执行测试脚本:
oot@57403975e64f:/code/rvld# go build rvld.go
root@57403975e64f:/code/rvld# ./tests/hello.sh
./tests/hello.sh
[./rvld out/tests/hello/a.o]
下面写一个Makefile再次简化这个流程:
TESTS := $(wildcard tests/*.sh)
build:
go build
test: build test_files
@printf '\e[32mOKpassed all tests\e[0m\n'
test_files:
@echo 'testing'
@for file in $(TESTS); do \
./$$file ; \
done
@printf '\e[32mOK\e[0m\n'
clean:
go clean
rm -rf out/
.PHPNY: build clean test $(TESTS)
…
由于间隔时间比较远,所以有些混乱,目前的目录结构如下 :
vimer@dev:~/build/go_ld/rvld$ tree
.
├── go-ld.go
├── go.mod
├── Makefile
├── pkg
│ └── utils
│ └── utils.go # 抽象出来
└── tests
├── hello.sh
└── world.sh
3 directories, 6 files
> Relevant part (hopefully):
> > debian/rules clean
> > dh clean --with python3 --buildsystem=pybuild
> > dh_auto_clean -O--buildsystem=pybuild
> > I: pybuild base:240: python3.10 setup.py clean
> > /<<PKGBUILDDIR>>/setup.py:3: DeprecationWarning: The distutils
package is deprecated and slated for removal in Python 3.12. Use
setuptools or check PEP 632 for potential alternatives
> > from distutils.core import setup
> > /usr/lib/python3/dist-packages/_distutils_hack/__init__.py:18:
UserWarning: Distutils was imported before Setuptools, but importing
Setuptools also replaces the `distutils` module in `sys.modules`. This
may lead to undesirable behaviors or errors. To avoid these issues,
avoid using distutils directly, ensure that setuptools is installed in
the traditional way (e.g. not an editable install), and/or make sure
that setuptools is always imported before distutils.
> > warnings.warn(
> > /usr/lib/python3/dist-packages/_distutils_hack/__init__.py:33:
UserWarning: Setuptools is replacing distutils.
> > warnings.warn("Setuptools is replacing distutils.")
> > /usr/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown
distribution option: 'install_requires'
> > warnings.warn(msg)
> > running clean
> > Traceback (most recent call last):
> > File "/<<PKGBUILDDIR>>/setup.py", line 6, in <module>
> > setup(name='azure-cosmos',
> > File "/usr/lib/python3.10/distutils/core.py", line 148, in setup
> > dist.run_commands()
> > File "/usr/lib/python3.10/distutils/dist.py", line 966, in
run_commands
> > self.run_command(cmd)
> > File "/usr/lib/python3.10/distutils/dist.py", line 983, in
run_command
> > cmd_obj = self.get_command_obj(command)
> > File "/usr/lib/python3.10/distutils/dist.py", line 858, in
get_command_obj
> > cmd_obj = self.command_obj[command] = klass(self)
> > File "/usr/lib/python3/dist-packages/setuptools/__init__.py",
line 158, in __init__
> > super().__init__(dist)
> > File "/usr/lib/python3/dist-
packages/setuptools/_distutils/cmd.py", line 59, in __init__
> > raise TypeError("dist must be a Distribution instance")
> > TypeError: dist must be a Distribution instance
> > E: pybuild pybuild:379: clean: plugin distutils failed with: exit
code=1: python3.10 setup.py clean
> > dh_auto_clean: error: pybuild --clean -i python{version} -p 3.10
returned exit code 13
> > make: *** [debian/rules:6: clean] Error 25
# patch
-#!/usr/bin/env python
+#!/usr/bin/env python
-from distutils.core import setup
import setuptools
+from distutils.core import setup