如果针对 d/*
下面的目录进行修改,目前没有好的方法,比如使用quilt
或者patch
,但是我们可以使用
$ debdiff old/waypipe_0.8.2-3.dsc waypipe_0.8.2-3.dsc
dpkg-source: warning: extracting unsigned source package (/home/vimer/05/26_waypipe/waypipe_0.8.2-3.dsc)
diff -Nru waypipe-0.8.2/debian/rules waypipe-0.8.2/debian/rules
--- waypipe-0.8.2/debian/rules 2021-12-01 15:39:26.000000000 +0000
+++ waypipe-0.8.2/debian/rules 2021-12-01 15:39:26.000000000 +0000
@@ -16,7 +16,7 @@
dh_auto_configure -- -Dwith_avx2=false -Dwith_avx512f=false -Dwith_neon_opts=false -Dwith_sse3=false
endif
-ifneq (, $(filter $(DEB_HOST_ARCH),mipsel mips64el))
+ifneq (, $(filter $(DEB_HOST_ARCH),mipsel mips64el riscv64))
override_dh_auto_test:
@echo "Skipping tests on $(DEB_HOST_ARCH)."
endif
OBS(Open Build Server)是用在做构建用的服务器,在目前的开发中,需要了解这一工具。
openEular的obs使用指南在这里:
https://gitee.com/zxs-un/openEuler-port2riscv64
osc -A https://build.tarsier-infra.com/ ls
home:vimer
Debian mail list有一些很好的学习资源,目前临时记录下来以作进一步的学习。
Subject: [PATCH 2/5] Update to debhelper-compat 13.
---
debian/compat | 1 -
debian/control | 2 +-
debian/rules | 9 ++++++++-
3 files changed, 9 insertions(+), 3 deletions(-)
delete mode 100644 debian/compat
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index 45a4fb7..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-8
diff --git a/debian/control b/debian/control
index 702a8fb..f8abb4d 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: net
Priority: optional
Maintainer: Debian QA Group <[email protected]>
Homepage: http://sourceforge.net/projects/bbom/
-Build-Depends: debhelper (>= 8.0.0), pkg-config, libgtk2.0-dev, libcurl4-gnutls-dev, autotools-dev
+Build-Depends: debhelper-compat (= 13), pkg-config, libgtk2.0-dev, libcurl4-gnutls-dev
Standards-Version: 3.9.3
Package: bitstormlite
diff --git a/debian/rules b/debian/rules
index 9109369..eb91fdd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,4 +1,11 @@
#!/usr/bin/make -f
+export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-format
+
%:
- dh [email protected] --with autotools_dev
+ dh [email protected]
+
+override_dh_autoreconf:
+
+override_dh_auto_configure:
+ ./configure --build=$(DEB_HOST_MULTIARCH) --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-option-checking --disable-silent-rules --libdir=\${prefix}/lib/$(DEB_HOST_MULTIARCH) --disable-maintainer-mode --disable-dependency-tracking
目前,debian有这么几个和build系统相关的东西:
总部wiki.
about这里云云了一大堆,看官可以自己去瞧一瞧,在此不必赘述(但是从项目背景的角度看,这个页面真的应该好好读一读,这样的话,你会更加明白rb的意义)。其实,这个项目的本身感觉是从安全的角度出发的。
Autotools是一个linux下使用广泛的build系统,尤其是在debian的packaging过程中需要大量遇到。所以,这篇文章根据https://earthly.dev/blog/autoconf/进行整理翻译,进行一些自己的积累。
Autotools主要由以下三大组件构成: autoconf
, automake
,aclocal
.
Autoconf是m4sh
写的,后者使用m4
宏。m4sh
提供了一些宏可以用来生成configure.ac
文件,然后接着可以自动产生configure
文件。
Debian的打包命令脚本中,最关键的其实 rules/
下的dh命令。
这里有一个wiki,需要好好滴进行学习。
convlit fails to cross build from source, because it uses the build architecture compiler. Letting dh_auto_build pass suitable CC to make mostly fixes that except for one bare gcc invocation. After making that substitutable as well, convlit cross builds successfully. Please consider applying the attached patch.
Helmut
diff -u convlit-1.8/debian/rules convlit-1.8/debian/rules
--- convlit-1.8/debian/rules
+++ convlit-1.8/debian/rules
@@ -21,8 +21,8 @@
build: build-stamp
build-stamp:
dh_testdir
- $(MAKE) -C $(CURDIR)/lib
- $(MAKE) -C $(CURDIR)/clit18
+ dh_auto_build --sourcedirectory=lib
+ dh_auto_build --sourcedirectory=clit18
touch [email protected]
clean:
diff -u convlit-1.8/debian/changelog convlit-1.8/debian/changelog
--- convlit-1.8/debian/changelog
+++ convlit-1.8/debian/changelog
@@ -1,3 +1,12 @@
+convlit (1.8-1.1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Fix FTCBFS: (Closes: #-1)
+ + Let dh_auto_build pass cross tools to make.
+ + Make one plain gcc call substitutable.
+
diff -u convlit-1.8/clit18/Makefile convlit-1.8/clit18/Makefile
--- convlit-1.8/clit18/Makefile
+++ convlit-1.8/clit18/Makefile
@@ -7,3 +7,3 @@
clit: clit.o hexdump.o drm5.o explode.o transmute.o display.o utils.o manifest.o ../lib/openclit.a
- gcc -o clit $^ -ltommath
+ $(CC) -o clit $^ -ltommath
Subject: [PATCH 1/2] debian/rules: Pass -ffile-prefix-map in CFLAGS to avoid
embedding build paths.
https://reproducible-builds.org/docs/build-path/
---
debian/rules | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/debian/rules b/debian/rules
index 60c65ac..d18f93e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -17,6 +17,10 @@ ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
else
CFLAGS += -O2
endif
+
+# Avoid embedding the build path for reproducible builds
+CFLAGS += -ffile-prefix-map=$(CURDIR)=.
+
export CFLAGS
--
2.35.1
##
Subject: [PATCH 2/2] debian/rules: Finish conversion to dh.
---
debian/rules | 61 +++++++---------------------------------------------
1 file changed, 8 insertions(+), 53 deletions(-)
diff --git a/debian/rules b/debian/rules
index d18f93e..40ffb83 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,59 +11,14 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
%:
dh [email protected]
-CFLAGS := -Wall -g
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
- CFLAGS += -O0
-else
- CFLAGS += -O2
-endif
+override_dh_auto_build:
+ dh_auto_build --sourcedir=$(CURDIR)/lib
+ dh_auto_build --sourcedir=$(CURDIR)/clit18
-# Avoid embedding the build path for reproducible builds
-CFLAGS += -ffile-prefix-map=$(CURDIR)=.
+override_dh_auto_clean:
+ dh_auto_clean --sourcedir=$(CURDIR)/clit18
+ dh_auto_clean --sourcedir=$(CURDIR)/lib
+ dh_auto_clean
-export CFLAGS
-
-
-build: build-stamp
-build-stamp:
- dh_testdir
- $(MAKE) -C $(CURDIR)/lib
- $(MAKE) -C $(CURDIR)/clit18
- touch [email protected]
-
-clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp
- $(MAKE) -C $(CURDIR)/clit18 clean
- $(MAKE) -C $(CURDIR)/lib clean
- dh_clean
-
-install: build
- dh_testdir
- dh_testroot
- dh_prep
- dh_install
-
-binary-indep:
-# do nothing
-
-binary-arch: build install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installexamples
+override_dh_installman:
dh_installman debian/clit.1
- dh_link
- dh_strip
- dh_compress
- dh_fixperms
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
--