2 changed files with 185 additions and 0 deletions
@ -0,0 +1,106 @@
|
||||
Index: Makefile
|
||||
--- Makefile.orig 2014-12-19 09:51:32.000000000 +0100
|
||||
+++ Makefile 2015-01-25 10:27:12.318973899 +0100
|
||||
@@ -88,7 +88,6 @@
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#make install is validated only for Linux, OSX, kFreeBSD and Hurd targets
|
||||
-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU))
|
||||
|
||||
install:
|
||||
@cd $(LZ4DIR); $(MAKE) -e install
|
||||
@@ -133,4 +132,3 @@
|
||||
prg-travis:
|
||||
@cd $(PRGDIR); $(MAKE) -e test-travis
|
||||
|
||||
-endif
|
||||
Index: lib/Makefile
|
||||
--- lib/Makefile.orig 2014-12-19 09:51:32.000000000 +0100
|
||||
+++ lib/Makefile 2015-01-25 10:27:12.318973899 +0100
|
||||
@@ -61,19 +61,13 @@
|
||||
SHARED_EXT_VER = $(SHARED_EXT).$(LIBVER)
|
||||
endif
|
||||
|
||||
-default: liblz4
|
||||
+default: all
|
||||
|
||||
-all: liblz4
|
||||
+all: liblz4 liblz4.pc
|
||||
|
||||
liblz4: lz4.c lz4hc.c lz4frame.c xxhash.c
|
||||
- @echo compiling static library
|
||||
- @$(CC) $(CPPFLAGS) $(CFLAGS) -c $^
|
||||
- @$(AR) rcs liblz4.a lz4.o lz4hc.o lz4frame.o xxhash.o
|
||||
- @echo compiling dynamic library $(LIBVER)
|
||||
- @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared $^ -fPIC $(SONAME_FLAGS) -o $@.$(SHARED_EXT_VER)
|
||||
- @echo creating versioned links
|
||||
- @ln -sf $@.$(SHARED_EXT_VER) $@.$(SHARED_EXT_MAJOR)
|
||||
- @ln -sf $@.$(SHARED_EXT_VER) $@.$(SHARED_EXT)
|
||||
+ $(CC) $(CPPFLAGS) $(CFLAGS) -c $^
|
||||
+ $(AR) rcs liblz4.a lz4.o lz4hc.o lz4frame.o xxhash.o
|
||||
|
||||
clean:
|
||||
@rm -f core *.o *.a *.$(SHARED_EXT) *.$(SHARED_EXT).* liblz4.pc
|
||||
@@ -82,7 +76,6 @@
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#make install is validated only for Linux, OSX, kFreeBSD and Hurd targets
|
||||
-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU))
|
||||
|
||||
liblz4.pc: liblz4.pc.in Makefile
|
||||
@echo creating pkgconfig
|
||||
@@ -92,11 +85,8 @@
|
||||
-e 's|@VERSION@|$(VERSION)|' \
|
||||
$< >$@
|
||||
|
||||
-install: liblz4 liblz4.pc
|
||||
+install:
|
||||
@install -d -m 755 $(DESTDIR)$(LIBDIR)/pkgconfig/ $(DESTDIR)$(INCLUDEDIR)/
|
||||
- @install -m 755 liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_VER)
|
||||
- @cp -a liblz4.$(SHARED_EXT_MAJOR) $(DESTDIR)$(LIBDIR)
|
||||
- @cp -a liblz4.$(SHARED_EXT) $(DESTDIR)$(LIBDIR)
|
||||
@cp -a liblz4.pc $(DESTDIR)$(LIBDIR)/pkgconfig/
|
||||
@install -m 644 liblz4.a $(DESTDIR)$(LIBDIR)/liblz4.a
|
||||
@install -m 644 lz4.h $(DESTDIR)$(INCLUDEDIR)/lz4.h
|
||||
@@ -114,4 +104,3 @@
|
||||
@[ -f $(DESTDIR)$(INCLUDEDIR)/lz4hc.h ] && rm -f $(DESTDIR)$(INCLUDEDIR)/lz4hc.h
|
||||
@echo lz4 libraries successfully uninstalled
|
||||
|
||||
-endif
|
||||
Index: programs/Makefile
|
||||
--- programs/Makefile.orig 2014-12-19 09:51:32.000000000 +0100
|
||||
+++ programs/Makefile 2015-01-25 10:27:58.710844304 +0100
|
||||
@@ -40,7 +40,7 @@
|
||||
FLAGS = -I../lib $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
|
||||
|
||||
BINDIR=$(PREFIX)/bin
|
||||
-MANDIR=$(PREFIX)/share/man/man1
|
||||
+MANDIR=$(PREFIX)/man/man1
|
||||
LZ4DIR=../lib
|
||||
|
||||
TEST_FILES = COPYING
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
default: lz4 lz4c
|
||||
|
||||
-all: lz4 lz4c lz4c32 fullbench fullbench32 fuzzer fuzzer32 frametest frametest32 datagen
|
||||
+all: lz4 lz4c
|
||||
|
||||
lz4: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c bench.c lz4io.c lz4cli.c
|
||||
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
||||
@@ -108,9 +108,8 @@
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#make install is validated only for Linux, OSX, kFreeBSD and Hurd targets
|
||||
-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU))
|
||||
|
||||
-install: lz4 lz4c
|
||||
+install:
|
||||
@echo Installing binaries
|
||||
@install -d -m 755 $(DESTDIR)$(BINDIR)/ $(DESTDIR)$(MANDIR)/
|
||||
@install -m 755 lz4$(EXT) $(DESTDIR)$(BINDIR)/lz4$(EXT)
|
||||
@@ -203,4 +202,3 @@
|
||||
test-mem32: lz4c32 datagen
|
||||
# unfortunately, valgrind doesn't seem to work with non-native binary. If someone knows how to do a valgrind-test on a 32-bits exe with a 64-bits system...
|
||||
|
||||
-endif
|
||||
@ -0,0 +1,79 @@
|
||||
## |
||||
## lz4.spec -- OpenPKG RPM Package Specification |
||||
## Copyright (c) 2000-2015 OpenPKG Foundation e.V. <http://openpkg.net/> |
||||
## |
||||
## Permission to use, copy, modify, and distribute this software for |
||||
## any purpose with or without fee is hereby granted, provided that |
||||
## the above copyright notice and this permission notice appear in all |
||||
## copies. |
||||
## |
||||
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
||||
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
||||
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
||||
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
||||
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
||||
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
||||
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
||||
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
||||
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
||||
## SUCH DAMAGE. |
||||
## |
||||
|
||||
# package information |
||||
Name: lz4 |
||||
Summary: High-Performance Compression Library |
||||
URL: https://code.google.com/p/lz4/ |
||||
Vendor: Mr. Template |
||||
Packager: OpenPKG Foundation e.V. |
||||
Distribution: OpenPKG Community |
||||
Class: EVAL |
||||
Group: Compression |
||||
License: BSD |
||||
Version: 127 |
||||
Release: 20150125 |
||||
|
||||
# list of sources |
||||
Source0: https://github.com/Cyan4973/lz4/archive/r%{version}.tar.gz |
||||
Patch0: lz4.patch |
||||
|
||||
# build information |
||||
BuildPreReq: OpenPKG, openpkg >= 20140101, gcc, make |
||||
PreReq: OpenPKG, openpkg >= 20140101 |
||||
|
||||
%description |
||||
LZ4 is a very fast lossless compression algorithm, providing |
||||
compression speed at 400 MB/s per core, with near-linear scalability |
||||
for multi-threaded applications. It also features an extremely fast |
||||
decoder, with speed in multiple GB/s per core, typically reaching |
||||
RAM speed limits on multi-core systems. LZ4 is used in the popular |
||||
ZFS filesystem. |
||||
|
||||
%track |
||||
prog lz4 = { |
||||
version = %{version} |
||||
url = https://github.com/Cyan4973/lz4/releases/tag/r127 |
||||
regex = r(\d+)\.tar\.gz |
||||
} |
||||
|
||||
%prep |
||||
%setup -q -n lz4-r%{version} |
||||
%patch -p0 |
||||
|
||||
%build |
||||
%{l_make} %{l_mflags} all \ |
||||
CC="%{l_cc}" \ |
||||
CFLAGS="%{l_cflags -O}" |
||||
|
||||
%install |
||||
%{l_make} %{l_mflags} install \ |
||||
DESTDIR=$RPM_BUILD_ROOT \ |
||||
PREFIX=%{l_prefix} |
||||
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
||||
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} |
||||
|
||||
%files -f files |
||||
|
||||
%clean |
||||
|
||||
Loading…
Reference in new issue