summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2019-02-25 17:16:11 +0100
committerAndrej Shadura <andrewsh@debian.org>2019-12-11 14:10:31 +0100
commit255eb0bba759fa9a56907f1801af7772f22dfdac (patch)
treeca0dbc12b8e5b8f2642b45068eab83c17cc18b20
parent171535b0d3d4ffc8c3094bc11e277485aacf9527 (diff)
Fix FTCBFS
* cross.patch: Make compiler and install substitutable. * Let dh_auto_build pass a cross compiler to make. * Pass a non-stripping install to make install. brightd fails to cross build from source, because the upstream Makefile hard codes the build architecture compiler. For fixing that, we need to make it substitutable and substitute it (e.g. via dh_auto_build). It also uses install -s and thus the build architecture strip. That's generally a bad idea, because it breaks DEB_BUILD_OPTIONS=nostrip and generation of a -dbgsym package in addition to breaking cross compilation. Thus we also make INSTALL substitutable and pass a non-stripping install. The INSTALL assignment can be dropped in debhelper compatibility level 11. Closes: #923266
-rw-r--r--debian/patches/cross.patch25
-rw-r--r--debian/patches/series1
-rwxr-xr-xdebian/rules4
3 files changed, 28 insertions, 2 deletions
diff --git a/debian/patches/cross.patch b/debian/patches/cross.patch
new file mode 100644
index 0000000..68582cc
--- /dev/null
+++ b/debian/patches/cross.patch
@@ -0,0 +1,25 @@
+--- brightd-0.4.1.orig/Makefile
++++ brightd-0.4.1/Makefile
+@@ -1,3 +1,4 @@
++INSTALL ?= install
+ PREFIX=$(DESTDIR)/usr
+ BINDIR=bin/
+ #NO_X11=1 # (Uncomment this to disable X11 Support)
+@@ -14,14 +15,14 @@
+ all: brightd brightd.1
+
+ brightd: brightd.c
+- gcc $@.c $(CFLAGS) $(A_CFLAGS) -o $@
++ $(CC) $@.c $(CFLAGS) $(A_CFLAGS) -o $@
+
+ brightd.1:
+ sed -re 's/^\.nr no_x11 [01]/.nr no_x11 $(MAN_NO_X11)/' brightd.1.tpl > brightd.1
+
+ install:
+- install -Ds brightd $(PREFIX)/$(BINDIR)/brightd
+- install -D brightd.1 $(PREFIX)/share/man/man1/brightd.1
++ $(INSTALL) -Ds brightd $(PREFIX)/$(BINDIR)/brightd
++ $(INSTALL) -D brightd.1 $(PREFIX)/share/man/man1/brightd.1
+
+ uninstall:
+ rm $(PREFIX)/$(BINDIR)/brightd
diff --git a/debian/patches/series b/debian/patches/series
index 2f2fce5..0e6aad9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@
0003-Use-int-for-brightness-not-char.patch
0004-Reorder-gcc-arguments.patch
0005-Reword-the-contradiction-in-the-e-option-description.patch
+cross.patch
diff --git a/debian/rules b/debian/rules
index cf2f64a..99ca9d0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,10 +8,10 @@
dh $@
override_dh_auto_build:
- $(MAKE) CFLAGS="$(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS) $(shell dpkg-buildflags --get LDFLAGS)"
+ dh_auto_build -- CFLAGS="$(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS) $(shell dpkg-buildflags --get LDFLAGS)"
override_dh_auto_install:
- $(MAKE) DESTDIR=$(CURDIR)/debian/brightd install
+ dh_auto_install -- INSTALL='install --strip-program=true'
chmod 4755 $(CURDIR)/debian/brightd/usr/bin/brightd
install -m 0644 -D debian/brightd-xsession $(CURDIR)/debian/brightd/etc/X11/Xsession.d/90brightd