Skip to contentSkip to conversation

libtommath: new package

PATCH Superseded Francois Perrad 5 participants 9 messages Apr 1, 2016

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 libtommath: new package

---
 package/Config.in                |  1 +
 package/libtommath/Config.in     |  7 +++++++
 package/libtommath/libtommath.mk | 21 +++++++++++++++++++++
 3 files changed, 29 insertions(+)
 create mode 100644 package/libtommath/Config.in
 create mode 100644 package/libtommath/libtommath.mk
package/Config.in +1 -0
index 7b23519..84df812 100644
@@ -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
new file mode 100644
index 0000000..b2ffc72
@@ -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.mk new file +21 -0
new file mode 100644
index 0000000..44f21ff
@@ -0,0 +1,21 @@
+################################################################################
+#
+# libtommath
+#
+################################################################################
+
+LIBTOMMATH_VERSION = v1.0
+LIBTOMMATH_SITE = $(call github,libtom,libtommath,$(LIBTOMMATH_VERSION))
+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
#1 lore raw

PATCH 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.mk                 | 22 ++++++++
 4 files changed, 95 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.mk
package/Config.in +1 -0
index 84df812..b38b24b 100644
@@ -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
new file mode 100644
index 0000000..6678b30
@@ -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.mk new file +22 -0
new file mode 100644
index 0000000..921eed3
@@ -0,0 +1,22 @@
+################################################################################
+#
+# libtomcrypt
+#
+################################################################################
+
+LIBTOMCRYPT_VERSION = 1.17
+LIBTOMCRYPT_SITE = $(call github,libtom,libtomcrypt,$(LIBTOMCRYPT_VERSION))
+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
#2 lore raw

PATCH 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
new file mode 100644
index 0000000..93925eb
@@ -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
index 32e2167..f664c8d 100644
@@ -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
#3 lore raw

PATCH 3/3 dropbear: use libtomath & libtomcrypt

Hi Francois,

package/dropbear/dropbear.mk DROPBEAR_LICENSE_FILES = LICENSE · line 16

Quoted 2 lines · Francois Perrad
package/dropbear/dropbear.mk +2 -0
+ifeq ($(BR2_PACKAGE_LIBTOMMATH)$(BR2_PACKAGE_LIBTOMCRYPT),yy)
+DROPBEAR_DEPENDENCIES += libtommath libtomcrypt

Does dropbear code use libtommath directly? If not, listing only libtomcrypt should be enough. The check for BR2_PACKAGE_LIBTOMMATH can also be dropped in this case.

package/dropbear/dropbear.mk DROPBEAR_LICENSE_FILES = LICENSE · line 24

Quoted 8 lines
package/dropbear/dropbear.mk +5 -0
+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

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#4 lore raw

PATCH 3/3 dropbear: use libtomath & libtomcrypt

2016-04-01 10:42 GMT+02:00 Baruch Siach <[email protected]>:

Quoted 10 lines

Hi Francois,

package/dropbear/dropbear.mk DROPBEAR_LICENSE_FILES = LICENSE · line 16

Quoted 2 lines · Francois Perrad
package/dropbear/dropbear.mk +2 -0
+ifeq ($(BR2_PACKAGE_LIBTOMMATH)$(BR2_PACKAGE_LIBTOMCRYPT),yy)
+DROPBEAR_DEPENDENCIES += libtommath libtomcrypt

Does dropbear code use libtommath directly? If not, listing only libtomcrypt should be enough. The check for BR2_PACKAGE_LIBTOMMATH can also be dropped in this case.

The configure script of dropbear checks the presence of both libraries : libtommath and libtomcrypt.
See https://github.com/mkj/dropbear/blob/master/configure.ac#L391

Fran?ois

Quoted 19 lines

package/dropbear/dropbear.mk DROPBEAR_LICENSE_FILES = LICENSE · line 24

Quoted 8 lines
package/dropbear/dropbear.mk +5 -0
+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

baruch

--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#5 lore raw

PATCH 1/3 libtommath: new package

In reply to Francois Perrad

Hi Francois,

Quoted 5 lines · Francois Perrad
---
 package/Config.in                |  1 +
 package/libtommath/Config.in     |  7 +++++++
 package/libtommath/libtommath.mk | 21 +++++++++++++++++++++

hash file is missing

Quoted 35 lines
 3 files changed, 29 insertions(+)
 create mode 100644 package/libtommath/Config.in
 create mode 100644 package/libtommath/libtommath.mk
package/Config.in +1 -0
index 7b23519..84df812 100644
@@ -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
new file mode 100644
index 0000000..b2ffc72
@@ -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.mk new file +0 -0
new file mode 100644
index 0000000..44f21ff

package/libtommath/libtommath.mk line 8

Quoted 8 lines
package/libtommath/libtommath.mk new file +8 -0
@@ -0,0 +1,21 @@
+################################################################################
+#
+# libtommath
+#
+################################################################################
+
+LIBTOMMATH_VERSION = v1.0
+LIBTOMMATH_SITE = $(call github,libtom,libtommath,$(LIBTOMMATH_VERSION))

why don't you take official release tarballs? The same for libtomcrypt

Yegor

Quoted 20 lines
package/libtommath/libtommath.mk new file +13 -1
+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

#6 lore raw

PATCH 1/3 libtommath: new package

2016-04-01 10:19 GMT+02:00 Yegor Yefremov <[email protected]>:

Quoted 48 lines

Hi Francois,

Quoted 5 lines · Francois Perrad
---
 package/Config.in                |  1 +
 package/libtommath/Config.in     |  7 +++++++
 package/libtommath/libtommath.mk | 21 +++++++++++++++++++++

hash file is missing

Quoted 37 lines
 3 files changed, 29 insertions(+)
 create mode 100644 package/libtommath/Config.in
 create mode 100644 package/libtommath/libtommath.mk
package/Config.in +1 -0
index 7b23519..84df812 100644
@@ -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
new file mode 100644
index 0000000..b2ffc72
@@ -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.mk new file +2 -0
new file mode 100644
index 0000000..44f21ff
@@ -0,0 +1,21 @@
+################################################################################
+#
Quoted 9 lines

package/libtommath/libtommath.mk line 8

Quoted 6 lines
package/libtommath/libtommath.mk new file +6 -0
+# libtommath
+#
+################################################################################
+
+LIBTOMMATH_VERSION = v1.0
+LIBTOMMATH_SITE = $(call github,libtom,libtommath,$(LIBTOMMATH_VERSION))

why don't you take official release tarballs? The same for libtomcrypt

on http://www.libtom.net/, all links are on Github:
- https://github.com/libtom/libtomcrypt/tree/1.17
- https://github.com/libtom/libtomcrypt/releases/download/1.17/crypt-1.17.tar.bz2
- https://github.com/libtom/libtommath/tree/v1.0
- https://github.com/libtom/libtommath/releases/download/v1.0/ltm-1.0.tar.xz

and as far I know, the Github helper is not reliable for hash.

Fran?ois

Quoted 26 lines

Yegor

Quoted 16 lines
package/libtommath/libtommath.mk new file +13 -1
+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

Quoted 4 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#7 lore raw

PATCH 1/3 libtommath: new package

Quoted 59 lines · Fran?ois Perrad

2016-04-01 10:19 GMT+02:00 Yegor Yefremov <[email protected]>:

Quoted 48 lines

Hi Francois,

Quoted 5 lines · Francois Perrad
---
 package/Config.in                |  1 +
 package/libtommath/Config.in     |  7 +++++++
 package/libtommath/libtommath.mk | 21 +++++++++++++++++++++

hash file is missing

Quoted 37 lines
 3 files changed, 29 insertions(+)
 create mode 100644 package/libtommath/Config.in
 create mode 100644 package/libtommath/libtommath.mk
package/Config.in +1 -0
index 7b23519..84df812 100644
@@ -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
new file mode 100644
index 0000000..b2ffc72
@@ -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.mk new file +2 -0
new file mode 100644
index 0000000..44f21ff
@@ -0,0 +1,21 @@
+################################################################################
+#
Quoted 9 lines

package/libtommath/libtommath.mk line 8

Quoted 6 lines
package/libtommath/libtommath.mk new file +6 -0
+# libtommath
+#
+################################################################################
+
+LIBTOMMATH_VERSION = v1.0
+LIBTOMMATH_SITE = $(call github,libtom,libtommath,$(LIBTOMMATH_VERSION))

why don't you take official release tarballs? The same for libtomcrypt

Quoted 7 lines

on http://www.libtom.net/, all links are on Github:
- https://github.com/libtom/libtomcrypt/tree/1.17
- https://github.com/libtom/libtomcrypt/releases/download/1.17/crypt-1.17.tar.bz2
- https://github.com/libtom/libtommath/tree/v1.0
- https://github.com/libtom/libtommath/releases/download/v1.0/ltm-1.0.tar.xz

and as far I know, the Github helper is not reliable for hash.

You don't need the GitHub helper as 1.17 and 1.0 are official "green" releases. Just take a look how this is handled for tmux package.

Yegor

#8 lore raw

PATCH 1/3 libtommath: new package

In reply to François Perrad

Hello Fran?ois,

Quoted 1 line · Fran?ois Perrad

2016-04-01 10:19 GMT+02:00 Yegor Yefremov <[email protected]>:

[snip]

Quoted 14 lines
Quoted 4 lines
Quoted 4 lines

+++ b/package/libtommath/libtommath.mk

(quoted diff) +2 -0
@@ -0,0 +1,21 @@
+################################################################################
+#
Quoted 9 lines

package/libtommath/libtommath.mk line 8

Quoted 6 lines
package/libtommath/libtommath.mk new file +6 -0
+# libtommath
+#
+################################################################################
+
+LIBTOMMATH_VERSION = v1.0
+LIBTOMMATH_SITE = $(call github,libtom,libtommath,$(LIBTOMMATH_VERSION))

why don't you take official release tarballs? The same for libtomcrypt

Quoted 7 lines

on http://www.libtom.net/, all links are on Github:
- https://github.com/libtom/libtomcrypt/tree/1.17
- https://github.com/libtom/libtomcrypt/releases/download/1.17/crypt-1.17.tar.bz2
- https://github.com/libtom/libtommath/tree/v1.0
- https://github.com/libtom/libtommath/releases/download/v1.0/ltm-1.0.tar.xz

and as far I know, the Github helper is not reliable for hash.

as far as I know, it is reliable and we have hash files for all github packages in Buildroot. See package/a10dist for instance.

But, if you use the released tarballs (even if they are hosted in github), you will not need to use the github helper. Just:

LIBTOMMATH_VERSION = 1.0
LIBTOMMATH_SITE =
https://github.com/libtom/libtommath/releases/download/v$(LIBTOMMATH_VERSION)
LIBTOMMATH_SOURCE = ltm-$(LIBTOMMATH_VERSION).tar.xz

Regards,

Vincent.