From 5c141b8c673e508247f10d1f8e8affc282198bc0 Mon Sep 17 00:00:00 2001 From: Jaromil Date: Wed, 8 Jan 2025 11:51:00 +0100 Subject: [PATCH] fix: debian binary package well built --- GNUmakefile | 14 ++++++-------- build/debian/changelog | 2 +- build/debian/cjit.install | 1 + build/debian/gbp.conf | 2 ++ build/debian/rules | 13 ++++++++++--- src/main.c | 2 +- test/bats_setup | 1 + 7 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 build/debian/cjit.install create mode 100644 build/debian/gbp.conf diff --git a/GNUmakefile b/GNUmakefile index a11705c..649f7da 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -26,7 +26,6 @@ # this source code; if not, , see . # POSIX system installation paths -PROG = cjit PREFIX ?= /usr/local DATADIR ?= ${PREFIX}/share/cjit INCDIR ?= ${PREFIX}/include/cjit @@ -104,11 +103,10 @@ _: ## install: ## ๐Ÿ”Œ Install the built binaries in PREFIX $(info Installing CJIT in ${BUILDDIR}${PREFIX}) - install -Dm755 cjit ${DESTDIR}${PREFIX}/bin/${PROG} - install -d ${DESTDIR}${DATADIR} - cp -ra README.md REUSE.toml LICENSES ${DESTDIR}${DATADIR}/ - cp -ra examples ${DESTDIR}${DATADIR}/ - ${PROG} --xass="${DESTDIR}${INCDIR}" + @install -Dm755 cjit ${DESTDIR}${PREFIX}/bin/cjit + @install -d ${DESTDIR}${DATADIR} + @cp -ra README.md REUSE.toml LICENSES ${DESTDIR}${DATADIR}/ + @cp -ra examples ${DESTDIR}${DATADIR}/ .PHONY: debian debian: @@ -116,8 +114,8 @@ debian: @rm -rf debian @cp -ra build/debian . @cp docs/cjit.1 debian/manpage.1 - @uscan --force-download - @dpkg-buildpackage --build=binary --no-sign + @dpkg-buildpackage --no-sign --build=binary + clean: ## ๐Ÿงน Clean the source from all built objects ${MAKE} -C lib/tinycc clean distclean diff --git a/build/debian/changelog b/build/debian/changelog index ed5df99..50be178 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -1,4 +1,4 @@ -cjit (0.15.4-1) UNRELEASED; urgency=medium +cjit (0.15.5-1) UNRELEASED; urgency=medium * Initial release. (Closes: #nnnn) diff --git a/build/debian/cjit.install b/build/debian/cjit.install new file mode 100644 index 0000000..097923b --- /dev/null +++ b/build/debian/cjit.install @@ -0,0 +1 @@ +usr/* diff --git a/build/debian/gbp.conf b/build/debian/gbp.conf new file mode 100644 index 0000000..9048820 --- /dev/null +++ b/build/debian/gbp.conf @@ -0,0 +1,2 @@ +[DEFAULT] +debian-branch = main diff --git a/build/debian/rules b/build/debian/rules index 69f1903..76159a3 100755 --- a/build/debian/rules +++ b/build/debian/rules @@ -6,13 +6,20 @@ # export DH_VERBOSE=1 # export DEB_BUILD_OPTIONS = noparallel +include /usr/share/dpkg/buildflags.mk + +export PREFIX=/usr +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# VERSION := $(shell dpkg-parsechangelog --show-field Version) +# NAME := $(shell dpkg-parsechangelog --show-field Source) +# DEBPKGNAME := ${NAME}-${VERSION} + %: dh $@ -# Override the build target to call make. override_dh_auto_build: dh_auto_build -- meson-release -# Override the install target to call make install. override_dh_auto_install: - dh_auto_install -- make install DESTDIR=$(CURDIR)/debian/$(DEBPKGNAME) + dh_auto_install --destdir=debian/tmp diff --git a/src/main.c b/src/main.c index 686c25f..85013d8 100644 --- a/src/main.c +++ b/src/main.c @@ -79,7 +79,7 @@ const char cli_help[] = " -e fun\t run starting from entry function (-) main\n" " -p pid\t write execution process ID to (+) pid\n" " --verb\t don't go quiet, verbose logs\n" -#if defined(SHAREDTCC) +#if !defined(SHAREDTCC) " --xass\t just extract runtime assets (=) to path\n" #endif #if defined(SELFHOST) diff --git a/test/bats_setup b/test/bats_setup index 88fa117..0f367e9 100644 --- a/test/bats_setup +++ b/test/bats_setup @@ -20,4 +20,5 @@ setup() { fi TCC="${R}/lib/tinycc/tcc" [ -r "$TCC" ] || TCC="${R}/lib/tinycc/tcc.exe" + unset CFLAGS }