From patchwork Sun Oct 18 12:58:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valters Jansons X-Patchwork-Id: 10413 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1 raw public key) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "YR1" (not verified)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4j6zJ22Kg9z3wp9 for ; Sun, 18 Oct 2026 12:58:26 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail02.haj.ipfire.org", Issuer "YE2" (not verified)) by mail01.ipfire.org (Postfix) with ESMTPS id 4j6zJ1697Qz7Bv for ; Sun, 18 Oct 2026 12:58:25 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4j6zJ147pYz330h for ; Sun, 18 Oct 2026 12:58:25 +0000 (UTC) X-Original-To: location@lists.ipfire.org Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1 raw public key) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "YR1" (not verified)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4j6zJ06FkJz2xQT for ; Sun, 18 Oct 2026 12:58:24 +0000 (UTC) Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4j6zHz2931z2ng for ; Sun, 18 Oct 2026 12:58:23 +0000 (UTC) Authentication-Results: mail01.ipfire.org; dkim=pass header.d=gmail.com header.s=20251104 header.b=MGnjPYvk; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mail01.ipfire.org: domain of valter.jansons@gmail.com designates 2607:f8b0:4864:20::42b as permitted sender) smtp.mailfrom=valter.jansons@gmail.com ARC-Seal: i=1; a=rsa-sha256; d=lists.ipfire.org; s=202003rsa; cv=none; t=1792328303; b=U8aCPgytbVGnp1swdGPYx2GLeOv/Z94IC1ziogE9COzkmbCY9YrLIZrbF90fLkv25cVZgq TPlxTj7QNHguH4l1uEz41t32FF7Mub54IPfrBpv5GZaa6/vfov90GfgjmSZxYUxDoXS+Tu IyYg1yJvN3ZDwhy0VRxvHW9Ag0ZSsmyQp42hP0gi3jVWVHxM/73KhdSaCJ+OZIoB00H8tX Ha7U6bxmKRqdD0SvOl7923u87LJtlYQbSc/v5pKNx2e3Ii8nn1XYLWxCC00S7DzuyPvz5+ EtSLAIMGyY5OixqAiKVeKB/Ie8MP/FTqdrPV50Js3X3u+FYaMsEdD1xhozRS4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1792328303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:dkim-signature; bh=+anowpRIdpKX1P+sflLm8t8qqWiBxHqwj14+5UCq9sU=; b=vUYGg6k6aYcKp8K5Nqpxkjqwz68fUzGWXWfs4q7UL/9oGm0CLnKXssYBB8FW4ffWsQs1e+ IMrOTCNGhvvA6loK/doQTi3VTg8C4mzZvA1ryNrRNrw4t5kMj5w2MnRzNmk19SRrlruVmb Nj1Lw3vgx+/1uahYfONimCkaH9Gvn918uHqmKxXVuNoXJN4BMbU2buU4kAWtXQaolOFM5Q 6iHsO6J6at17P/51eprkbfUdkQiyytBA1NbkzVkHtwglbaD5/azbP7y4xSxA4N6DGhccCa qIT1fLFaSdgrvDwDBrCRsjsxFku1hcNn4u2THO+QysNOAEkyQzjrcnbzK/3lhQ== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=pass header.d=gmail.com header.s=20251104 header.b=MGnjPYvk; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mail01.ipfire.org: domain of valter.jansons@gmail.com designates 2607:f8b0:4864:20::42b as permitted sender) smtp.mailfrom=valter.jansons@gmail.com Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-8a05b210703so210656b3a.0 for ; Sun, 18 Oct 2026 05:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792328301; x=1792933101; darn=lists.ipfire.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=+anowpRIdpKX1P+sflLm8t8qqWiBxHqwj14+5UCq9sU=; b=MGnjPYvkRmawhmvPaFa/IejUH5Qj5mBSAGY4KG97c64n3PdmX5Bx6xNhKlTii3eRVk g0zWgEsBdEI9mHlIU+EBdvQ9wHnaKatnVESzeJIPlnccnFFG73fbXsY6qH/mcpCZTx2m 4jFiT2cn7QYnDKmLZs5HfLrMsj3x9TmICXar1XbMI9s0FKVWxn+yg5CWTJZMf4f6y+9p iTu9aWu5NxRWwSBpkpgAgT5HJ+ckSl4NonBjODfobaVCTGdL4vvm6R+KM0T0ek4EvBZA 2TUjyZGr0h37bcZBdUspt7klZ0Bp99TmluJXh5at8iwu7D5qFt9QHdor0Z9+OX0tQuyK kSvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792328301; x=1792933101; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=+anowpRIdpKX1P+sflLm8t8qqWiBxHqwj14+5UCq9sU=; b=tASfH44JIeyrRxgYeKFCBo6wTCvinAYcbGSv8O0cAp0NXF4kPSCVNKnlaLMFIs0ZRl p2pzf59DctGqUdo0MeYJtAtj9OvMK1dPWh5Q1o8G1POfj5Rr0mtaF0DD8UIj0GWi2E2V ZmcRmczpKZvUmUvnaysLQQJx6gwGxq+ydJ2KKDhL/NVUBtgU3V3O3Hk2G+wsM05V2TAe AFe8t3OYo2KZMg6CejWhJD7slimjpG4kdrZ3hVYm+H2PJzNCWqD9rIUwBqrAuxgZ4iyx lFPy/zm7130LaE72m8MIIHEerfh2UFeNqEXZZyUXEn6tuti/EO9Vx/U6sZwQz96ut5Ch b54g== X-Gm-Message-State: AFq9FYKJnu0lMeqO++FYHPsYcFH42MQo3dTKDhBP0rO6CGFJFueI8hJI kOlGwUAiNEDyunMsplJVZ5zejPgz1dR+m9Mo+7wB2Ol5Gdr1w1cKoUteMUfuu8g8 X-Gm-Gg: AYBFou2PRcioBHMUTVDOVWXBtOzFE3o7FfvTcBsW89WVxf9IiBMLLZdUzpAyfBPkrHj NX0GJ/MbvLNae2QCnNHbuPaE9pgnc1ZKzZ4XGg4bC/PB/QZp7WMWyTahbiB/Adu8Gbk0tI+rQ/c YB2fSmTh7c6Qug4x6L4vGPHX//1I7qVt50jRa+NA/7DY3mUypQV3SfOBmR+AXswgyxittOvcZ2W 1W69zyD6E39pYWnG95Zrz02JvyQ3S+YBZBG9onXc8NcHHCe5Esn06CDUuxknaHmE2RDaNst9k07 ilwd0P0UE21XTyR5G9v9CQ0YDX2hUXpkxS5kcuFj0mniAHec0HMQj2W3G3XyJuiDR6Y5KajNGKZ 1AU3GRqghTBtW6xB1RtFcu2XJc2YOtwQeMFYDh2FW77FqoQ5OTEqlwjNvRuZAPkXmmaOi5Ei5t3 NhuT8EgvWypt+NVe8CRaHQxoGn7gkJSWREA+10KdpnqN56iNnYZkfPu94W5J5/FyUr5K5xvRBtZ IdFwkOwclTTyIM= X-Received: by 2002:a05:6a00:4f96:b0:897:dda6:ad35 with SMTP id d2e1a72fcca58-8a04be6c651mr3622791b3a.41.1792328301359; Sun, 18 Oct 2026 05:58:21 -0700 (PDT) Received: from VT14-G5.localdomain ([221.146.12.107]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8a069fd957fsm142815b3a.14.2026.10.18.05.58.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Oct 2026 05:58:21 -0700 (PDT) From: Valters Jansons To: location@lists.ipfire.org Subject: [PATCH] debian: Package the Perl bindings Date: Sun, 18 Oct 2026 21:58:12 +0900 Message-ID: <20261018125812.160121-1-valter.jansons@gmail.com> X-Mailer: git-send-email 2.55.0 Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 X-Rspamd-Queue-Id: 4j6zHz2931z2ng X-Spamd-Result: default: False [-6.81 / 11.00]; BAYES_HAM(-3.00)[100.00%]; R_DKIM_ALLOW(-1.60)[gmail.com:s=20251104]; DKIM_REPUTATION(-0.97)[-0.97236796443149]; SPF_REPUTATION_HAM(-0.74)[-0.74123821725064]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_MISSING_CHARSET(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4864::/56]; R_DKIM_ALIGNED(-0.10)[strict]; MX_GOOD(-0.10)[gmail-smtp-in.l.google.com]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; IP_REPUTATION_HAM(0.00)[asn: 15169(-0.26), country: US(-0.01), ip: 2607:f8b0:4864:20::(-0.74)]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::42b:from]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ALIAS_RESOLVED(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[location@lists.ipfire.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[] X-Rspamd-Action: no action X-Rspamd-Server: mail01.haj.ipfire.org This commit adds a new liblocation-perl Debian package. For building, we cannot simply remove the `--disable-perl` flag, because Makefile.am would use the host architecture's Perl automatically. Instead, we use debhelper hooks with the perl_makemaker build system. For linking, we explicitly pass in LDFROM, as LIBS would get pulled into the RPATH by MakeMaker otherwise. The Perl tests are not run during cross-compilation, and only run on the host architecture, similar to the supplemental Lua tests already added. Signed-off-by: Valters Jansons --- This patch applies cleanly on top of the previously submitted Makefile patch, which added missing *.manpages files to EXTRA_DIST. If applied on current HEAD, only two lines are expected to be added to Makefile.am. Makefile.am | 2 ++ debian/control | 14 ++++++++++++++ debian/liblocation-perl.install | 1 + debian/liblocation-perl.manpages | 1 + debian/rules | 25 ++++++++++++++++++++++++- 5 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 debian/liblocation-perl.install create mode 100644 debian/liblocation-perl.manpages diff --git a/Makefile.am b/Makefile.am index c74b0cc..aa0f23b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1126,6 +1126,8 @@ EXTRA_DIST += \ debian/libloc1.symbols \ debian/libloc-dev.install \ debian/libloc-dev.manpages \ + debian/liblocation-perl.install \ + debian/liblocation-perl.manpages \ debian/location.install \ debian/location.manpages \ debian/location.postinst \ diff --git a/debian/control b/debian/control index c56584b..deb81f8 100644 --- a/debian/control +++ b/debian/control @@ -12,6 +12,8 @@ Build-Depends: lua-unit:native | lua-unit , lua5.1 , lua5.4 , + perl-xs-dev, + perl:native, libssl-dev, pkgconf, python3-all-dev, @@ -116,3 +118,15 @@ Description: ${source:Synopsis} (Lua bindings) ${source:Extended-Description} . This package provides the Lua bindings for libloc. + +Package: liblocation-perl +Architecture: any +Section: perl +Depends: + ${misc:Depends}, + ${perl:Depends}, + ${shlibs:Depends}, +Description: ${source:Synopsis} (Perl bindings) + ${source:Extended-Description} + . + This package provides the Perl bindings for libloc. diff --git a/debian/liblocation-perl.install b/debian/liblocation-perl.install new file mode 100644 index 0000000..b29dd98 --- /dev/null +++ b/debian/liblocation-perl.install @@ -0,0 +1 @@ +usr/lib/*/perl5 diff --git a/debian/liblocation-perl.manpages b/debian/liblocation-perl.manpages new file mode 100644 index 0000000..1f25cd5 --- /dev/null +++ b/debian/liblocation-perl.manpages @@ -0,0 +1 @@ +usr/share/man/man3/Location.3pm* diff --git a/debian/rules b/debian/rules index 99c2acf..fe03730 100755 --- a/debian/rules +++ b/debian/rules @@ -9,6 +9,12 @@ include /usr/share/dpkg/buildtools.mk # because LuaJIT, which PowerDNS uses, loads modules for Lua 5.1. LUA_EXTRA_VERSIONS = 5.1 +# If the Perl module were built by the Makefile.am, then it would use the build arch's Perl +# instead of properly cross-compiling. Therefore we add --disable-perl and use debhelper +# hooks. Linking is done using LDFROM instead of LIBS, as MakeMaker would pull LIBS into +# the RPATH of the module. +PERL_MM = --buildsystem=perl_makemaker --sourcedirectory=src/perl + # Build without the manual pages with the nodoc profile, which is needed to cross-compile, # because asciidoc cannot be installed for another architecture ifneq (,$(filter nodoc,$(DEB_BUILD_PROFILES) $(DEB_BUILD_OPTIONS))) @@ -30,6 +36,10 @@ export PYBUILD_TEST_ARGS=dh_auto_test %: dh $@ --buildsystem=pybuild +execute_after_dh_auto_configure: + dh_auto_configure $(PERL_MM) -- INC=-I$(CURDIR)/src LIBS= \ + 'LDFROM=$$(OBJECT) -L$(CURDIR)/src/.libs -lloc' + # The module does not link against Lua, which the program that loads it provides, # so that it does not pull in Lua 5.1 when it is being loaded by LuaJIT execute_after_dh_auto_build: @@ -40,13 +50,18 @@ execute_after_dh_auto_build: -o debian/lua$$version/location.so src/lua/*.c -Lsrc/.libs -lloc; \ done + dh_auto_build $(PERL_MM) + execute_after_dh_auto_install: set -e; for version in $(LUA_EXTRA_VERSIONS); do \ install -D -m 644 debian/lua$$version/location.so \ debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/lua/$$version/location.so; \ done -# Run the tests of the Lua module with all other versions, too, unless we cannot run them + dh_auto_install $(PERL_MM) --destdir=debian/tmp + +# Run the tests of the Lua module with all other versions and the Perl module, too, +# unless we cannot run them due to cross-compilation execute_after_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES))) ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH)) @@ -57,8 +72,16 @@ ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH)) TEST_SIGNING_KEY=$(CURDIR)/data/signing-key.pem \ lua$$version tests/lua/main.lua; \ done + + $(MAKE) testdata.db + LD_LIBRARY_PATH=$(CURDIR)/src/.libs \ + database=$(CURDIR)/testdata.db \ + keyfile=$(CURDIR)/examples/public-key.pem \ + dh_auto_test $(PERL_MM) endif endif execute_after_dh_auto_clean: rm -rf $(foreach version,$(LUA_EXTRA_VERSIONS),debian/lua$(version)) + + dh_auto_clean $(PERL_MM)