From fb8c9d87843d121a7d8e011f6a4b3ae41a31504ea4c41f30c3c6ef7a30c2059b Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 2 Apr 2016 23:45:52 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Archiving/lz4?expand=0&rev=20 --- lz4-use-shlib.diff | 48 ++++++++++++++++++++++++++++++++++++++++------ lz4.spec | 10 ++++++---- 2 files changed, 48 insertions(+), 10 deletions(-) diff --git a/lz4-use-shlib.diff b/lz4-use-shlib.diff index 6285818..fe5edb7 100644 --- a/lz4-use-shlib.diff +++ b/lz4-use-shlib.diff @@ -4,14 +4,23 @@ Date: 2014-10-01 14:23:22.000000000 +0200 build: make programs use liblz too instead of duplicating object code. --- - programs/Makefile | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) + programs/Makefile | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) Index: lz4-r131/programs/Makefile =================================================================== --- lz4-r131.orig/programs/Makefile +++ lz4-r131/programs/Makefile -@@ -72,11 +72,11 @@ bins: lz4 lz4c fullbench fuzzer frametes +@@ -40,7 +40,7 @@ DESTDIR?= + PREFIX ?= /usr/local + CFLAGS ?= -O3 + CFLAGS += -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-qual -Wcast-align -Wstrict-prototypes -pedantic -DLZ4_VERSION=\"$(RELEASE)\" +-FLAGS := -I../lib $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) ++FLAGS := -DXXH_NAMESPACE=LZ4_ -I../lib $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) + + BINDIR := $(PREFIX)/bin + MANDIR := $(PREFIX)/share/man/man1 +@@ -72,32 +72,32 @@ bins: lz4 lz4c fullbench fuzzer frametes all: bins m32 @@ -20,10 +29,37 @@ Index: lz4-r131/programs/Makefile +lz4: bench.c lz4io.c lz4cli.c + $(CC) $(FLAGS) $^ -o $@$(EXT) -L${LZ4DIR} -llz4 --lz4c : $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c bench.c lz4io.c lz4cli.c + lz4c : $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c bench.c lz4io.c lz4cli.c - $(CC) $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT) -+lz4c : bench.c lz4io.c lz4cli.c + $(CC) $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT) -L${LZ4DIR} -llz4 lz4c32: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c bench.c lz4io.c lz4cli.c - $(CC) -m32 $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT) +- $(CC) -m32 $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT) ++ $(CC) -m32 $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT) -L${LZ4DIR} -llz4 + + fullbench : $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c fullbench.c +- $(CC) $(FLAGS) $^ -o $@$(EXT) ++ $(CC) $(FLAGS) $^ -o $@$(EXT) -L${LZ4DIR} -llz4 + + fullbench32: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c fullbench.c +- $(CC) -m32 $(FLAGS) $^ -o $@$(EXT) ++ $(CC) -m32 $(FLAGS) $^ -o $@$(EXT) -L${LZ4DIR} -llz4 + + fuzzer : $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/xxhash.c fuzzer.c +- $(CC) $(FLAGS) $^ -o $@$(EXT) ++ $(CC) $(FLAGS) $^ -o $@$(EXT) -L${LZ4DIR} -llz4 + + fuzzer32: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/xxhash.c fuzzer.c +- $(CC) -m32 $(FLAGS) $^ -o $@$(EXT) ++ $(CC) -m32 $(FLAGS) $^ -o $@$(EXT) -L${LZ4DIR} -llz4 + + frametest: $(LZ4DIR)/lz4frame.c $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/xxhash.c frametest.c +- $(CC) $(FLAGS) $^ -o $@$(EXT) ++ $(CC) $(FLAGS) $^ -o $@$(EXT) -L${LZ4DIR} -llz4 + + frametest32: $(LZ4DIR)/lz4frame.c $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/xxhash.c frametest.c +- $(CC) -m32 $(FLAGS) $^ -o $@$(EXT) ++ $(CC) -m32 $(FLAGS) $^ -o $@$(EXT) -L${LZ4DIR} -llz4 + + datagen : datagen.c datagencli.c + $(CC) $(FLAGS) $^ -o $@$(EXT) diff --git a/lz4.spec b/lz4.spec index fc86476..9418c4d 100644 --- a/lz4.spec +++ b/lz4.spec @@ -75,14 +75,16 @@ applications that want to make use of liblz4. %build # Goddammit, lz4 perl -i -pe 's{^\t@}{\t}g' Makefile */Makefile - -make -C lib %{?_smp_mflags} CFLAGS="%optflags" -make -C programs %{?_smp_mflags} CFLAGS="%optflags" lz4 lz4c +# don't bother building here, because make install builds it again - unconditionally :-( %install -make install DESTDIR="%buildroot" PREFIX="%_prefix" LIBDIR="%_libdir" +make install CFLAGS="%optflags -DXXH_NAMESPACE=LZ4_" \ + DESTDIR="%buildroot" PREFIX="%_prefix" LIBDIR="%_libdir" rm -f "%buildroot/%_libdir"/*.a +%check +LD_LIBRARY_PATH="%buildroot/%_libdir" ldd -r "%buildroot/%_bindir/lz4" + %post -n %lname -p /sbin/ldconfig %postun -n %lname -p /sbin/ldconfig