Source: libs3
Version: 2.0-5
Tags: patch upstream
User: [email protected]
Usertags: ftcbfs
libs3 fails to cross build from source, because the upstream GNUmakefile
hard codes the build architecture compiler as "gcc". Making it
substitutable fixes the build step as dh_auto_build supplies a suitable
substitution. The install step fails, because it also passes -s to
install to perform stripping. Doing so also breaks
DEB_BUILD_OPTIONS=nostrip as well as generating -dbgsym packages. It is
best to skip such stripping and defer it to dh_strip instead. Indeed,
dh_auto_install supplies a INSTALL subtitution with --stip-program=true.
So all that is needed here is also making install substitutable. I'm
attaching a patch for your convenience.
Helmut
--- libs3-2.0.orig/GNUmakefile
+++ libs3-2.0/GNUmakefile
@@ -95,6 +95,8 @@
# --------------------------------------------------------------------------
# Acquire configuration information for libraries that libs3 depends upon
+CC ?= gcc
+INSTALL ?= install
PKG_CONFIG ?= pkg-config
ifndef CURL_LIBS
@@ -159,11 +161,11 @@
.PHONY: install
install: exported
$(QUIET_ECHO) $(DESTDIR)/bin/s3: Installing executable
- $(VERBOSE_SHOW) install -Dps -m u+rwx,go+rx $(BUILD)/bin/s3 \
+ $(VERBOSE_SHOW) $(INSTALL) -Dps -m u+rwx,go+rx $(BUILD)/bin/s3 \
$(DESTDIR)/bin/s3
$(QUIET_ECHO) \
$(DESTDIR)/lib/libs3.so.$(LIBS3_VER): Installing shared library
- $(VERBOSE_SHOW) install -Dps -m u+rw,go+r \
+ $(VERBOSE_SHOW) $(INSTALL) -Dps -m u+rw,go+r \
$(BUILD)/lib/libs3.so.$(LIBS3_VER_MAJOR) \
$(DESTDIR)/lib/libs3.so.$(LIBS3_VER)
$(QUIET_ECHO) \
@@ -173,10 +175,10 @@
$(QUIET_ECHO) $(DESTDIR)/lib/libs3.so: Linking shared library
$(VERBOSE_SHOW) ln -sf libs3.so.$(LIBS3_VER_MAJOR) $(DESTDIR)/lib/libs3.so
$(QUIET_ECHO) $(DESTDIR)/lib/libs3.a: Installing static library
- $(VERBOSE_SHOW) install -Dp -m u+rw,go+r $(BUILD)/lib/libs3.a \
+ $(VERBOSE_SHOW) $(INSTALL) -Dp -m u+rw,go+r $(BUILD)/lib/libs3.a \
$(DESTDIR)/lib/libs3.a
$(QUIET_ECHO) $(DESTDIR)/include/libs3.h: Installing header
- $(VERBOSE_SHOW) install -Dp -m u+rw,go+r $(BUILD)/include/libs3.h \
+ $(VERBOSE_SHOW) $(INSTALL) -Dp -m u+rw,go+r $(BUILD)/include/libs3.h \
$(DESTDIR)/include/libs3.h
@@ -201,18 +203,18 @@
$(BUILD)/obj/%.o: src/%.c
$(QUIET_ECHO) $@: Compiling object
@ mkdir -p $(dir $(BUILD)/dep/$<)
- @ gcc $(CFLAGS) -M -MG -MQ $@ -DCOMPILINGDEPENDENCIES \
+ @ $(CC) $(CFLAGS) -M -MG -MQ $@ -DCOMPILINGDEPENDENCIES \
-o $(BUILD)/dep/$(<:%.c=%.d) -c $<
@ mkdir -p $(dir $@)
- $(VERBOSE_SHOW) gcc $(CFLAGS) -o $@ -c $<
+ $(VERBOSE_SHOW) $(CC) $(CFLAGS) -o $@ -c $<
$(BUILD)/obj/%.do: src/%.c
$(QUIET_ECHO) $@: Compiling dynamic object
@ mkdir -p $(dir $(BUILD)/dep/$<)
- @ gcc $(CFLAGS) -M -MG -MQ $@ -DCOMPILINGDEPENDENCIES \
+ @ $(CC) $(CFLAGS) -M -MG -MQ $@ -DCOMPILINGDEPENDENCIES \
-o $(BUILD)/dep/$(<:%.c=%.dd) -c $<
@ mkdir -p $(dir $@)
- $(VERBOSE_SHOW) gcc $(CFLAGS) -fpic -fPIC -o $@ -c $<
+ $(VERBOSE_SHOW) $(CC) $(CFLAGS) -fpic -fPIC -o $@ -c $<
# --------------------------------------------------------------------------
@@ -232,7 +234,7 @@
$(LIBS3_SHARED): $(LIBS3_SOURCES:%.c=$(BUILD)/obj/%.do)
$(QUIET_ECHO) $@: Building shared library
@ mkdir -p $(dir $@)
- $(VERBOSE_SHOW) gcc -shared -Wl,-soname,libs3.so.$(LIBS3_VER_MAJOR) \
+ $(VERBOSE_SHOW) $(CC) -shared -Wl,-soname,libs3.so.$(LIBS3_VER_MAJOR) \
-o $@ $^ $(LDFLAGS)
$(LIBS3_STATIC): $(LIBS3_SOURCES:%.c=$(BUILD)/obj/%.o)
@@ -250,7 +252,7 @@
$(BUILD)/bin/s3: $(BUILD)/obj/s3.o $(LIBS3_SHARED)
$(QUIET_ECHO) $@: Building executable
@ mkdir -p $(dir $@)
- $(VERBOSE_SHOW) gcc -o $@ $^ $(LDFLAGS)
+ $(VERBOSE_SHOW) $(CC) -o $@ $^ $(LDFLAGS)
# --------------------------------------------------------------------------
@@ -274,7 +276,7 @@
$(BUILD)/bin/testsimplexml: $(BUILD)/obj/testsimplexml.o $(LIBS3_STATIC)
$(QUIET_ECHO) $@: Building executable
@ mkdir -p $(dir $@)
- $(VERBOSE_SHOW) gcc -o $@ $^ $(LIBXML2_LIBS)
+ $(VERBOSE_SHOW) $(CC) -o $@ $^ $(LIBXML2_LIBS)
# --------------------------------------------------------------------------