From 8e5938002fe3972a51abc6d8c58186e5937f7f56 Mon Sep 17 00:00:00 2001 From: Joseph Coffland Date: Thu, 7 Nov 2024 15:13:24 +0200 Subject: [PATCH] Petter Reinholdtsen's changes --- debian/control | 4 ++-- debian/rules | 45 +++++++++++++++++++++++++++++---------------- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/debian/control b/debian/control index 5e841a799..216702d3d 100644 --- a/debian/control +++ b/debian/control @@ -2,9 +2,9 @@ Source: cbang Maintainer: Joseph Coffland Section: libs Priority: optional -Standards-Version: 4.4.1 +Standards-Version: 4.7.0 Homepage: http://cbang.org/ -Build-Depends: debhelper (>= 11), cdbs, scons, libssl-dev, libnode-dev +Build-Depends: debhelper (>= 13), scons, libssl-dev, libnode-dev Package: libcbang0-dev Provides: libcbang-dev diff --git a/debian/rules b/debian/rules index c0fe89645..e01842fff 100755 --- a/debian/rules +++ b/debian/rules @@ -1,19 +1,32 @@ #!/usr/bin/make -f -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -include /usr/share/cdbs/1/rules/utils.mk -include /usr/share/cdbs/1/class/scons.mk -include /usr/share/cdbs/1/rules/debhelper.mk - -LIBPKGNAME = libcbang0 -#SONAME = "$(DEB_UPSTREAM_VERSION)" -DEB_SCONS_OPTIONS = sharedlib=1 -j8 -DEB_SCONS_INSTALL_OPTIONS += prefix="$(cdbs_curdestdir)/usr" -DEB_DH_MAKESHLIBS_ARGS = -- -c4 - -# For scons binary package builds -ifeq ($(DEB_DEST_DIR),1) - DEB_DH_BUILDDEB_ARGS = --destdir=. +export DH_VERBOSE = 1 +export DEB_BUILD_MAINT_OPTIONS = hardening=+all +NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + +# link to libatomic on armel and mipsel +ifneq (,$(filter $(DEB_HOST_ARCH), armel mipsel)) + export DEB_LDFLAGS_MAINT_APPEND += -Wl,--no-as-needed -latomic -Wl,--as-needed endif + +include /usr/share/dpkg/default.mk # provides DEB_VERSION + +SCONS_OPTIONS = cycles=0 mode=release sharedlib=1 -j$(NUMJOBS) werror=0 clang=1 + +%: + dh $@ + +override_dh_auto_clean: + scons -c + find . -name __pycache__|xargs rm -rf + rm -rf .sconf_temp config.log + rm -rf .sconsign.dblite + +override_dh_auto_build: + scons $(SCONS_OPTIONS) --jobs=$(NUMJOBS) --no-cache + +override_dh_usrlocal: + true + +override_dh_auto_install: + PREFIX=/usr scons prefix=debian/tmp/usr $(SCONS_OPTIONS) install