diff options
author | Julian Ospald <hasufell@gentoo.org> | 2014-04-16 22:48:13 +0000 |
---|---|---|
committer | Julian Ospald <hasufell@gentoo.org> | 2014-04-16 22:48:13 +0000 |
commit | e0145308f29f8b4a02eee3ca0c608e42ec3993b3 (patch) | |
tree | 90476aca402b98fb0f855ee1a378bdedfb7b8210 /dev-libs | |
parent | initial import (diff) | |
download | historical-e0145308f29f8b4a02eee3ca0c608e42ec3993b3.tar.gz historical-e0145308f29f8b4a02eee3ca0c608e42ec3993b3.tar.bz2 historical-e0145308f29f8b4a02eee3ca0c608e42ec3993b3.zip |
initial import
Package-Manager: portage-2.2.10/cvs/Linux x86_64
Manifest-Sign-Key: 0xBDEED020
Diffstat (limited to 'dev-libs')
-rw-r--r-- | dev-libs/libntru/Manifest | 26 | ||||
-rw-r--r-- | dev-libs/libntru/files/01-libntru-0.2-fix-build-on-macosx.patch | 109 | ||||
-rw-r--r-- | dev-libs/libntru/files/02-libntru-0.2-add-warnings.patch | 60 | ||||
-rw-r--r-- | dev-libs/libntru/files/03-libntru-0.2-install-rules.patch | 255 | ||||
-rw-r--r-- | dev-libs/libntru/files/04-libntru-0.2-respect-flags.patch | 92 | ||||
-rw-r--r-- | dev-libs/libntru/files/05-libntru-0.2-fix-memory-leak.patch | 24 | ||||
-rw-r--r-- | dev-libs/libntru/libntru-0.2.ebuild | 38 | ||||
-rw-r--r-- | dev-libs/libntru/metadata.xml | 11 |
8 files changed, 613 insertions, 2 deletions
diff --git a/dev-libs/libntru/Manifest b/dev-libs/libntru/Manifest index a144d1a715b4..9499fdfbee2f 100644 --- a/dev-libs/libntru/Manifest +++ b/dev-libs/libntru/Manifest @@ -1,9 +1,31 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + AUX 01-libntru-0.2-fix-build-on-macosx.patch 3430 SHA256 83d86355789d1ee348d7cf5bd0612ddb41bc611ce30c5bca0cf5b305196aa069 SHA512 a94a38883a8b813d52b400add45808cead26cd2262c96741b3bcd76e2e61bb64e17dcb7c4728cfea14fb3c49064af24eb50e24a4be929275505439ee7afdc1f8 WHIRLPOOL 4cb7e5ca8b8877e2dfe83ac0479c0ce03e4607728bd075d38a97c78109c62b19da146103e7cb8102527cced4d16d0a50e183d6355a5bdf843f7347695bbf2192 AUX 02-libntru-0.2-add-warnings.patch 1960 SHA256 29cf1c7f4af111deeeaa3d9388f43d19b5d4aadafb5f2722a937cfa1b69e6334 SHA512 19cdf39e4e231444618fcfcfdd37a6a60da9eb909966b1c2f1aea4b2bb4c662a80b3212f5f049c1bc6b2133f39442496f2319cb9308fb797b68b929262204b90 WHIRLPOOL 391136e0f6464b8f47bfdd092fb5034d1306a7d401e11173c923c5e75eecbe1a94878b142391878c51818727821a2abd1f3b1200eae292007edd666808217bd1 AUX 03-libntru-0.2-install-rules.patch 9199 SHA256 cc1b2ef6c67b630f26dd8ae94218ace3f419be32742e4d625730fa4bdadbe901 SHA512 8c427fb672fcbc57c16998f01d9d738203b10149d29b8fd495981a92a6e739193fde942756ffcc24ad59fc8c0bf91aa24a9e0db5886541a2161139ea0989f1e3 WHIRLPOOL 57d9dd5e2c257c0749faf594dd59aa5ec2a4725678d187590c808b575dc83805e7ccb55d7607a19bf8d7eb0db40b4f364eb862a36b01e2998b7b1dba5a7d4dca AUX 04-libntru-0.2-respect-flags.patch 3405 SHA256 4d205170a1c10fbeb13a9d2c799a88ce2cde3e656bbf523dd160739edb700124 SHA512 c8d651474d8087deac1871325471842ffa57a96421f919abc2c92e38c54f0e05b5dc26c29751ce111fbf382d7e6acc129dfe354bd94556cda836080868e8e6df WHIRLPOOL 34a7e7e8e2befe8a585c2166c8265c7434a856d00aec026126ae833916ab23310db02074cac17f80a905305bf3f676c771ccf03c1571f39761ff0be7e87e785f AUX 05-libntru-0.2-fix-memory-leak.patch 770 SHA256 84c8bf04283f75f3c81f14ae74331a9f2c51c6c80b069bcd711db2f238ee0bcd SHA512 c2e6bf2b14bfb9bed90843136a00c763ba5f8a1d3e0b6161cdc06181c709ad52f2d593a2cf1935dfc9a1af7a18832a88908a3b8eed0748db75274198878d0f5b WHIRLPOOL 5127981a47749c1acf174e56f333e967c5a389a2cace60c3e19dda9e524aff50b625f8c377242ec8548619acafc9db62885b6945034a7d7a6e456ebf2307ee09 DIST libntru-0.2.tar.gz 49832 SHA256 bc1d10dcd1755f836d4696b734ecc4bc8b047b7ea40d857657c03ecb31ac141f SHA512 4de4cc550fb74d53a26f1b6f94d27d6131756ab7f1b62ce5f1845e6e626581a357004efbd92881d1e180d75f4a92ec97e3c30926dcdf6ea23d87f1da81809f3a WHIRLPOOL 5e96d55f56f608e5ca24506bc8a122d2dff62c61fc0dab847913456d84d36fe13d615c8910b3915c0aa3881a236aaae45725842f9d062183906162df352fd396 -EBUILD libntru-0.2.ebuild 894 SHA256 2f60b8b33f689969eb7975a201e9386776b705ecf2c4e80b70c1e6a6dba1cd32 SHA512 470560e37bd6d34c5983eb53a7459a35569f865fb576bf68fa3544d8eccda7510fa6b9c3bbe8ecad9bb61bb229454bdbe9cc2818aaecbb53d90e7b8e5cdb0840 WHIRLPOOL 7e7e664501127c7ed96fbe42e4dabd56b531e45d972644acfb0b1693c4e2cd88e9e9037d87ac7b8bb014c167eae9aaaf7f271f2354d38102bdd2ffba85d63787 -MISC ChangeLog 482 SHA256 8aa6f651dcafd5061f83f6229aa495b53c72fb3bd71f743d6a1f59c92d5db48b SHA512 2974e76855b4df1c699e8136acada3cdc7f745dc418a02903c9360e6ba24ef0e2cec750a413b9e32b19c85c72907b390571b405dc02eec9720765ef9b3dac93a WHIRLPOOL d44af3ad9255fd0e09b1fdb5256e9261d77d54c719fb2fa6ef31f173c17d4586a11a718b44e6c96279d82c6d865810075fa68e138a08dff8e62fc551c39c4311 +EBUILD libntru-0.2.ebuild 993 SHA256 c5a7233a0bab02e9aedd4de9b98fcbc9895ce31fe7cea82ddfa40ecb94c125db SHA512 a9502256fdd2d2661a4ebf56e10eb0443a6d1b5fad01135e322ac770d44ea5c83d36ffd92b145405af9a87d581e2a41065e0c797b58d732d8cb0f4ba313b2511 WHIRLPOOL d6bf4f955b910775c1657882eead382a1736356143474f446916f0b8ccaa36133cd06fb4fdeb9f2e3782e7154a40d3b96a834029203a7cc8f2e926f30e251e42 +MISC ChangeLog 572 SHA256 e4ce15f0cf4f21b5dbf1090858a15bc49c2d4684755a4d84310b73232f231b97 SHA512 1c10b839528c09ed4eb98e01f2b438e2ec9771f280ead74af39a972a168cbf60dd3b211c9b6376cbb1c19fca9160ba29838d3fac4ee238b35a032bd9f6244ec8 WHIRLPOOL 8012396f475b0d19a4914ef28acbcab61cd6f44c5589ae08a01c3c013eea7800438ad6adbeffbff211e0550984596ee630880307b6c5bdce4f4bc72e201b1aa4 MISC metadata.xml 313 SHA256 9b7560a1714adab73c1b7fdfc5b489f5e521ece27b513b19844e438eafc072fc SHA512 bcaf8d1897c71af93f072a7843ae160105fb8e6f5039576ffaf2a46d186546ef36c99caca4f97522c9eeeb5f531b492e66b471b496cea68317ed7936de834034 WHIRLPOOL ba4273788d466482c0c7bce783e519ec415563a913fae3bb05e19deeef39f6863b53fa2b4c36659712aa3e4a9c25561b82455fe0d8e15ba3e3ae053fd48ad42a +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.22 (GNU/Linux) + +iQJ8BAEBCABmBQJTTwisXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w +ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQzMDlCNDQ4NjEyNDI4NjA5REVEMDI3MzIy +MjBDRDFDNUJERUVEMDIwAAoJECIM0cW97tAgC2UP/iqxC2tfyhrxrqUbcAK8ejwf +hbksr6F9N0nyr2Pg9FFAvQQBHjdwV/1F9Y9ZxhUDXv3IcQR6bKVPXQ87JLpsEr3R +OsGuCjXSnPq7g3kCX6aj5WVymeZ6eGDFg6bqYHDobkrVmTZJkhSDH8+gA4WDsJrJ +8RDeMY4I/pp80dsgjZ8S4U5SNXgw9qdYo3gpWizBt1dm3RWdx2dxRAtQU0vF4T15 +qgBhRi4OYnIejuKazTVpBFBjGhKiUfgJz9HwmSBltcP0hMsHJO04T2mEAXow5Hja +uRSALpplEQPgD5MtXqSSlmtDuTJZRvTpuqC+xXY6+FdzEsAb2CZdFk70IOEsX4NL +bCWQYQ2VmRLRDErAJlSitd8Tu29tZ0pFCjFPYldb8ML1ZWOxd5q8fBFMrWgX5Iit +bDy3GBGgzYqi+Zvpcd+m5ZqFI6E27QjIHFnCOwqMScSmKZEIAHHx5v41zwb2NDpY +wdNabRsnxVfkaGsneyDIBtA7KacKgRlIQpaMtMAX/uPBrS3ZTeLaSqyIkWtGEnX2 +qdnmtMckpdxMhOCsphezSNCH9+kugKOehf/SDb9KOtxCRPDRI1mmoMnkifj2ebb4 +YLqx4ZgSBoSTBsilnSkhKxUyWIyDs/M+U6FJDGVQrFqJ1IeKsw4gAjsGqmpHHadb +alnZDn2Yi4pJ9H7Cz5wY +=ztPX +-----END PGP SIGNATURE----- diff --git a/dev-libs/libntru/files/01-libntru-0.2-fix-build-on-macosx.patch b/dev-libs/libntru/files/01-libntru-0.2-fix-build-on-macosx.patch new file mode 100644 index 000000000000..d7f834da315a --- /dev/null +++ b/dev-libs/libntru/files/01-libntru-0.2-fix-build-on-macosx.patch @@ -0,0 +1,109 @@ +From 286bbe95e479202d8c8c3cc7bf37eaf206e5f88c Mon Sep 17 00:00:00 2001 +From: Tim Buktu <tbuktu@hotmail.com> +Date: Tue, 15 Apr 2014 00:39:12 +0200 +Subject: [PATCH] Fix build on Mac OS X (see + http://sourceforge.net/p/ntru/feature-requests/2/) + +--- + Makefile | 14 ++++---------- + Makefile.osx | 31 +++++++++++++++++++++++++++++++ + Makefile.win | 7 +++++-- + 3 files changed, 40 insertions(+), 12 deletions(-) + create mode 100644 Makefile.osx + +diff --git a/Makefile b/Makefile +index a349627..eb22b7a 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,3 +1,4 @@ ++CC?=gcc + CFLAGS=-g -Wall -O2 + LDFLAGS=-lrt + SRCDIR=src +@@ -8,17 +9,9 @@ TEST_OBJS=test_bitstring.o test_hash.o test_idxgen.o test_key.o test_ntru.o test + LIB_OBJS_PATHS=$(patsubst %,$(SRCDIR)/%,$(LIB_OBJS)) + TEST_OBJS_PATHS=$(patsubst %,$(TESTDIR)/%,$(TEST_OBJS)) + +-# Use -install_name on Mac OS, -soname everywhere else +-UNAME := $(shell uname) +-ifeq ($(UNAME), Darwin) +- SONAME=-install_name +-else +- SONAME=-soname +-endif +- + .PHONY: lib + lib: $(LIB_OBJS_PATHS) +- $(CC) $(CFLAGS) -shared -Wl,$(SONAME),libntru.so -o libntru.so $(LIB_OBJS_PATHS) $(LDFLAGS) ++ $(CC) $(CFLAGS) -shared -Wl,-soname,libntru.so -o libntru.so $(LIB_OBJS_PATHS) $(LDFLAGS) + + test: lib $(TEST_OBJS_PATHS) + $(CC) $(CFLAGS) -o test $(TEST_OBJS_PATHS) -L. -lntru -lm +@@ -35,4 +28,5 @@ tests/%.o: tests/%.c + + .PHONY: clean + clean: +- rm -f $(SRCDIR)/*.o $(TESTDIR)/*.o libntru.so libntru.dll test test.exe bench bench.exe ++ @# also clean files generated on other OSes ++ rm -f $(SRCDIR)/*.o $(TESTDIR)/*.o libntru.so libntru.dylib libntru.dll test test.exe bench bench.exe +diff --git a/Makefile.osx b/Makefile.osx +new file mode 100644 +index 0000000..ef20d64 +--- /dev/null ++++ b/Makefile.osx +@@ -0,0 +1,31 @@ ++CC?=gcc ++CFLAGS=-g -Wall -O2 ++SRCDIR=src ++TESTDIR=tests ++LIB_OBJS=bitstring.o encparams.o hash.o idxgen.o key.o mgf.o ntru.o poly.o rand.o sha1.o sha2.o ++TEST_OBJS=test_bitstring.o test_hash.o test_idxgen.o test_key.o test_ntru.o test.o test_poly.o test_util.o ++ ++LIB_OBJS_PATHS=$(patsubst %,$(SRCDIR)/%,$(LIB_OBJS)) ++TEST_OBJS_PATHS=$(patsubst %,$(TESTDIR)/%,$(TEST_OBJS)) ++ ++.PHONY: lib ++lib: $(LIB_OBJS_PATHS) ++ $(CC) $(CFLAGS) -dylib -dynamiclib -o libntru.dylib $(LIB_OBJS_PATHS) $(LDFLAGS) ++ ++test: lib $(TEST_OBJS_PATHS) ++ $(CC) $(CFLAGS) -o test $(TEST_OBJS_PATHS) -L. -lntru -lm ++ DYLD_LIBRARY_PATH=. ./test ++ ++bench: lib $(SRCDIR)/bench.o ++ $(CC) $(CFLAGS) -o bench $(SRCDIR)/bench.o -L. -lntru ++ ++$(SRCDIR)/%.o: $(SRCDIR)/%.c ++ $(CC) $(CFLAGS) -c -fPIC $< -o $@ ++ ++tests/%.o: tests/%.c ++ $(CC) $(CFLAGS) -fPIC -I$(SRCDIR) -c $< -o $@ ++ ++.PHONY: clean ++clean: ++ @# also clean files generated on other OSes ++ rm -f $(SRCDIR)/*.o $(TESTDIR)/*.o libntru.so libntru.dylib libntru.dll test test.exe bench bench.exe +diff --git a/Makefile.win b/Makefile.win +index de8619e..8a1c55b 100644 +--- a/Makefile.win ++++ b/Makefile.win +@@ -1,3 +1,4 @@ ++CC?=gcc + CFLAGS=-g -Wall -O2 + SRCDIR=src + TESTDIR=tests +@@ -28,8 +29,10 @@ clean: + @if exist $(SRCDIR)\*.o del $(SRCDIR)\*.o + @if exist $(TESTDIR)\*.o del $(TESTDIR)\*.o + @if exist libntru.dll del libntru.dll +- @if exist libntru.so del libntru.so + @if exist test.exe del test.exe +- @if exist test del test + @if exist bench.exe del bench.exe ++ @rem ***** clean files generated on other OSes ***** ++ @if exist libntru.so del libntru.so ++ @if exist libntru.dylib del libntru.dylib ++ @if exist test del test + @if exist bench del bench +-- +1.9.1 diff --git a/dev-libs/libntru/files/02-libntru-0.2-add-warnings.patch b/dev-libs/libntru/files/02-libntru-0.2-add-warnings.patch new file mode 100644 index 000000000000..454e781646b9 --- /dev/null +++ b/dev-libs/libntru/files/02-libntru-0.2-add-warnings.patch @@ -0,0 +1,60 @@ +From 70ee775ae08d9965b3b1a2045703ab232289cb52 Mon Sep 17 00:00:00 2001 +From: Tim Buktu <tbuktu@hotmail.com> +Date: Tue, 15 Apr 2014 00:56:43 +0200 +Subject: [PATCH] Add -Wextra -Wno-unused-parameter and fix a warning + +--- + Makefile | 2 +- + Makefile.osx | 2 +- + Makefile.win | 2 +- + src/rand.c | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Makefile b/Makefile +index eb22b7a..ea88bb3 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,5 +1,5 @@ + CC?=gcc +-CFLAGS=-g -Wall -O2 ++CFLAGS=-g -Wall -Wextra -Wno-unused-parameter -O2 + LDFLAGS=-lrt + SRCDIR=src + TESTDIR=tests +diff --git a/Makefile.osx b/Makefile.osx +index ef20d64..68877fb 100644 +--- a/Makefile.osx ++++ b/Makefile.osx +@@ -1,5 +1,5 @@ + CC?=gcc +-CFLAGS=-g -Wall -O2 ++CFLAGS=-g -Wall -Wextra -Wno-unused-parameter -O2 + SRCDIR=src + TESTDIR=tests + LIB_OBJS=bitstring.o encparams.o hash.o idxgen.o key.o mgf.o ntru.o poly.o rand.o sha1.o sha2.o +diff --git a/Makefile.win b/Makefile.win +index 8a1c55b..0eb18a5 100644 +--- a/Makefile.win ++++ b/Makefile.win +@@ -1,5 +1,5 @@ + CC?=gcc +-CFLAGS=-g -Wall -O2 ++CFLAGS=-g -Wall -Wextra -Wno-unused-parameter -O2 + SRCDIR=src + TESTDIR=tests + LIB_OBJS=bitstring.o encparams.o hash.o idxgen.o key.o mgf.o ntru.o poly.o rand.o sha1.o sha2.o +diff --git a/src/rand.c b/src/rand.c +index 187fad2..93bf76b 100644 +--- a/src/rand.c ++++ b/src/rand.c +@@ -17,7 +17,7 @@ uint8_t ntru_rand_wincrypt(uint8_t rand_data[], uint16_t len, NtruRandContext *r + if (hCryptProv == 0) { + uint8_t result = CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, 0); + if (!result) { +- if (GetLastError() == NTE_BAD_KEYSET) // see http://support.microsoft.com/kb/238187 ++ if (GetLastError() == (DWORD)NTE_BAD_KEYSET) // see http://support.microsoft.com/kb/238187 + result = CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET); + if (!result) + return 0; +-- +1.9.1 diff --git a/dev-libs/libntru/files/03-libntru-0.2-install-rules.patch b/dev-libs/libntru/files/03-libntru-0.2-install-rules.patch new file mode 100644 index 000000000000..dbe440df5419 --- /dev/null +++ b/dev-libs/libntru/files/03-libntru-0.2-install-rules.patch @@ -0,0 +1,255 @@ +From 625e8727bbbeb38975e54f1829bcd7a23f81bb11 Mon Sep 17 00:00:00 2001 +From: Tim Buktu <tbuktu@hotmail.com> +Date: Tue, 15 Apr 2014 20:45:36 +0200 +Subject: [PATCH] Add Makefile targets + +New targets: all, install, uninstall, dist, distclean +This fixes https://github.com/tbuktu/libntru/issues/6 +--- + Makefile | 48 +++++++++++++++++++++++++++++++++++++++++++++ + Makefile.osx | 47 ++++++++++++++++++++++++++++++++++++++++++++ + Makefile.win | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/ntru.h | 1 - + 4 files changed, 159 insertions(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index ea88bb3..e4a6370 100644 +--- a/Makefile ++++ b/Makefile +@@ -5,14 +5,57 @@ SRCDIR=src + TESTDIR=tests + LIB_OBJS=bitstring.o encparams.o hash.o idxgen.o key.o mgf.o ntru.o poly.o rand.o sha1.o sha2.o + TEST_OBJS=test_bitstring.o test_hash.o test_idxgen.o test_key.o test_ntru.o test.o test_poly.o test_util.o ++VERSION=0.2 ++INST_PFX=/usr ++INST_HEADERS=ntru.h types.h key.h encparams.h hash.h rand.h err.h + + LIB_OBJS_PATHS=$(patsubst %,$(SRCDIR)/%,$(LIB_OBJS)) + TEST_OBJS_PATHS=$(patsubst %,$(TESTDIR)/%,$(TEST_OBJS)) ++DIST_NAME=libntru-$(VERSION) ++ ++.PHONY: all ++all: lib + + .PHONY: lib + lib: $(LIB_OBJS_PATHS) + $(CC) $(CFLAGS) -shared -Wl,-soname,libntru.so -o libntru.so $(LIB_OBJS_PATHS) $(LDFLAGS) + ++.PHONY: install ++install: lib ++ test -d $(INST_PFX) || mkdir -p $(INST_PFX) ++ test -d $(INST_PFX)/lib || mkdir $(INST_PFX)/lib ++ test -d $(INST_PFX)/include/libntru || mkdir -p $(INST_PFX)/include/libntru ++ test -d $(INST_PFX)/share/doc/libntru || mkdir -p $(INST_PFX)/share/doc/libntru ++ install -m 0755 libntru.so $(INST_PFX)/lib/libntru.so ++ install -m 0644 README.md $(INST_PFX)/share/doc/libntru/README.md ++ for header in $(INST_HEADERS); do \ ++ install -m 0644 $(SRCDIR)/$$header $(INST_PFX)/include/libntru/; \ ++ done ++ ++.PHONY: uninstall ++uninstall: ++ rm -f $(INST_PFX)/lib/libntru.so ++ rm -f $(INST_PFX)/share/doc/libntru/README.md ++ rmdir $(INST_PFX)/share/doc/libntru/ ++ for header in $(INST_HEADERS); do \ ++ rm $(INST_PFX)/include/libntru/$$header; \ ++ done ++ rmdir $(INST_PFX)/include/libntru/ ++ ++.PHONY: dist ++dist: ++ rm -rf $(DIST_NAME) ++ mkdir $(DIST_NAME) ++ mkdir $(DIST_NAME)/$(SRCDIR) ++ mkdir $(DIST_NAME)/$(TESTDIR) ++ cp Makefile Makefile.win Makefile.osx README.md LICENSE PATENTS $(DIST_NAME) ++ cp $(SRCDIR)/*.c $(DIST_NAME)/$(SRCDIR) ++ cp $(SRCDIR)/*.h $(DIST_NAME)/$(SRCDIR) ++ cp $(TESTDIR)/*.c $(DIST_NAME)/$(TESTDIR) ++ cp $(TESTDIR)/*.h $(DIST_NAME)/$(TESTDIR) ++ tar cf $(DIST_NAME).tar.xz $(DIST_NAME) --lzma ++ rm -rf $(DIST_NAME) ++ + test: lib $(TEST_OBJS_PATHS) + $(CC) $(CFLAGS) -o test $(TEST_OBJS_PATHS) -L. -lntru -lm + LD_LIBRARY_PATH=. ./test +@@ -30,3 +73,8 @@ tests/%.o: tests/%.c + clean: + @# also clean files generated on other OSes + rm -f $(SRCDIR)/*.o $(TESTDIR)/*.o libntru.so libntru.dylib libntru.dll test test.exe bench bench.exe ++ ++.PHONY: distclean ++distclean: clean ++ rm -rf $(DIST_NAME) ++ rm -f $(DIST_NAME).tar.xz $(DIST_NAME).zip +diff --git a/Makefile.osx b/Makefile.osx +index 68877fb..0baef8c 100644 +--- a/Makefile.osx ++++ b/Makefile.osx +@@ -4,14 +4,56 @@ SRCDIR=src + TESTDIR=tests + LIB_OBJS=bitstring.o encparams.o hash.o idxgen.o key.o mgf.o ntru.o poly.o rand.o sha1.o sha2.o + TEST_OBJS=test_bitstring.o test_hash.o test_idxgen.o test_key.o test_ntru.o test.o test_poly.o test_util.o ++VERSION=0.2 ++INST_HEADERS=ntru.h types.h key.h encparams.h hash.h rand.h err.h + + LIB_OBJS_PATHS=$(patsubst %,$(SRCDIR)/%,$(LIB_OBJS)) + TEST_OBJS_PATHS=$(patsubst %,$(TESTDIR)/%,$(TEST_OBJS)) ++DIST_NAME=libntru-$(VERSION) ++ ++.PHONY: all ++all: lib + + .PHONY: lib + lib: $(LIB_OBJS_PATHS) + $(CC) $(CFLAGS) -dylib -dynamiclib -o libntru.dylib $(LIB_OBJS_PATHS) $(LDFLAGS) + ++.PHONY: install ++install: lib ++ test -d $(INST_PFX) || mkdir -p $(INST_PFX) ++ test -d $(INST_PFX)/lib || mkdir $(INST_PFX)/lib ++ test -d $(INST_PFX)/include/libntru || mkdir -p $(INST_PFX)/include/libntru ++ test -d $(INST_PFX)/share/doc/libntru || mkdir -p $(INST_PFX)/share/doc/libntru ++ install -m 0755 libntru.so $(INST_PFX)/lib/libntru.so ++ install -m 0644 README.md $(INST_PFX)/share/doc/libntru/README.md ++ for header in $(INST_HEADERS); do \ ++ install -m 0644 $(SRCDIR)/$$header $(INST_PFX)/include/libntru/; \ ++ done ++ ++.PHONY: uninstall ++uninstall: ++ rm -f $(INST_PFX)/lib/libntru.so ++ rm -f $(INST_PFX)/share/doc/libntru/README.md ++ rmdir $(INST_PFX)/share/doc/libntru/ ++ for header in $(INST_HEADERS); do \ ++ rm $(INST_PFX)/include/libntru/$$header; \ ++ done ++ rmdir $(INST_PFX)/include/libntru/ ++ ++.PHONY: dist ++dist: ++ rm -rf $(DIST_NAME) ++ mkdir $(DIST_NAME) ++ mkdir $(DIST_NAME)/$(SRCDIR) ++ mkdir $(DIST_NAME)/$(TESTDIR) ++ cp Makefile Makefile.win Makefile.osx README.md LICENSE PATENTS $(DIST_NAME) ++ cp $(SRCDIR)/*.c $(DIST_NAME)/$(SRCDIR) ++ cp $(SRCDIR)/*.h $(DIST_NAME)/$(SRCDIR) ++ cp $(TESTDIR)/*.c $(DIST_NAME)/$(TESTDIR) ++ cp $(TESTDIR)/*.h $(DIST_NAME)/$(TESTDIR) ++ tar cf $(DIST_NAME).tar.xz $(DIST_NAME) --lzma ++ rm -rf $(DIST_NAME) ++ + test: lib $(TEST_OBJS_PATHS) + $(CC) $(CFLAGS) -o test $(TEST_OBJS_PATHS) -L. -lntru -lm + DYLD_LIBRARY_PATH=. ./test +@@ -29,3 +71,8 @@ tests/%.o: tests/%.c + clean: + @# also clean files generated on other OSes + rm -f $(SRCDIR)/*.o $(TESTDIR)/*.o libntru.so libntru.dylib libntru.dll test test.exe bench bench.exe ++ ++.PHONY: distclean ++distclean: clean ++ rm -rf $(DIST_NAME) ++ rm -f $(DIST_NAME).tar.xz $(DIST_NAME).zip +diff --git a/Makefile.win b/Makefile.win +index 0eb18a5..315e08b 100644 +--- a/Makefile.win ++++ b/Makefile.win +@@ -4,13 +4,64 @@ SRCDIR=src + TESTDIR=tests + LIB_OBJS=bitstring.o encparams.o hash.o idxgen.o key.o mgf.o ntru.o poly.o rand.o sha1.o sha2.o + TEST_OBJS=test_bitstring.o test_hash.o test_idxgen.o test_key.o test_ntru.o test.o test_poly.o test_util.o ++VERSION=0.2 ++INST_PFX=%PROGRAMFILES% ++INST_HEADERS=ntru.h types.h key.h encparams.h hash.h rand.h err.h + + LIB_OBJS_PATHS=$(patsubst %,$(SRCDIR)/%,$(LIB_OBJS)) + TEST_OBJS_PATHS=$(patsubst %,$(TESTDIR)/%,$(TEST_OBJS)) ++DIST_NAME=libntru-$(VERSION) + ++.PHONY: all ++all: lib ++ ++.PHONY: lib + lib: $(LIB_OBJS_PATHS) + $(CC) $(CFLAGS) -shared -o libntru.dll $(LIB_OBJS_PATHS) -lws2_32 -ladvapi32 + ++.PHONY: install ++install: lib ++ if not exist "%PROGRAMFILES%\libntru" mkdir "%PROGRAMFILES%\libntru" ++ if not exist "%PROGRAMFILES%\libntru\include" mkdir "%PROGRAMFILES%\libntru\include" ++ copy libntru.dll "%PROGRAMFILES%\libntru" ++ copy README.md "%PROGRAMFILES%\libntru" ++ for %%h in ($(INST_HEADERS)) do \ ++ copy $(SRCDIR)\%%h "%PROGRAMFILES%\libntru\include" ++ ++uninstall: ++ if exist "%PROGRAMFILES%\libntru\libntru.dll" del "%PROGRAMFILES%\libntru\libntru.dll" ++ if exist "%PROGRAMFILES%\libntru\README.md" del "%PROGRAMFILES%\libntru\README.md" ++ for %%h in ($(INST_HEADERS)) do \ ++ if exist "%PROGRAMFILES%\libntru\include\%%h" del "%PROGRAMFILES%\libntru\include\%%h" ++ if exist "%PROGRAMFILES%\libntru\include" rmdir "%PROGRAMFILES%\libntru\include" ++ if exist "%PROGRAMFILES%\libntru" rmdir "%PROGRAMFILES%\libntru" ++ ++.PHONY: dist ++dist: ++ @if exist $(DIST_NAME)\$(SRCDIR)\*.c del $(DIST_NAME)\$(SRCDIR)\*.c ++ @if exist $(DIST_NAME)\$(SRCDIR)\*.h del $(DIST_NAME)\$(SRCDIR)\*.h ++ @if exist $(DIST_NAME)\$(SRCDIR) rmdir $(DIST_NAME)\$(SRCDIR) ++ @if exist $(DIST_NAME)\$(TESTDIR)\*.c del $(DIST_NAME)\$(TESTDIR)\*.c ++ @if exist $(DIST_NAME)\$(TESTDIR)\*.h del $(DIST_NAME)\$(TESTDIR)\*.h ++ @if exist $(DIST_NAME)\$(TESTDIR) rmdir $(DIST_NAME)\$(TESTDIR) ++ @if exist $(DIST_NAME)\*.* del /q $(DIST_NAME)\*.* ++ @if exist $(DIST_NAME) rmdir $(DIST_NAME) ++ mkdir $(DIST_NAME) ++ mkdir $(DIST_NAME)\$(SRCDIR) ++ mkdir $(DIST_NAME)\$(TESTDIR) ++ copy Makefile $(DIST_NAME) ++ copy Makefile.win $(DIST_NAME) ++ copy Makefile.osx $(DIST_NAME) ++ copy README.md $(DIST_NAME) ++ copy LICENSE $(DIST_NAME) ++ copy PATENTS $(DIST_NAME) ++ copy $(SRCDIR)\*.c $(DIST_NAME)\$(SRCDIR) ++ copy $(SRCDIR)\*.h $(DIST_NAME)\$(SRCDIR) ++ copy $(TESTDIR)\*.c $(DIST_NAME)\$(TESTDIR) ++ copy $(TESTDIR)\*.h $(DIST_NAME)\$(TESTDIR) ++ @rem zip is provided by MinGW ++ zip -rm $(DIST_NAME).zip $(DIST_NAME) ++ + test: lib $(TEST_OBJS_PATHS) + $(CC) $(CFLAGS) -o test.exe $(TEST_OBJS_PATHS) -L. -lntru -lm + test.exe +@@ -36,3 +87,16 @@ clean: + @if exist libntru.dylib del libntru.dylib + @if exist test del test + @if exist bench del bench ++ ++.PHONY: distclean ++distclean: clean ++ @if exist $(DIST_NAME)\$(SRCDIR)\*.c del $(DIST_NAME)\$(SRCDIR)\*.c ++ @if exist $(DIST_NAME)\$(SRCDIR)\*.h del $(DIST_NAME)\$(SRCDIR)\*.h ++ @if exist $(DIST_NAME)\$(SRCDIR) rmdir $(DIST_NAME)\$(SRCDIR) ++ @if exist $(DIST_NAME)\$(TESTDIR)\*.c del $(DIST_NAME)\$(TESTDIR)\*.c ++ @if exist $(DIST_NAME)\$(TESTDIR)\*.h del $(DIST_NAME)\$(TESTDIR)\*.h ++ @if exist $(DIST_NAME)\$(TESTDIR) rmdir $(DIST_NAME)\$(TESTDIR) ++ @if exist $(DIST_NAME)\*.* del /q $(DIST_NAME)\*.* ++ @if exist $(DIST_NAME) rmdir $(DIST_NAME) ++ @if exist $(DIST_NAME).zip del $(DIST_NAME).zip ++ @if exist $(DIST_NAME).tar.xz del $(DIST_NAME).tar.xz +diff --git a/src/ntru.h b/src/ntru.h +index a8ff338..41f15e3 100644 +--- a/src/ntru.h ++++ b/src/ntru.h +@@ -3,7 +3,6 @@ + + #include "types.h" + #include "key.h" +-#include "poly.h" + #include "encparams.h" + #include "rand.h" + #include "err.h" +-- +1.9.1 diff --git a/dev-libs/libntru/files/04-libntru-0.2-respect-flags.patch b/dev-libs/libntru/files/04-libntru-0.2-respect-flags.patch new file mode 100644 index 000000000000..e9274c41c02f --- /dev/null +++ b/dev-libs/libntru/files/04-libntru-0.2-respect-flags.patch @@ -0,0 +1,92 @@ +From: Julian Ospald <hasufell@gentoo.org> +Date: Wed Apr 16 14:48:00 UTC 2014 +Subject: respect system flags + +--- libntru-0.2/Makefile ++++ libntru-0.2/Makefile +@@ -1,12 +1,16 @@ + CC?=gcc +-CFLAGS=-g -Wall -Wextra -Wno-unused-parameter -O2 +-LDFLAGS=-lrt ++CFLAGS?=-g -O2 ++CFLAGS+=-Wall -Wextra -Wno-unused-parameter ++LIBS+=-lrt + SRCDIR=src + TESTDIR=tests + LIB_OBJS=bitstring.o encparams.o hash.o idxgen.o key.o mgf.o ntru.o poly.o rand.o sha1.o sha2.o + TEST_OBJS=test_bitstring.o test_hash.o test_idxgen.o test_key.o test_ntru.o test.o test_poly.o test_util.o + VERSION=0.2 + INST_PFX=/usr ++INST_LIBDIR=$(INST_PFX)/lib ++INST_INCLUDE=$(INST_PFX)/include/libntru ++INST_DOCDIR=$(INST_PFX)/share/doc/libntru + INST_HEADERS=ntru.h types.h key.h encparams.h hash.h rand.h err.h + + LIB_OBJS_PATHS=$(patsubst %,$(SRCDIR)/%,$(LIB_OBJS)) +@@ -18,29 +22,29 @@ + + .PHONY: lib + lib: $(LIB_OBJS_PATHS) +- $(CC) $(CFLAGS) -shared -Wl,-soname,libntru.so -o libntru.so $(LIB_OBJS_PATHS) $(LDFLAGS) ++ $(CC) $(CFLAGS) $(CPPFLAGS) -shared -Wl,-soname,libntru.so -o libntru.so $(LIB_OBJS_PATHS) $(LDFLAGS) $(LIBS) + + .PHONY: install + install: lib +- test -d $(INST_PFX) || mkdir -p $(INST_PFX) +- test -d $(INST_PFX)/lib || mkdir $(INST_PFX)/lib +- test -d $(INST_PFX)/include/libntru || mkdir -p $(INST_PFX)/include/libntru +- test -d $(INST_PFX)/share/doc/libntru || mkdir -p $(INST_PFX)/share/doc/libntru +- install -m 0755 libntru.so $(INST_PFX)/lib/libntru.so +- install -m 0644 README.md $(INST_PFX)/share/doc/libntru/README.md +- for header in $(INST_HEADERS); do \ +- install -m 0644 $(SRCDIR)/$$header $(INST_PFX)/include/libntru/; \ ++ test -d "$(DESTDIR)$(INST_PFX)" || mkdir -p "$(DESTDIR)$(INST_PFX)" ++ test -d "$(DESTDIR)$(INST_LIBDIR)" || mkdir "$(DESTDIR)$(INST_LIBDIR)" ++ test -d "$(DESTDIR)$(INST_INCLUDE)" || mkdir -p "$(DESTDIR)$(INST_INCLUDE)" ++ test -d "$(DESTDIR)$(INST_DOCDIR)" || mkdir -p "$(DESTDIR)$(INST_DOCDIR)" ++ install -m 0755 libntru.so "$(DESTDIR)$(INST_LIBDIR)/libntru.so" ++ install -m 0644 README.md "$(DESTDIR)$(INST_DOCDIR)/README.md" ++ for header in $(INST_HEADERS) ; do \ ++ install -m 0644 "$(SRCDIR)/$$header" "$(DESTDIR)$(INST_INCLUDE)/" ; \ + done + + .PHONY: uninstall + uninstall: +- rm -f $(INST_PFX)/lib/libntru.so +- rm -f $(INST_PFX)/share/doc/libntru/README.md +- rmdir $(INST_PFX)/share/doc/libntru/ +- for header in $(INST_HEADERS); do \ +- rm $(INST_PFX)/include/libntru/$$header; \ ++ rm -f "$(DESTDIR)$(INST_LIBDIR)/libntru.so" ++ rm -f "$(DESTDIR)$(INST_DOCDIR)/README.md" ++ rmdir "$(DESTDIR)$(INST_DOCDIR)/" ++ for header in $(INST_HEADERS) ; do \ ++ rm "$(DESTDIR)$(INST_INCLUDE)/$$header" ; \ + done +- rmdir $(INST_PFX)/include/libntru/ ++ rmdir "$(DESTDIR)$(INST_INCLUDE)/" + + .PHONY: dist + dist: +@@ -57,17 +61,17 @@ + rm -rf $(DIST_NAME) + + test: lib $(TEST_OBJS_PATHS) +- $(CC) $(CFLAGS) -o test $(TEST_OBJS_PATHS) -L. -lntru -lm ++ $(CC) $(CFLAGS) $(CPPFLAGS) -o test $(TEST_OBJS_PATHS) $(LDFLAGS) -L. -lntru -lm + LD_LIBRARY_PATH=. ./test + + bench: lib $(SRCDIR)/bench.o +- $(CC) $(CFLAGS) -o bench $(SRCDIR)/bench.o -L. -lntru ++ $(CC) $(CFLAGS) $(CPPFLAGS) -o bench $(SRCDIR)/bench.o $(LDFLAGS) -L. -lntru + + $(SRCDIR)/%.o: $(SRCDIR)/%.c +- $(CC) $(CFLAGS) -c -fPIC $< -o $@ ++ $(CC) $(CFLAGS) $(CPPFLAGS) -c -fPIC $< -o $@ + + tests/%.o: tests/%.c +- $(CC) $(CFLAGS) -fPIC -I$(SRCDIR) -c $< -o $@ ++ $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -I$(SRCDIR) -c $< -o $@ + + .PHONY: clean + clean: diff --git a/dev-libs/libntru/files/05-libntru-0.2-fix-memory-leak.patch b/dev-libs/libntru/files/05-libntru-0.2-fix-memory-leak.patch new file mode 100644 index 000000000000..843c39c779d4 --- /dev/null +++ b/dev-libs/libntru/files/05-libntru-0.2-fix-memory-leak.patch @@ -0,0 +1,24 @@ +From eada223e688d0777f852ca827a375121b375def3 Mon Sep 17 00:00:00 2001 +From: gga01 <gga01@users.noreply.github.com> +Date: Wed, 16 Apr 2014 00:57:01 +0300 +Subject: [PATCH] Fix memory leak (issue #7) + +--- + src/ntru.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ntru.c b/src/ntru.c +index b7513cb..73f0449 100644 +--- a/src/ntru.c ++++ b/src/ntru.c +@@ -360,7 +360,7 @@ uint8_t ntru_encrypt_det(uint8_t *msg, uint16_t msg_len, NtruEncPubKey *pub, Ntr + rand_state = NULL; + NtruRandContext rand_ctx = {seed, seed_len, &rand_state}; + uint8_t result = ntru_encrypt_internal(msg, msg_len, pub, params, rng, &rand_ctx, enc); +- if (rand_state == NULL) ++ if (rand_state != NULL) + free(rand_state); + return result; + } +-- +1.9.1 diff --git a/dev-libs/libntru/libntru-0.2.ebuild b/dev-libs/libntru/libntru-0.2.ebuild new file mode 100644 index 000000000000..cf10733acd8c --- /dev/null +++ b/dev-libs/libntru/libntru-0.2.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/libntru/libntru-0.2.ebuild,v 1.1 2014/04/16 22:48:09 hasufell Exp $ + +EAPI=5 + +inherit eutils toolchain-funcs multilib multilib-minimal + +DESCRIPTION="C Implementation of NTRUEncrypt" +HOMEPAGE="https://github.com/tbuktu/libntru" +SRC_URI="https://github.com/tbuktu/libntru/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +src_prepare() { + epatch "${FILESDIR}"/01-${P}-fix-build-on-macosx.patch \ + "${FILESDIR}"/02-${P}-add-warnings.patch \ + "${FILESDIR}"/03-${P}-install-rules.patch \ + "${FILESDIR}"/04-${P}-respect-flags.patch \ + "${FILESDIR}"/05-${P}-fix-memory-leak.patch + + multilib_copy_sources +} + +multilib_src_compile() { + emake CC="$(tc-getCC)" +} + +multilib_src_install() { + emake \ + DESTDIR="${ED}" \ + INST_LIBDIR="/usr/$(get_libdir)" \ + INST_DOCDIR="/usr/share/doc/${PF}" \ + install +} diff --git a/dev-libs/libntru/metadata.xml b/dev-libs/libntru/metadata.xml new file mode 100644 index 000000000000..07826665ce19 --- /dev/null +++ b/dev-libs/libntru/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer> + <email>hasufell@gentoo.org</email> + <name>Julian Ospald</name> + </maintainer> + <upstream> + <remote-id type='github'>tbuktu/libntru</remote-id> + </upstream> +</pkgmetadata> |