From 04fd1ed1d00f52962bf4857a769a4d3a3549f3b7 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Thu, 22 Sep 2016 23:54:46 +0100 Subject: dev-libs/libslz: Move from sys-libs, add patches for shared lib Package-Manager: portage-2.2.28 --- dev-libs/libslz/Manifest | 13 +++ .../files/1.0.0-build-add-a-gitignore-files.patch | 21 +++++ ...-tools-target-to-build-zend-and-zdec-only.patch | 22 +++++ ...build-add-targets-to-build-shared-library.patch | 94 ++++++++++++++++++++++ ...-users-to-install-.a-in-other-directory-t.patch | 36 +++++++++ ...1.0.0-build-install-zdec-in-install-tools.patch | 23 ++++++ ...0.0-build-reduce-library-name-duplication.patch | 33 ++++++++ ...e-DCONFIG_REGPARM-CFLAGS-since-it-s-not-u.patch | 23 ++++++ ...-specify-destination-file-for-consistency.patch | 26 ++++++ ...lit-install-target-in-per-purpose-targets.patch | 42 ++++++++++ ...ntermediate-static-and-tools-targets-for-.patch | 23 ++++++ dev-libs/libslz/libslz-1.0.0.ebuild | 55 +++++++++++++ dev-libs/libslz/metadata.xml | 16 ++++ 13 files changed, 427 insertions(+) create mode 100644 dev-libs/libslz/Manifest create mode 100644 dev-libs/libslz/files/1.0.0-build-add-a-gitignore-files.patch create mode 100644 dev-libs/libslz/files/1.0.0-build-add-a-tools-target-to-build-zend-and-zdec-only.patch create mode 100644 dev-libs/libslz/files/1.0.0-build-add-targets-to-build-shared-library.patch create mode 100644 dev-libs/libslz/files/1.0.0-build-allow-users-to-install-.a-in-other-directory-t.patch create mode 100644 dev-libs/libslz/files/1.0.0-build-install-zdec-in-install-tools.patch create mode 100644 dev-libs/libslz/files/1.0.0-build-reduce-library-name-duplication.patch create mode 100644 dev-libs/libslz/files/1.0.0-build-remove-DCONFIG_REGPARM-CFLAGS-since-it-s-not-u.patch create mode 100644 dev-libs/libslz/files/1.0.0-build-specify-destination-file-for-consistency.patch create mode 100644 dev-libs/libslz/files/1.0.0-build-split-install-target-in-per-purpose-targets.patch create mode 100644 dev-libs/libslz/files/1.0.0-build-use-intermediate-static-and-tools-targets-for-.patch create mode 100644 dev-libs/libslz/libslz-1.0.0.ebuild create mode 100644 dev-libs/libslz/metadata.xml (limited to 'dev-libs') diff --git a/dev-libs/libslz/Manifest b/dev-libs/libslz/Manifest new file mode 100644 index 00000000..b1639a07 --- /dev/null +++ b/dev-libs/libslz/Manifest @@ -0,0 +1,13 @@ +AUX 1.0.0-build-add-a-gitignore-files.patch 461 SHA256 50a847182837ecb21b1efc7c30aaf93f503071dd9f93e6246837ba739b79a5d7 WHIRLPOOL ba438fd40353e0952f6ec4a1967de8032e016fb6f4d6e84565d407e08ca9d857b347d9c5e90d75df969aa662d40d023c85b112e045c0957e5d9fb775acde257f +AUX 1.0.0-build-add-a-tools-target-to-build-zend-and-zdec-only.patch 521 SHA256 5b742b9efdad093ba089db98e2d152036a917b006987a6214ff481148aafedc3 WHIRLPOOL 64fafabb4f6231c676632e621b080d6de71b15eaa68050e574919fe7be589669c077620b3037ef0a9848cb08fcc4d1712777c50df3a36d2ccad0df58101445cf +AUX 1.0.0-build-add-targets-to-build-shared-library.patch 2646 SHA256 3231727eb4506c82cc4cdaea577751e98c32910ded9cb486284a8697e9cc436a WHIRLPOOL 7f63558503bf58cceb347fd44c61e7fb640944167b1115e793ff67580a2af13bb59e7bd5d9e311761fd0006139ce4a4366ac8826e47875048c186248e6231d8a +AUX 1.0.0-build-allow-users-to-install-.a-in-other-directory-t.patch 1445 SHA256 994c194933b305a7e81cf5f07459c77c4075badad3df727298b84cbceb29742d WHIRLPOOL 4ecf945fedb866cb401b814c7ae10a03cf9110e805497d792d0c984dc75f21177b02d92a0276a1235851e9ce58c536b0f1b0e446996283636a79fe61411331c0 +AUX 1.0.0-build-install-zdec-in-install-tools.patch 704 SHA256 2ba515ab6f3ae0ae9a98336993c75999fbe17acc87f402d9da1cbde92e611621 WHIRLPOOL beb040aa8d614de31459d5dd60feeec4449815a1cd415042f5b22de4ea52da3828b4ce75e3ff218ab177cef9135071bdc42ab1d6cee67b176427b78bfd5222d3 +AUX 1.0.0-build-reduce-library-name-duplication.patch 966 SHA256 28ee14246f6e40cf088e6b64d9a22bd22477aff719bf181127c3f5e2157a6d0f WHIRLPOOL 9d08b15d5e6b67c326bd1bc8068a526cf7af9658c64c1b60ebbfa3eddc1c5999e0ba72e1e2882ea5baa7a51e3188f056b173c55019cdb3b2d761046bad20fc07 +AUX 1.0.0-build-remove-DCONFIG_REGPARM-CFLAGS-since-it-s-not-u.patch 638 SHA256 15532e5d0a24464446b21c420c5282a53eca93da243a15f441c14c381bb4b0e4 WHIRLPOOL e08dd5a0bb302b80fd5a77cce46c3be363821d4df7cadd8718d650c3aab739ca758fcb58f831b22e18e49bcb2a43e24fb09a75e40d3c3b1d4829f6bb3ade1329 +AUX 1.0.0-build-specify-destination-file-for-consistency.patch 1452 SHA256 4e8c54b1f552c17655a06636ff9344b072a2da9740081712877ac4de400c1751 WHIRLPOOL 3324dd4200f327a240b104987fcc41410dac548ea2b9db1e8a852c5c6cca83a3fb2a2efbb50a68c71e4825ef9a250f828ad82b6dd22a0bf5353634ab7f67443c +AUX 1.0.0-build-split-install-target-in-per-purpose-targets.patch 1704 SHA256 d311defb87a5831881f1766d1a8f4273561460e17d3fcd22d436ca112025975e WHIRLPOOL ab9a539193d0f9b112a0a1a4050fc0b890d09ac4373b25d1660bd947384e77b6c5c2a9c9e9982e3b5e8e590076c54d2a420cfa0da0ddf0f7b95807685639b522 +AUX 1.0.0-build-use-intermediate-static-and-tools-targets-for-.patch 619 SHA256 e9e53ab09ef1a6f7952908348ef66b8b61fdf3770d3c181a61b36743d6111086 WHIRLPOOL ed87bc39fa66d3d12bf51850f2373022c833ab29651ba8ce979b2951d5fc5c36c6cdffe9b33da9dca2be488398a954518df20de565096dfd34b8447b3d6cd5b2 +DIST libslz-1.0.0.tar.gz 146155 SHA256 4696da81bc4ac5ec5bbc36a62c168bdca4d35f4fbe63da76b2d9cf54be857a45 WHIRLPOOL d54b53f281e88e7c8fd4b39ef86b5b3d5d6a9d3073ea58fccbc8dedf6f70f7504703c52e54059a3832f07e1aaf33fa243b29f5f6bf81118923892de0819572fd +EBUILD libslz-1.0.0.ebuild 1603 SHA256 fd3b4bfedd2a3aad4f10c749cc202d0a64d09ca3fba37419948141b29df5fc2d WHIRLPOOL 79a4722dafb032f3a83d646ac9e089344631a5a4c93497dc0fc9234949f293801608cfefbfa2778e70843a2d20fef386d0978f1a2066aa9492b266e0d0b87a2c +MISC metadata.xml 1060 SHA256 3f7f86009eebc70cf0699b1dfa17285f6d4bd24835a12dc8411c7e28e0ad83fd WHIRLPOOL c33dbb73b7cdffa29f148900dc2dbd6a7fc34f8cbc3f62ece5298d68da01242df37c21df62f6b9cb2a13a6305227907050b364de5835a747444fdce02cb394ea diff --git a/dev-libs/libslz/files/1.0.0-build-add-a-gitignore-files.patch b/dev-libs/libslz/files/1.0.0-build-add-a-gitignore-files.patch new file mode 100644 index 00000000..ba1a82e2 --- /dev/null +++ b/dev-libs/libslz/files/1.0.0-build-add-a-gitignore-files.patch @@ -0,0 +1,21 @@ +From 1a2644bbba500a43ba662ac7eb028ede0d2b327f Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Thu, 22 Sep 2016 23:13:54 +0100 +Subject: [PATCH 01/10] build: add a gitignore files + +--- + .gitignore | 5 +++++ + 1 file changed, 5 insertions(+) + create mode 100644 .gitignore + +diff --git a/.gitignore b/.gitignore +new file mode 100644 +index 000000000000..533d88e5eb2f +--- /dev/null ++++ b/.gitignore +@@ -0,0 +1,5 @@ ++*.o ++*.a ++ ++zdec ++zenc diff --git a/dev-libs/libslz/files/1.0.0-build-add-a-tools-target-to-build-zend-and-zdec-only.patch b/dev-libs/libslz/files/1.0.0-build-add-a-tools-target-to-build-zend-and-zdec-only.patch new file mode 100644 index 00000000..7f83d4ac --- /dev/null +++ b/dev-libs/libslz/files/1.0.0-build-add-a-tools-target-to-build-zend-and-zdec-only.patch @@ -0,0 +1,22 @@ +From 1c85ac8254ce7d17c7017e727f913e2b61b06fe1 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Thu, 22 Sep 2016 02:12:39 +0100 +Subject: [PATCH 03/10] build: add a tools target to build zend and zdec only + +--- + Makefile | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Makefile b/Makefile +index ff17d31d183f..217d7d4447f8 100644 +--- a/Makefile ++++ b/Makefile +@@ -32,6 +32,8 @@ all: $(BINS) $(STATIC) + + static: $(STATIC) + ++tools: $(BINS) ++ + zdec: src/zdec.o + $(LD) $(LDFLAGS) -o $@ $^ + diff --git a/dev-libs/libslz/files/1.0.0-build-add-targets-to-build-shared-library.patch b/dev-libs/libslz/files/1.0.0-build-add-targets-to-build-shared-library.patch new file mode 100644 index 00000000..69bd9178 --- /dev/null +++ b/dev-libs/libslz/files/1.0.0-build-add-targets-to-build-shared-library.patch @@ -0,0 +1,94 @@ +From 3f52b019c59af8b1295c138af6dc939d8a5b05c5 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Thu, 22 Sep 2016 02:17:31 +0100 +Subject: [PATCH 10/10] build: add targets to build shared library + +--- + .gitignore | 2 ++ + Makefile | 26 +++++++++++++++++++++++--- + 2 files changed, 25 insertions(+), 3 deletions(-) + +diff --git a/.gitignore b/.gitignore +index 533d88e5eb2f..bebea8bce2c7 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -1,5 +1,7 @@ + *.o + *.a ++*.so ++*.so.* + + zdec + zenc +diff --git a/Makefile b/Makefile +index 50b22ca579ca..093c75968c8c 100644 +--- a/Makefile ++++ b/Makefile +@@ -11,6 +11,7 @@ CPU_CFLAGS := -fomit-frame-pointer + DEB_CFLAGS := -Wall -g + DEF_CFLAGS := + USR_CFLAGS := ++LIB_CFLAGS := -fPIC + INC_CFLAGS := -I$(TOPDIR)/include + CFLAGS := $(OPT_CFLAGS) $(CPU_CFLAGS) $(DEB_CFLAGS) $(DEF_CFLAGS) $(USR_CFLAGS) $(INC_CFLAGS) + +@@ -24,14 +25,18 @@ AR := $(CROSS_COMPILE)ar + STRIP := $(CROSS_COMPILE)strip + BINS := zdec zenc + STATIC := libslz.a ++SHARED := libslz.so ++SONAME := $(SHARED).1 + OBJS := + OBJS += $(patsubst %.c,%.o,$(wildcard src/*.c)) + OBJS += $(patsubst %.S,%.o,$(wildcard src/*.S)) + +-all: static tools ++all: static shared tools + + static: $(STATIC) + ++shared: $(SHARED) ++ + tools: $(BINS) + + zdec: src/zdec.o +@@ -43,10 +48,19 @@ zenc: src/zenc.o src/slz.o + $(STATIC): src/slz.o + $(AR) rv $@ $^ + ++$(SONAME): src/slz-pic.o ++ $(LD) -shared $(LDFLAGS) -Wl,-soname,$@ -o $@ $^ ++ ++$(SHARED): $(SONAME) ++ ln -sf $^ $@ ++ + %.o: %.c + $(CC) $(CFLAGS) -o $@ -c $^ + +-install: install-headers install-static install-tools ++%-pic.o: %.c ++ $(CC) $(CFLAGS) $(LIB_CFLAGS) -o $@ -c $< ++ ++install: install-headers install-static install-shared install-tools + + install-headers: + [ -d "$(DESTDIR)$(PREFIX)/include/." ] || mkdir -p -m 0755 $(DESTDIR)$(PREFIX)/include +@@ -58,6 +72,12 @@ install-static: static + cp $(STATIC) $(DESTDIR)$(PREFIX)/$(LIBDIR)/$(STATIC) + chmod 644 $(DESTDIR)$(PREFIX)/$(LIBDIR)/$(STATIC) + ++install-shared: shared ++ [ -d "$(DESTDIR)$(PREFIX)/$(LIBDIR)/." ] || mkdir -p -m 0755 $(DESTDIR)$(PREFIX)/$(LIBDIR) ++ cp $(SONAME) $(DESTDIR)$(PREFIX)/$(LIBDIR)/$(SONAME) ++ cp -P $(SHARED) $(DESTDIR)$(PREFIX)/$(LIBDIR)/$(SHARED) ++ chmod 644 $(DESTDIR)$(PREFIX)/$(LIBDIR)/$(SONAME) ++ + install-tools: tools + $(STRIP) zenc + [ -d "$(DESTDIR)$(PREFIX)/bin/." ] || mkdir -p -m 0755 $(DESTDIR)$(PREFIX)/bin +@@ -67,4 +87,4 @@ install-tools: tools + chmod 755 $(DESTDIR)$(PREFIX)/bin/zenc + + clean: +- -rm -f $(BINS) $(OBJS) $(STATIC) *.[oa] *~ */*.[oa] */*~ ++ -rm -f $(BINS) $(OBJS) $(STATIC) $(SHARED) *.[oa] *.so *.so.* *~ */*.[oa] */*~ diff --git a/dev-libs/libslz/files/1.0.0-build-allow-users-to-install-.a-in-other-directory-t.patch b/dev-libs/libslz/files/1.0.0-build-allow-users-to-install-.a-in-other-directory-t.patch new file mode 100644 index 00000000..69ae0e73 --- /dev/null +++ b/dev-libs/libslz/files/1.0.0-build-allow-users-to-install-.a-in-other-directory-t.patch @@ -0,0 +1,36 @@ +From b9df79100163c26afc3f86226f499a391b2b7bf6 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Thu, 22 Sep 2016 02:06:46 +0100 +Subject: [PATCH 02/10] build: allow users to install .a in other directory + that /lib + +This is especially needed for 64 bits system +--- + Makefile | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index a5c33b77af9e..ff17d31d183f 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,7 @@ + TOPDIR := $(PWD) + DESTDIR := + PREFIX := /usr/local ++LIBDIR := lib + + CROSS_COMPILE := + +@@ -45,10 +46,10 @@ libslz.a: src/slz.o + + install: + [ -d "$(DESTDIR)$(PREFIX)/include/." ] || mkdir -p -m 0755 $(DESTDIR)$(PREFIX)/include +- [ -d "$(DESTDIR)$(PREFIX)/lib/." ] || mkdir -p -m 0755 $(DESTDIR)$(PREFIX)/lib ++ [ -d "$(DESTDIR)$(PREFIX)/$(LIBDIR)/." ] || mkdir -p -m 0755 $(DESTDIR)$(PREFIX)/$(LIBDIR) + [ -d "$(DESTDIR)$(PREFIX)/bin/." ] || mkdir -p -m 0755 $(DESTDIR)$(PREFIX)/bin + cp src/slz.h $(DESTDIR)$(PREFIX)/include/ && chmod 644 $(DESTDIR)$(PREFIX)/include/slz.h +- if [ -e libslz.a ]; then cp libslz.a $(DESTDIR)$(PREFIX)/lib/ && chmod 644 $(DESTDIR)$(PREFIX)/lib/libslz.a; fi ++ if [ -e libslz.a ]; then cp libslz.a $(DESTDIR)$(PREFIX)/$(LIBDIR) && chmod 644 $(DESTDIR)$(PREFIX)/$(LIBDIR)/libslz.a; fi + if [ -e zenc ]; then $(STRIP) zenc; cp zenc $(DESTDIR)$(PREFIX)/bin/ && chmod 755 $(DESTDIR)$(PREFIX)/bin/zenc; fi + + clean: diff --git a/dev-libs/libslz/files/1.0.0-build-install-zdec-in-install-tools.patch b/dev-libs/libslz/files/1.0.0-build-install-zdec-in-install-tools.patch new file mode 100644 index 00000000..91f0d727 --- /dev/null +++ b/dev-libs/libslz/files/1.0.0-build-install-zdec-in-install-tools.patch @@ -0,0 +1,23 @@ +From 30d8f736581c2ac837706998ad9cae7cbb24f2b1 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Thu, 22 Sep 2016 02:17:31 +0100 +Subject: [PATCH 07/10] build: install zdec in install-tools + +--- + Makefile | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Makefile b/Makefile +index 63dde867e59d..1feefdeeedca 100644 +--- a/Makefile ++++ b/Makefile +@@ -61,7 +61,9 @@ install-static: static + install-tools: tools + $(STRIP) zenc + [ -d "$(DESTDIR)$(PREFIX)/bin/." ] || mkdir -p -m 0755 $(DESTDIR)$(PREFIX)/bin ++ cp zdec $(DESTDIR)$(PREFIX)/bin/zdec + cp zenc $(DESTDIR)$(PREFIX)/bin/zenc ++ chmod 755 $(DESTDIR)$(PREFIX)/bin/zdec + chmod 755 $(DESTDIR)$(PREFIX)/bin/zenc + + clean: diff --git a/dev-libs/libslz/files/1.0.0-build-reduce-library-name-duplication.patch b/dev-libs/libslz/files/1.0.0-build-reduce-library-name-duplication.patch new file mode 100644 index 00000000..ab698d7d --- /dev/null +++ b/dev-libs/libslz/files/1.0.0-build-reduce-library-name-duplication.patch @@ -0,0 +1,33 @@ +From 6ac624edf8b36ebb7f5c7b6978c7d64790c1dee2 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Thu, 22 Sep 2016 02:19:22 +0100 +Subject: [PATCH 08/10] build: reduce library name duplication + +--- + Makefile | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index 1feefdeeedca..1dd58ae71698 100644 +--- a/Makefile ++++ b/Makefile +@@ -40,7 +40,7 @@ zdec: src/zdec.o + zenc: src/zenc.o src/slz.o + $(LD) $(LDFLAGS) -o $@ $^ + +-libslz.a: src/slz.o ++$(STATIC): src/slz.o + $(AR) rv $@ $^ + + %.o: %.c +@@ -55,8 +55,8 @@ install-headers: + + install-static: static + [ -d "$(DESTDIR)$(PREFIX)/$(LIBDIR)/." ] || mkdir -p -m 0755 $(DESTDIR)$(PREFIX)/$(LIBDIR) +- cp libslz.a $(DESTDIR)$(PREFIX)/$(LIBDIR)/libslz.a +- chmod 644 $(DESTDIR)$(PREFIX)/$(LIBDIR)/libslz.a ++ cp $(STATIC) $(DESTDIR)$(PREFIX)/$(LIBDIR)/$(STATIC) ++ chmod 644 $(DESTDIR)$(PREFIX)/$(LIBDIR)/$(STATIC) + + install-tools: tools + $(STRIP) zenc diff --git a/dev-libs/libslz/files/1.0.0-build-remove-DCONFIG_REGPARM-CFLAGS-since-it-s-not-u.patch b/dev-libs/libslz/files/1.0.0-build-remove-DCONFIG_REGPARM-CFLAGS-since-it-s-not-u.patch new file mode 100644 index 00000000..3d5ed0f8 --- /dev/null +++ b/dev-libs/libslz/files/1.0.0-build-remove-DCONFIG_REGPARM-CFLAGS-since-it-s-not-u.patch @@ -0,0 +1,23 @@ +From 75b75d287a1d9975866a4ba530760759ef8cd246 Mon Sep 17 00:00:00 2001 +From: Willy Tarreau +Date: Thu, 22 Sep 2016 08:06:50 +0200 +Subject: [PATCH 09/10] build: remove -DCONFIG_REGPARM CFLAGS since it's not + used anmyore. + +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 1dd58ae71698..50b22ca579ca 100644 +--- a/Makefile ++++ b/Makefile +@@ -7,7 +7,7 @@ CROSS_COMPILE := + + CC := $(CROSS_COMPILE)gcc + OPT_CFLAGS := -O3 +-CPU_CFLAGS := -fomit-frame-pointer -DCONFIG_REGPARM=3 ++CPU_CFLAGS := -fomit-frame-pointer + DEB_CFLAGS := -Wall -g + DEF_CFLAGS := + USR_CFLAGS := diff --git a/dev-libs/libslz/files/1.0.0-build-specify-destination-file-for-consistency.patch b/dev-libs/libslz/files/1.0.0-build-specify-destination-file-for-consistency.patch new file mode 100644 index 00000000..71797268 --- /dev/null +++ b/dev-libs/libslz/files/1.0.0-build-specify-destination-file-for-consistency.patch @@ -0,0 +1,26 @@ +From 2c259dc069d906c37363a471605424ce71969aa4 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Thu, 22 Sep 2016 22:46:25 +0100 +Subject: [PATCH 05/10] build: specify destination file for consistency + +--- + Makefile | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index f1b96dd3e615..61388b78ecab 100644 +--- a/Makefile ++++ b/Makefile +@@ -50,9 +50,9 @@ install: + [ -d "$(DESTDIR)$(PREFIX)/include/." ] || mkdir -p -m 0755 $(DESTDIR)$(PREFIX)/include + [ -d "$(DESTDIR)$(PREFIX)/$(LIBDIR)/." ] || mkdir -p -m 0755 $(DESTDIR)$(PREFIX)/$(LIBDIR) + [ -d "$(DESTDIR)$(PREFIX)/bin/." ] || mkdir -p -m 0755 $(DESTDIR)$(PREFIX)/bin +- cp src/slz.h $(DESTDIR)$(PREFIX)/include/ && chmod 644 $(DESTDIR)$(PREFIX)/include/slz.h +- if [ -e libslz.a ]; then cp libslz.a $(DESTDIR)$(PREFIX)/$(LIBDIR) && chmod 644 $(DESTDIR)$(PREFIX)/$(LIBDIR)/libslz.a; fi +- if [ -e zenc ]; then $(STRIP) zenc; cp zenc $(DESTDIR)$(PREFIX)/bin/ && chmod 755 $(DESTDIR)$(PREFIX)/bin/zenc; fi ++ cp src/slz.h $(DESTDIR)$(PREFIX)/include/slz.h && chmod 644 $(DESTDIR)$(PREFIX)/include/slz.h ++ if [ -e libslz.a ]; then cp libslz.a $(DESTDIR)$(PREFIX)/$(LIBDIR)/libslz.a && chmod 644 $(DESTDIR)$(PREFIX)/$(LIBDIR)/libslz.a; fi ++ if [ -e zenc ]; then $(STRIP) zenc; cp zenc $(DESTDIR)$(PREFIX)/bin/zenc && chmod 755 $(DESTDIR)$(PREFIX)/bin/zenc; fi + + clean: + -rm -f $(BINS) $(OBJS) $(STATIC) *.[oa] *~ */*.[oa] */*~ diff --git a/dev-libs/libslz/files/1.0.0-build-split-install-target-in-per-purpose-targets.patch b/dev-libs/libslz/files/1.0.0-build-split-install-target-in-per-purpose-targets.patch new file mode 100644 index 00000000..a26f9623 --- /dev/null +++ b/dev-libs/libslz/files/1.0.0-build-split-install-target-in-per-purpose-targets.patch @@ -0,0 +1,42 @@ +From f29d716ac5e5ff1d09712101d218069f5f861ff4 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Thu, 22 Sep 2016 02:13:36 +0100 +Subject: [PATCH 06/10] build: split install target in per-purpose targets + +--- + Makefile | 20 +++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +diff --git a/Makefile b/Makefile +index 61388b78ecab..63dde867e59d 100644 +--- a/Makefile ++++ b/Makefile +@@ -46,13 +46,23 @@ libslz.a: src/slz.o + %.o: %.c + $(CC) $(CFLAGS) -o $@ -c $^ + +-install: ++install: install-headers install-static install-tools ++ ++install-headers: + [ -d "$(DESTDIR)$(PREFIX)/include/." ] || mkdir -p -m 0755 $(DESTDIR)$(PREFIX)/include ++ cp src/slz.h $(DESTDIR)$(PREFIX)/include/slz.h ++ chmod 644 $(DESTDIR)$(PREFIX)/include/slz.h ++ ++install-static: static + [ -d "$(DESTDIR)$(PREFIX)/$(LIBDIR)/." ] || mkdir -p -m 0755 $(DESTDIR)$(PREFIX)/$(LIBDIR) +- [ -d "$(DESTDIR)$(PREFIX)/bin/." ] || mkdir -p -m 0755 $(DESTDIR)$(PREFIX)/bin +- cp src/slz.h $(DESTDIR)$(PREFIX)/include/slz.h && chmod 644 $(DESTDIR)$(PREFIX)/include/slz.h +- if [ -e libslz.a ]; then cp libslz.a $(DESTDIR)$(PREFIX)/$(LIBDIR)/libslz.a && chmod 644 $(DESTDIR)$(PREFIX)/$(LIBDIR)/libslz.a; fi +- if [ -e zenc ]; then $(STRIP) zenc; cp zenc $(DESTDIR)$(PREFIX)/bin/zenc && chmod 755 $(DESTDIR)$(PREFIX)/bin/zenc; fi ++ cp libslz.a $(DESTDIR)$(PREFIX)/$(LIBDIR)/libslz.a ++ chmod 644 $(DESTDIR)$(PREFIX)/$(LIBDIR)/libslz.a ++ ++install-tools: tools ++ $(STRIP) zenc ++ [ -d "$(DESTDIR)$(PREFIX)/bin/." ] || mkdir -p -m 0755 $(DESTDIR)$(PREFIX)/bin ++ cp zenc $(DESTDIR)$(PREFIX)/bin/zenc ++ chmod 755 $(DESTDIR)$(PREFIX)/bin/zenc + + clean: + -rm -f $(BINS) $(OBJS) $(STATIC) *.[oa] *~ */*.[oa] */*~ diff --git a/dev-libs/libslz/files/1.0.0-build-use-intermediate-static-and-tools-targets-for-.patch b/dev-libs/libslz/files/1.0.0-build-use-intermediate-static-and-tools-targets-for-.patch new file mode 100644 index 00000000..1493e775 --- /dev/null +++ b/dev-libs/libslz/files/1.0.0-build-use-intermediate-static-and-tools-targets-for-.patch @@ -0,0 +1,23 @@ +From 74fcfe698da895ac05df706e05eb529c79362aaa Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Thu, 22 Sep 2016 02:13:03 +0100 +Subject: [PATCH 04/10] build: use intermediate static and tools targets for + all + +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 217d7d4447f8..f1b96dd3e615 100644 +--- a/Makefile ++++ b/Makefile +@@ -28,7 +28,7 @@ OBJS := + OBJS += $(patsubst %.c,%.o,$(wildcard src/*.c)) + OBJS += $(patsubst %.S,%.o,$(wildcard src/*.S)) + +-all: $(BINS) $(STATIC) ++all: static tools + + static: $(STATIC) + diff --git a/dev-libs/libslz/libslz-1.0.0.ebuild b/dev-libs/libslz/libslz-1.0.0.ebuild new file mode 100644 index 00000000..ad8466a1 --- /dev/null +++ b/dev-libs/libslz/libslz-1.0.0.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 +inherit toolchain-funcs + +DESCRIPTION="stateless, zlib-compatible, and very fast compression library" +HOMEPAGE="http://1wt.eu/projects/libslz" +SRC_URI="https://github.com/haproxy/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="0/1" +KEYWORDS="~amd64 ~arm ~ppc ~x86" +IUSE="static-libs tools" + +DEPEND="" +RDEPEND="${DEPEND}" + +PATCHES=( + "${FILESDIR}/${PV}-build-add-a-gitignore-files.patch" + "${FILESDIR}/${PV}-build-allow-users-to-install-.a-in-other-directory-t.patch" + "${FILESDIR}/${PV}-build-add-a-tools-target-to-build-zend-and-zdec-only.patch" + "${FILESDIR}/${PV}-build-use-intermediate-static-and-tools-targets-for-.patch" + "${FILESDIR}/${PV}-build-specify-destination-file-for-consistency.patch" + "${FILESDIR}/${PV}-build-split-install-target-in-per-purpose-targets.patch" + "${FILESDIR}/${PV}-build-install-zdec-in-install-tools.patch" + "${FILESDIR}/${PV}-build-reduce-library-name-duplication.patch" + "${FILESDIR}/${PV}-build-remove-DCONFIG_REGPARM-CFLAGS-since-it-s-not-u.patch" + "${FILESDIR}/${PV}-build-add-targets-to-build-shared-library.patch" +) + +src_compile() { + emake \ + CC="$(tc-getCC)" \ + OPT_CFLAGS="${CFLAGS}" \ + USR_LFLAGS="${LDFLAGS}" \ + shared \ + $(usex static-libs static) \ + $(usex tools tools) +} + +src_install() { + emake \ + STRIP=":" \ + DESTDIR="${ED}" \ + PREFIX="${EPREFIX}/usr" \ + LIBDIR="$(get_libdir)" \ + install-headers \ + install-shared \ + $(usex static-libs install-static) \ + $(usex tools install-tools) + + einstalldocs +} diff --git a/dev-libs/libslz/metadata.xml b/dev-libs/libslz/metadata.xml new file mode 100644 index 00000000..23a852a2 --- /dev/null +++ b/dev-libs/libslz/metadata.xml @@ -0,0 +1,16 @@ + + + + + bertrand@jacquin.bzh + Bertrand Jacquin + + +SLZ is a fast and memory-less stream compressor which produces an output that can be decompressed with zlib or gzip. It does not implement decompression at all, zlib is perfectly fine for this. + +The purpose is to use SLZ in situations where a zlib-compatible stream is needed and zlib's resource usage would be too high while the compression ratio is not critical. The typical use case is in HTTP servers and gateways which have to compress many streams in parallel with little CPU resources to assign to this task, and without having to thottle the compression ratio due to the memory usage. In such an environment, the server's memory usage can easily be divided by 10 and the CPU usage by 3 + + + Install additional tools (zenc) + + -- cgit v1.2.3