Bug#1003430: gkrellm-leds: reproducible-builds: /bin/sh dependent behavior in Makefile

2022-01-14 Thread Christoph Biedl
Control: tags 1003430 pending

Vagrant Cascadian wrote...

> The path that gkrellm-leds installs plugins into differs depending on
> weather /bin/sh points to bash or dash:
> 
>   
> https://tests.reproducible-builds.org/debian/rb-pkg/bookworm/amd64/gkrellm-leds.html

Ups. Thanks for spotting this. Will be fixed in the next upload which
might take some time. Ping me if you want that story resolved faster.

Christoph


signature.asc
Description: PGP signature


Bug#1003430: gkrellm-leds: reproducible-builds: /bin/sh dependent behavior in Makefile

2022-01-09 Thread Vagrant Cascadian
Source: gkrellm-leds
Severity: normal
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: shell
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

The path that gkrellm-leds installs plugins into differs depending on
weather /bin/sh points to bash or dash:

  
https://tests.reproducible-builds.org/debian/rb-pkg/bookworm/amd64/gkrellm-leds.html

In the md5sums file you have two different files included in the package:

  usr/lib/gkrellm2/plugins/gkleds.so
vs.
  
build/gkrellm-leds-0.8.0/debian/.debhelper/generated/_source/home/.gkrellm2/plugins/gkleds.so


The attached patch fixes this by removing the UID check in the Makefile,
which only behaves "correctly" when run under bash (when run under dash
$UID is unset).

Since the .deb package should always install into
/usr/lib/gkrellm2/plugins, regardless of the running UID, removing the
check seems appropriate, especially as "Rules-Requires-Root: no" is set
in debian/control.


With this patch applied, gkrellm-leds should build reproducibly on
tests.reproducible-builds.org!


Thanks for maintaining gkrellm-leds!


live well,
  vagrant
From 6c248d3351d4b2707b3022a4af3010910a77fb50 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian 
Date: Mon, 10 Jan 2022 03:44:11 +
Subject: [PATCH] Makefile: Disable broken UID check.

The UID check works when /bin/sh is bash, but not when /bin/sh is
dash.

This results in broken builds when /bin/sh is bash and built as
non-root, as gkleds.so and other files are installed to
BUILDPATH/debian/.debhelper/generated/_source/home/.gkrellm2/plugins/
instead of /usr/lib/gkrellm2/plugins/.

Ensure the package consistently installs into
/usr/lib/gkrellm2/plugins regardless of the operating UID or which
shell is configured as /bin/sh.
---
 Makefile | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index f988986..fd09b5e 100644
--- a/Makefile
+++ b/Makefile
@@ -46,9 +46,7 @@ clean:
 	rm -rf src/*~ src/\#*
 
 install : gkleds.so
-	@ if [ "$$UID" -ne 0 ]; \
-		then PLUGIN_DIR=$$HOME/.gkrellm2/plugins; \
-	elif [ -e /usr/bin/gkrellm ]; \
+	@ if [ -e /usr/bin/gkrellm ]; \
 		then PLUGIN_DIR=/usr/lib/gkrellm2/plugins; \
 	else \
 		PLUGIN_DIR=/usr/local/lib/gkrellm2/plugins; \
-- 
2.30.2



signature.asc
Description: PGP signature