From 0ee703f9471308c7ee308b1ab1974671609ef12b Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 25 Jun 2025 00:24:27 +0100 Subject: [PATCH 1/4] Problem: Debian build dependencies out of date Solution: now that Ubuntu before 20.04 and Debian before 11 are EOL update to debhelper-compat 12 and change several build deps --- zproject_debian.gsl | 24 ++++++++---------------- zproject_obs.gsl | 5 ----- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/zproject_debian.gsl b/zproject_debian.gsl index d9a95dbe..fd0a1a17 100644 --- a/zproject_debian.gsl +++ b/zproject_debian.gsl @@ -26,8 +26,6 @@ $(project.name:lower) ($(->version.major).$(->version.minor).$(->version.patch)- * Initial packaging. -- $(project.name) Developers <$(project.email)> Wed, 31 Dec 2014 00:00:00 +0000 -.output "packaging/debian/compat" -10 .output "packaging/debian/control" # # $(project.name) - $(project.description?'':) @@ -41,8 +39,8 @@ Section: net Priority: optional Maintainer: $(project.name) Developers <$(project.email)> Standards-Version: 4.0.1.0 -Build-Depends: debhelper (>= 9), - pkg-config, +Build-Depends: debhelper-compat (= 12), + pkgconf | pkg-config, .for project.use .if defined(use.debian_name) . if !(use.debian_name = '') @@ -65,15 +63,13 @@ Build-Depends: debhelper (>= 9), .endif .if systemd ?= 1 .# necessary for systemd.pc to get unit install path - systemd, + systemd-dev | systemd, .endif .if python_cffi ?= 1 dh-python , python3-all-dev , python3-cffi , python3-setuptools , .endif -.- NOTE: after support for Debian 7 and Ubuntu 12.04 is dropped, can be added to each of the following - asciidoc-base | asciidoc, xmlto, - dh-autoreconf + asciidoc-base , xmlto , .if project.exports_classes | ( project.has_classes & project.has_main ) .# NOTE: Now for at least some compilers the symbol visibility seems to .# be managed in the shared library files, not the "exportedness" - so @@ -314,9 +310,6 @@ override_dh_auto_configure: %: dh $@ \\ -.if systemd ?= 1 - --with systemd \\ -.endif .if python_cffi ?= 1 \$(WITH_PYTHON) \\ .endif @@ -407,8 +400,8 @@ Source: $(project.name) Version: $(->version.major).$(->version.minor).$(->version.patch)-0.1 Maintainer: $(project.name) Developers <$(project.email)> Architecture: any -Build-Depends: debhelper (>= 9), - pkg-config, +Build-Depends: debhelper-compat (= 12), + pkgconf | pkg-config, .for project.use .if defined(use.debian_name) . if !(use.debian_name = '') @@ -427,14 +420,13 @@ Build-Depends: debhelper (>= 9), , .endfor .if systemd ?= 1 - systemd, + systemd-dev | systemd, .endif .if python_cffi ?= 1 dh-python , python3-all-dev , python3-cffi , python3-setuptools , .endif - asciidoc-base | asciidoc, xmlto, - dh-autoreconf + asciidoc-base , xmlto , Files: 7697688bf65a35bc33ae2db51ebb0e3b 818110 $(string.replace (project.name, "_|-"):lower).tar.gz diff --git a/zproject_obs.gsl b/zproject_obs.gsl index 091c9e2b..fa3b7b22 100644 --- a/zproject_obs.gsl +++ b/zproject_obs.gsl @@ -41,11 +41,6 @@ register_target ("obs", "service for Open Build Service") */packaging/debian/changelog debian.changelog - - *.tar - */packaging/debian/compat - debian.compat - *.tar */packaging/debian/control From 3453295a1e36741b95c39b9b4e3afdedcea2ccbe Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 25 Jun 2025 00:37:30 +0100 Subject: [PATCH 2/4] Problem: Debian build fails on Ubuntu 24.04/Debian 13 Solution: fix the unit dir so that it is compatible with the generated install scripts, which pick it from fixed legacy paths --- zproject_debian.gsl | 1 + 1 file changed, 1 insertion(+) diff --git a/zproject_debian.gsl b/zproject_debian.gsl index fd0a1a17..2304e79a 100644 --- a/zproject_debian.gsl +++ b/zproject_debian.gsl @@ -301,6 +301,7 @@ override_dh_auto_configure: dh_auto_configure -- \\ .if systemd ?= 1 --with-systemd-units \\ + --with-systemdsystemunitdir=/lib/systemd/system \\ .endif .for project.use where use.optional --with-$(use.libname)=yes \\ From c161f944eb24f8ac1e4f16ca58e1de3bc18c5bd5 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 25 Jun 2025 00:58:52 +0100 Subject: [PATCH 3/4] Revert "Problem: autogen fails from SELFTEST missing in configure.am" This breaks autoreconf -fi when applied to zproject, revert it This reverts commit 827290794ed3c427ecd47bd3377b3bddc05682a9. --- zproject_autotools.gsl | 1 + 1 file changed, 1 insertion(+) diff --git a/zproject_autotools.gsl b/zproject_autotools.gsl index 40abf667..e772579c 100644 --- a/zproject_autotools.gsl +++ b/zproject_autotools.gsl @@ -1088,6 +1088,7 @@ AC_ARG_ENABLE([$(name)], AM_CONDITIONAL([ENABLE_$(NAME:c)], [test x$enable_$(name:c) != xno]) AM_COND_IF([ENABLE_$(NAME:c)], [AC_MSG_NOTICE([ENABLE_$(NAME:c) defined])]) +.else AM_CONDITIONAL([ENABLE_$(PROJECT.PREFIX:c)_SELFTEST], [test x$enable_$(project.prefix:c)_selftest != xno]) AM_COND_IF([ENABLE_$(PROJECT.PREFIX:c)_SELFTEST], [AC_MSG_NOTICE([ENABLE_$(PROJECT.PREFIX:c)_SELFTEST defined])]) From ea00777149b956dc04fc3806876a19a9f2345e5b Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 25 Jun 2025 00:52:43 +0100 Subject: [PATCH 4/4] Problem: out of date Solution: regenerate --- CMakeLists.txt | 58 +++++++++++++++++------------------ configure.ac | 6 ++-- packaging/debian/compat | 1 - packaging/debian/control | 7 ++--- packaging/debian/zproject.dsc | 7 ++--- packaging/obs/_service | 5 --- 6 files changed, 38 insertions(+), 46 deletions(-) delete mode 100644 packaging/debian/compat diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fe8f44e..36ef2e7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,12 +6,13 @@ ######################################################################## # Project setup ######################################################################## -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 2.8...4.0) project(zproject) enable_language(C) enable_testing() -set(SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +include(GNUInstallDirs) + set(CMAKE_EXPORT_COMPILE_COMMANDS 1) # Select flags if(MSVC) @@ -51,7 +52,7 @@ if (NOT HAVE_NET_IF_H) CHECK_INCLUDE_FILE("net/if.h" HAVE_NET_IF_H) endif() -file(REMOVE "${SOURCE_DIR}/src/platform.h") +file(REMOVE "${PROJECT_SOURCE_DIR}/src/platform.h") file(WRITE "${PROJECT_BINARY_DIR}/platform.h.in" " #cmakedefine HAVE_LINUX_WIRELESS_H @@ -68,7 +69,7 @@ if (WIN32) #so the sources have to be compiled as c++ if (MSVC AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) enable_language(CXX) - file(GLOB sources "${SOURCE_DIR}/src/*.c") + file(GLOB sources "${PROJECT_SOURCE_DIR}/src/*.c") set_source_files_properties( ${sources} PROPERTIES LANGUAGE CXX @@ -94,7 +95,7 @@ if (CYGWIN) set(MORE_LIBRARIES) endif() -list(APPEND CMAKE_MODULE_PATH "${SOURCE_DIR}") +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}") set(OPTIONAL_LIBRARIES) set(OPTIONAL_LIBRARIES_STATIC) @@ -126,7 +127,7 @@ set (zproject_headers ) source_group ("Header Files" FILES ${zproject_headers}) -install(FILES ${zproject_headers} DESTINATION include) +install(FILES ${zproject_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ######################################################################## # executables @@ -197,31 +198,30 @@ include(CTest) # cleanup ######################################################################## if (NOT TARGET distclean) - add_custom_target (distclean @echo Cleaning for source distribution) + if (CMAKE_VERSION VERSION_LESS 3.17) + set(rm_command rm -rf) + else() + set(rm_command ${CMAKE_COMMAND} -E rm -rf --) + endif() + set(cmake_generated ${PROJECT_BINARY_DIR}/CMakeCache.txt + ${PROJECT_BINARY_DIR}/cmake_install.cmake + ${PROJECT_BINARY_DIR}/Makefile + ${PROJECT_BINARY_DIR}/CMakeFiles + ${PROJECT_BINARY_DIR}/CTestTestfile.cmake + ${PROJECT_BINARY_DIR}/DartConfiguration.tcl + ${PROJECT_BINARY_DIR}/Testing + ${PROJECT_BINARY_DIR}/compile_commands.json + ${PROJECT_BINARY_DIR}/platform.h + ${PROJECT_BINARY_DIR}/src/libzproject.pc + ${PROJECT_BINARY_DIR}/src/libzproject.so + ${PROJECT_BINARY_DIR}/src/zproject_selftest + ) + add_custom_target(distclean + COMMAND ${rm_command} CMakeTmp ${cmake_generated} + COMMENT Cleaning for source distribution + ) endif() -set(cmake_generated ${PROJECT_BINARY_DIR}/CMakeCache.txt - ${PROJECT_BINARY_DIR}/cmake_install.cmake - ${PROJECT_BINARY_DIR}/Makefile - ${PROJECT_BINARY_DIR}/CMakeFiles - ${PROJECT_BINARY_DIR}/CTestTestfile.cmake - ${PROJECT_BINARY_DIR}/DartConfiguration.tcl - ${PROJECT_BINARY_DIR}/Testing - ${PROJECT_BINARY_DIR}/compile_commands.json - ${PROJECT_BINARY_DIR}/platform.h - ${PROJECT_BINARY_DIR}/src/libzproject.pc - ${PROJECT_BINARY_DIR}/src/libzproject.so - ${PROJECT_BINARY_DIR}/src/zproject_selftest -) - -add_custom_command( - DEPENDS clean - COMMENT "distribution clean" - COMMAND rm - ARGS -rf CMakeTmp ${cmake_generated} - TARGET distclean -) - include(ClangFormat OPTIONAL) ######################################################################## diff --git a/configure.ac b/configure.ac index 1ac6fc6e..6dba972a 100644 --- a/configure.ac +++ b/configure.ac @@ -75,7 +75,7 @@ AC_ARG_WITH(gcov, [AS_HELP_STRING([--with-gcov=yes/no], [With GCC Code Coverage reporting])], [ZPROJECT_GCOV="$withval"]) -if test "x${ZPROJECT_GCOV}" = "xyes"; then +if test "x${ZPROJECT_GCOV}" == "xyes"; then CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" if test "x${ZPROJECT_ORIG_CFLAGS}" != "xnone"; then @@ -94,7 +94,7 @@ AC_ARG_ENABLE(address-sanitizer, [AS_HELP_STRING([--enable-address-sanitizer=yes [Build with GCC Address Sanitizer instrumentation])], [ZPROJECT_ASAN="$enableval"]) -if test "x${ZPROJECT_ASAN}" = "xyes"; then +if test "x${ZPROJECT_ASAN}" == "xyes"; then CFLAGS="${CFLAGS} -fsanitize=address" CXXFLAGS="${CXXFLAGS} -fsanitize=address" @@ -114,7 +114,7 @@ AC_ARG_ENABLE([bindings-python], [ZPROJECT_BINDINGS_PYTHON=$enableval], [ZPROJECT_BINDINGS_PYTHON=no]) -if test "x$ZPROJECT_BINDINGS_PYTHON" = "xyes"; then +if test "x$ZPROJECT_BINDINGS_PYTHON" == "xyes"; then AM_CONDITIONAL(ENABLE_BINDINGS_PYTHON, true) AC_MSG_RESULT([yes]) else diff --git a/packaging/debian/compat b/packaging/debian/compat deleted file mode 100644 index f599e28b..00000000 --- a/packaging/debian/compat +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/packaging/debian/control b/packaging/debian/control index d577109e..cf965ed2 100644 --- a/packaging/debian/control +++ b/packaging/debian/control @@ -14,11 +14,10 @@ Section: net Priority: optional Maintainer: zproject Developers Standards-Version: 4.0.1.0 -Build-Depends: debhelper (>= 9), - pkg-config, +Build-Depends: debhelper-compat (= 12), + pkgconf | pkg-config, generator-scripting-language, - asciidoc-base | asciidoc, xmlto, - dh-autoreconf + asciidoc-base , xmlto , Package: zproject Architecture: any diff --git a/packaging/debian/zproject.dsc b/packaging/debian/zproject.dsc index abe40af9..63761ca4 100644 --- a/packaging/debian/zproject.dsc +++ b/packaging/debian/zproject.dsc @@ -4,11 +4,10 @@ Source: zproject Version: 1.1.0-0.1 Maintainer: zproject Developers Architecture: any -Build-Depends: debhelper (>= 9), - pkg-config, +Build-Depends: debhelper-compat (= 12), + pkgconf | pkg-config, generator-scripting-language, - asciidoc-base | asciidoc, xmlto, - dh-autoreconf + asciidoc-base , xmlto , Files: 7697688bf65a35bc33ae2db51ebb0e3b 818110 zproject.tar.gz diff --git a/packaging/obs/_service b/packaging/obs/_service index 4ed621cb..71ef89f3 100644 --- a/packaging/obs/_service +++ b/packaging/obs/_service @@ -23,11 +23,6 @@ */packaging/debian/changelog debian.changelog - - *.tar - */packaging/debian/compat - debian.compat - *.tar */packaging/debian/control