libtommath: new package
PATCH v2 1/3 libtommath: new package
--- package/Config.in | 1 + package/libtommath/Config.in | 7 +++++++ package/libtommath/libtommath.hash | 2 ++ package/libtommath/libtommath.mk | 22 ++++++++++++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 package/libtommath/Config.in create mode 100644 package/libtommath/libtommath.hash create mode 100644 package/libtommath/libtommath.mk
package/Config.in +1 -0
@@ -1233,6 +1233,7 @@ menu "Other" source "package/libsigc/Config.in" source "package/libsigsegv/Config.in" source "package/libtasn1/Config.in" + source "package/libtommath/Config.in" source "package/libtpl/Config.in" source "package/libubox/Config.in" source "package/libuci/Config.in"
package/libtommath/Config.in new file +7 -0
@@ -0,0 +1,7 @@ +config BR2_PACKAGE_LIBTOMMATH + bool "libtommath" + help + LibTomMath is a free open source portable number theoretic + multiple-precision integer library written entirely in C. + + http://www.libtom.net
package/libtommath/libtommath.hash new file +2 -0
@@ -0,0 +1,2 @@ +# Locally computed +sha256 993a7df9ee091fca430cdde3263df57d88ef62af8103903214da49fc51bbb56c ltm-1.0.tar.xz
package/libtommath/libtommath.mk new file +22 -0
@@ -0,0 +1,22 @@ +################################################################################ +# +# libtommath +# +################################################################################ + +LIBTOMMATH_VERSION = 1.0 +LIBTOMMATH_SITE = https://github.com/libtom/libtommath/releases/download/v$(LIBTOMMATH_VERSION) +LIBTOMMATH_SOURCE = ltm-$(LIBTOMMATH_VERSION).tar.xz +LIBTOMMATH_LICENSE = WTFPL +LIBTOMMATH_LICENSE_FILES = LICENSE +LIBTOMMATH_INSTALL_STAGING = YES + +define LIBTOMMATH_BUILD_CMDS + $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="-I./ $(TARGET_CFLAGS)" +endef + +define LIBTOMMATH_INSTALL_STAGING_CMDS + $(MAKE) -C $(@D) DESTDIR="$(STAGING_DIR)" install +endef + +$(eval $(generic-package))
Signature · 1 line
2.5.0
PATCH v2 2/3 libtomcrypt: new package
--- package/Config.in | 1 + .../0001-install-without-USER-and-GROUP.patch | 61 ++++++++++++++++++++++ package/libtomcrypt/Config.in | 11 ++++ package/libtomcrypt/libtomcrypt.hash | 2 + package/libtomcrypt/libtomcrypt.mk | 23 ++++++++ 5 files changed, 98 insertions(+) create mode 100644 package/libtomcrypt/0001-install-without-USER-and-GROUP.patch create mode 100644 package/libtomcrypt/Config.in create mode 100644 package/libtomcrypt/libtomcrypt.hash create mode 100644 package/libtomcrypt/libtomcrypt.mk
package/Config.in +1 -0
@@ -839,6 +839,7 @@ menu "Crypto" source "package/libsodium/Config.in" source "package/libssh/Config.in" source "package/libssh2/Config.in" + source "package/libtomcrypt/Config.in" source "package/libuecc/Config.in" source "package/mbedtls/Config.in" source "package/nettle/Config.in"
package/libtomcrypt/0001-install-without-USER-and-GROUP.patch new file +61 -0
61 lines not on this page · raw message
package/libtomcrypt/Config.in new file +11 -0
@@ -0,0 +1,11 @@ +config BR2_PACKAGE_LIBTOMCRYPT + bool "libtomcrypt" + select BR2_PACKAGE_LIBTOMMATH + help + LibTomCrypt is a fairly comprehensive, modular and portable + cryptographic toolkit that provides developers with a vast array + of well known published block ciphers, one-way hash functions, + chaining modes, pseudo-random number generators, public key + cryptography and a plethora of other routines. + + http://www.libtom.net
package/libtomcrypt/libtomcrypt.hash new file +2 -0
@@ -0,0 +1,2 @@ +# Locally computed +sha256 e33b47d77a495091c8703175a25c8228aff043140b2554c08a3c3cd71f79d116 crypt-1.17.tar.bz2
package/libtomcrypt/libtomcrypt.mk new file +23 -0
@@ -0,0 +1,23 @@ +################################################################################ +# +# libtomcrypt +# +################################################################################ + +LIBTOMCRYPT_VERSION = 1.17 +LIBTOMCRYPT_SITE = https://github.com/libtom/libtomcrypt/releases/download/$(LIBTOMCRYPT_VERSION) +LIBTOMCRYPT_SOURCE = crypt-$(LIBTOMCRYPT_VERSION).tar.bz2 +LIBTOMCRYPT_LICENSE = WTFPL +LIBTOMCRYPT_LICENSE_FILES = LICENSE +LIBTOMCRYPT_INSTALL_STAGING = YES +LIBTOMCRYPT_DEPENDENCIES = libtommath + +define LIBTOMCRYPT_BUILD_CMDS + $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="-I./src/headers $(TARGET_CFLAGS) -DLTC_SOURCE -DLTM_DESC" +endef + +define LIBTOMCRYPT_INSTALL_STAGING_CMDS + $(MAKE) -C $(@D) DESTDIR="$(STAGING_DIR)" NODOCS=1 install +endef + +$(eval $(generic-package))
Signature · 1 line
2.5.0
PATCH v2 2/3 libtomcrypt: new package
Quoted 1 line · Francois Perrad
Signed-off-by Francois Perrad <[email protected]>
Quoted 152 lines
--- package/Config.in | 1 + .../0001-install-without-USER-and-GROUP.patch | 61 ++++++++++++++++++++++ package/libtomcrypt/Config.in | 11 ++++ package/libtomcrypt/libtomcrypt.hash | 2 + package/libtomcrypt/libtomcrypt.mk | 23 ++++++++ 5 files changed, 98 insertions(+) create mode 100644 package/libtomcrypt/0001-install-without-USER-and-GROUP.patch create mode 100644 package/libtomcrypt/Config.in create mode 100644 package/libtomcrypt/libtomcrypt.hash create mode 100644 package/libtomcrypt/libtomcrypt.mkpackage/Config.in +1
-0@@ -839,6 +839,7 @@ menu "Crypto" source "package/libsodium/Config.in" source "package/libssh/Config.in" source "package/libssh2/Config.in" + source "package/libtomcrypt/Config.in" source "package/libuecc/Config.in" source "package/mbedtls/Config.in" source "package/nettle/Config.in"package/libtomcrypt/0001-install-without-USER-and-GROUP.patch new file +61
-0@@ -0,0 +1,61 @@ +install without USER and GROUP + +see https://github.com/libtom/libtomcrypt/pull/115 + +Signed-off-by: Francois Perrad <[email protected]> + +diff --git a/makefile b/makefile +index f650ea1..b346bed 100644 +--- a/makefile ++++ b/makefile +@@ -300,19 +300,19 @@ install: library docs + else + install: library + endif +- install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH) +- install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH) +- install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(DATAPATH) +- install -g $(GROUP) -o $(USER) $(LIBNAME) $(DESTDIR)$(LIBPATH) +- install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH) ++ install -d $(DESTDIR)$(LIBPATH) ++ install -d $(DESTDIR)$(INCPATH) ++ install -d $(DESTDIR)$(DATAPATH) ++ install -m 644 $(LIBNAME) $(DESTDIR)$(LIBPATH) ++ install -m 644 $(HEADERS) $(DESTDIR)$(INCPATH) + ifndef NODOCS +- install -g $(GROUP) -o $(USER) doc/crypt.pdf $(DESTDIR)$(DATAPATH) ++ install -m 644 doc/crypt.pdf $(DESTDIR)$(DATAPATH) + endif + + install_test: testprof/$(LIBTEST) +- install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH) +- install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH) +- install -g $(GROUP) -o $(USER) testprof/$(LIBTEST) $(DESTDIR)$(LIBPATH) ++ install -d $(DESTDIR)$(LIBPATH) ++ install -d $(DESTDIR)$(INCPATH) ++ install -m 644 testprof/$(LIBTEST) $(DESTDIR)$(LIBPATH) + + profile: + CFLAGS="$(CFLAGS) -fprofile-generate" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov" +diff --git a/makefile.shared b/makefile.shared +index dd575d9..c5e97af 100644 +--- a/makefile.shared ++++ b/makefile.shared +@@ -252,11 +252,11 @@ $(LIBNAME): $(OBJECTS) testprof/$(LIBTEST) + libtool --silent --mode=link gcc $(CFLAGS) `find . -type f | grep "[.]lo" | grep "src/" | xargs` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION) + + install: $(LIBNAME) +- install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH) +- cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) DESTDIR=$(DESTDIR) make -f makefile.shared install ++ install -d $(DESTDIR)$(LIBPATH) ++ cd testprof ; CFLAGS="$(CFLAGS)" VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) DESTDIR=$(DESTDIR) make -f makefile.shared install + libtool --silent --mode=install install -c libtomcrypt.la $(DESTDIR)$(LIBPATH)/libtomcrypt.la +- install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH) +- install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH) ++ install -d $(DESTDIR)$(INCPATH) ++ install -m 644 $(HEADERS) $(DESTDIR)$(INCPATH) + + #This rule makes the hash program included with libtomcrypt + hashsum: library +-- +package/libtomcrypt/Config.in new file +11
-0@@ -0,0 +1,11 @@ +config BR2_PACKAGE_LIBTOMCRYPT + bool "libtomcrypt" + select BR2_PACKAGE_LIBTOMMATH + help + LibTomCrypt is a fairly comprehensive, modular and portable + cryptographic toolkit that provides developers with a vast array + of well known published block ciphers, one-way hash functions, + chaining modes, pseudo-random number generators, public key + cryptography and a plethora of other routines. + + http://www.libtom.netpackage/libtomcrypt/libtomcrypt.hash new file +2
-0@@ -0,0 +1,2 @@ +# Locally computed +sha256 e33b47d77a495091c8703175a25c8228aff043140b2554c08a3c3cd71f79d116 crypt-1.17.tar.bz2package/libtomcrypt/libtomcrypt.mk new file +23
-1@@ -0,0 +1,23 @@ +################################################################################ +# +# libtomcrypt +# +################################################################################ + +LIBTOMCRYPT_VERSION = 1.17 +LIBTOMCRYPT_SITE = https://github.com/libtom/libtomcrypt/releases/download/$(LIBTOMCRYPT_VERSION) +LIBTOMCRYPT_SOURCE = crypt-$(LIBTOMCRYPT_VERSION).tar.bz2 +LIBTOMCRYPT_LICENSE = WTFPL +LIBTOMCRYPT_LICENSE_FILES = LICENSE +LIBTOMCRYPT_INSTALL_STAGING = YES +LIBTOMCRYPT_DEPENDENCIES = libtommath + +define LIBTOMCRYPT_BUILD_CMDS + $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="-I./src/headers $(TARGET_CFLAGS) -DLTC_SOURCE -DLTM_DESC" +endef + +define LIBTOMCRYPT_INSTALL_STAGING_CMDS + $(MAKE) -C $(@D) DESTDIR="$(STAGING_DIR)" NODOCS=1 install +endef + +$(eval $(generic-package)) --2.5.0
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
PATCH v2 2/3 libtomcrypt: new package
In reply to Francois PerradHello,
Quoted 4 lines · Francois Perrad
Signed-off-by Francois Perrad <[email protected]>--- package/Config.in | 1 + .../0001-install-without-USER-and-GROUP.patch | 61 ++++++++++++++++++++++
Instead of this patch, can you try passing:
USER=$(id -u) GROUP=$(id -g)
in the make options ?
Quoted 16 lines
new file mode 100644
index 0000000..073d6e7package/libtomcrypt/libtomcrypt.mk new file +11
-0@@ -0,0 +1,23 @@ +################################################################################ +# +# libtomcrypt +# +################################################################################ + +LIBTOMCRYPT_VERSION = 1.17 +LIBTOMCRYPT_SITE = https://github.com/libtom/libtomcrypt/releases/download/$(LIBTOMCRYPT_VERSION) +LIBTOMCRYPT_SOURCE = crypt-$(LIBTOMCRYPT_VERSION).tar.bz2 +LIBTOMCRYPT_LICENSE = WTFPL +LIBTOMCRYPT_LICENSE_FILES = LICENSE
package/libtomcrypt/libtomcrypt.mk line 21
Quoted 10 lines
package/libtomcrypt/libtomcrypt.mk new file +10
-0+LIBTOMCRYPT_INSTALL_STAGING = YES +LIBTOMCRYPT_DEPENDENCIES = libtommath + +define LIBTOMCRYPT_BUILD_CMDS + $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="-I./src/headers $(TARGET_CFLAGS) -DLTC_SOURCE -DLTM_DESC" +endef + +define LIBTOMCRYPT_INSTALL_STAGING_CMDS + $(MAKE) -C $(@D) DESTDIR="$(STAGING_DIR)" NODOCS=1 install +endef
Same comment as libtommath regarding staging/target installation.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 3/3 dropbear: use libtomath & libtomcrypt
In reply to Francois Perrad--- package/dropbear/0001-fix-linking.patch | 36 +++++++++++++++++++++++++++++++++ package/dropbear/dropbear.mk | 7 +++++++ 2 files changed, 43 insertions(+) create mode 100644 package/dropbear/0001-fix-linking.patch
package/dropbear/0001-fix-linking.patch new file +36 -0
@@ -0,0 +1,36 @@ +fix linking + +see https://github.com/mkj/dropbear/pull/28 + +Signed-off-by: Francois Perrad <[email protected]> + +diff --git a/Makefile.in b/Makefile.in +index d9bfdfa..0356b0f 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -16,12 +16,12 @@ endif + STATIC_LTC=libtomcrypt/libtomcrypt.a + STATIC_LTM=libtommath/libtommath.a + +-LIBTOM_LIBS=@LIBTOM_LIBS@ ++LIBTOM_LIBS=-ltomcrypt -ltommath + + ifeq (@BUNDLED_LIBTOM@, 1) + LIBTOM_DEPS=$(STATIC_LTC) $(STATIC_LTM) + CFLAGS+=-I$(srcdir)/libtomcrypt/src/headers/ +-LIBTOM_LIBS=$(STATIC_LTC) $(STATIC_LTM) ++LDFLAGS+=-L ./libtomcrypt -L ./libtommath + endif + + COMMONOBJS=dbutil.o buffer.o dbhelpers.o \ +@@ -84,7 +84,7 @@ INSTALL=@INSTALL@ + CPPFLAGS=@CPPFLAGS@ + CFLAGS+=-I. -I$(srcdir) $(CPPFLAGS) @CFLAGS@ + LIBS+=@LIBS@ +-LDFLAGS=@LDFLAGS@ ++LDFLAGS+=@LDFLAGS@ + + EXEEXT=@EXEEXT@ + +-- +
package/dropbear/dropbear.mk +7 -0
@@ -12,6 +12,13 @@ DROPBEAR_LICENSE_FILES = LICENSE DROPBEAR_TARGET_BINS = dropbearkey dropbearconvert scp DROPBEAR_PROGRAMS = dropbear $(DROPBEAR_TARGET_BINS) +ifeq ($(BR2_PACKAGE_LIBTOMMATH)$(BR2_PACKAGE_LIBTOMCRYPT),yy) +DROPBEAR_DEPENDENCIES += libtommath libtomcrypt +DROPBEAR_CONF_OPTS += --disable-bundled-libtom +else +DROPBEAR_CONF_OPTS += --enable-bundled-libtom +endif + ifeq ($(BR2_PACKAGE_DROPBEAR_CLIENT),y) # Build dbclient, and create a convenience symlink named ssh DROPBEAR_PROGRAMS += dbclient
Signature · 1 line
2.5.0
PATCH v2 3/3 dropbear: use libtomath & libtomcrypt
Hello,
package/dropbear/dropbear.mk DROPBEAR_LICENSE_FILES = LICENSE · line 20
Quoted 6 lines · Francois Perrad
package/dropbear/dropbear.mk +6
-0+ifeq ($(BR2_PACKAGE_LIBTOMMATH)$(BR2_PACKAGE_LIBTOMCRYPT),yy) +DROPBEAR_DEPENDENCIES += libtommath libtomcrypt +DROPBEAR_CONF_OPTS += --disable-bundled-libtom +else +DROPBEAR_CONF_OPTS += --enable-bundled-libtom +endif
Our principle is to avoid bundled libraries when possible. So should we make Dropnbear always select libtommath/libtomcrypt ?
We could make an exception for Dropbear, as its main point is to be small and fast to build, and unbundling will necessarily mean a slightly longer build.
With bundled libraries (i.e original, building dropbear only) :
real 0m19.178s
user 0m35.240s
sys 0m5.308s
With unbundled libraries (i.e with libtommath/libtomcrypt built separately) :
real 0m23.593s
user 0m50.500s
sys 0m6.000s
Not super significant change. So I think I'm in favor of unbundling.
Other opinions?
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 1/3 libtommath: new package
In reply to Francois PerradQuoted 1 line · Francois Perrad
Signed-off-by Francois Perrad <[email protected]>
Quoted 78 lines
--- package/Config.in | 1 + package/libtommath/Config.in | 7 +++++++ package/libtommath/libtommath.hash | 2 ++ package/libtommath/libtommath.mk | 22 ++++++++++++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 package/libtommath/Config.in create mode 100644 package/libtommath/libtommath.hash create mode 100644 package/libtommath/libtommath.mkpackage/Config.in +1
-0@@ -1233,6 +1233,7 @@ menu "Other" source "package/libsigc/Config.in" source "package/libsigsegv/Config.in" source "package/libtasn1/Config.in" + source "package/libtommath/Config.in" source "package/libtpl/Config.in" source "package/libubox/Config.in" source "package/libuci/Config.in"package/libtommath/Config.in new file +7
-0@@ -0,0 +1,7 @@ +config BR2_PACKAGE_LIBTOMMATH + bool "libtommath" + help + LibTomMath is a free open source portable number theoretic + multiple-precision integer library written entirely in C. + + http://www.libtom.netpackage/libtommath/libtommath.hash new file +2
-0@@ -0,0 +1,2 @@ +# Locally computed +sha256 993a7df9ee091fca430cdde3263df57d88ef62af8103903214da49fc51bbb56c ltm-1.0.tar.xzpackage/libtommath/libtommath.mk new file +22
-1@@ -0,0 +1,22 @@ +################################################################################ +# +# libtommath +# +################################################################################ + +LIBTOMMATH_VERSION = 1.0 +LIBTOMMATH_SITE = https://github.com/libtom/libtommath/releases/download/v$(LIBTOMMATH_VERSION) +LIBTOMMATH_SOURCE = ltm-$(LIBTOMMATH_VERSION).tar.xz +LIBTOMMATH_LICENSE = WTFPL +LIBTOMMATH_LICENSE_FILES = LICENSE +LIBTOMMATH_INSTALL_STAGING = YES + +define LIBTOMMATH_BUILD_CMDS + $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="-I./ $(TARGET_CFLAGS)" +endef + +define LIBTOMMATH_INSTALL_STAGING_CMDS + $(MAKE) -C $(@D) DESTDIR="$(STAGING_DIR)" install +endef + +$(eval $(generic-package)) --2.5.0
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
PATCH v2 1/3 libtommath: new package
In reply to Francois PerradHello,
Quoted 18 lines · Francois Perrad
package/libtommath/libtommath.mk new file +12
-0@@ -0,0 +1,22 @@ +################################################################################ +# +# libtommath +# +################################################################################ + +LIBTOMMATH_VERSION = 1.0 +LIBTOMMATH_SITE = https://github.com/libtom/libtommath/releases/download/v$(LIBTOMMATH_VERSION) +LIBTOMMATH_SOURCE = ltm-$(LIBTOMMATH_VERSION).tar.xz +LIBTOMMATH_LICENSE = WTFPL +LIBTOMMATH_LICENSE_FILES = LICENSE +LIBTOMMATH_INSTALL_STAGING = YES
package/libtommath/libtommath.mk line 22
Quoted 10 lines
package/libtommath/libtommath.mk new file +10
-0+ +define LIBTOMMATH_BUILD_CMDS + $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="-I./ $(TARGET_CFLAGS)" +endef + +define LIBTOMMATH_INSTALL_STAGING_CMDS + $(MAKE) -C $(@D) DESTDIR="$(STAGING_DIR)" install +endef + +$(eval $(generic-package))
I guess if there is no INSTALL_TARGET_CMDS, it's because this library only installs a static variant, right? If that's the case, then doing LIBTOMMATH_INSTALL_TARGET = NO is a good idea, with a comment above it that explains why.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com