kumquat-buildroot/package/libest/libest.mk
Aleksandr Makarov f6f0e1e581 package/libest: new package
libest is a C implementation of RFC 7030 (Enrollment over
Secure Transport).

It can be used to provision public key certificates from
a certificate authority (CA) or registration authority (RA)
to end-user devices and network infrastructure devices.

https://github.com/cisco/libest

Notes on patches included in this package:

- libest bundles a stubbed version of libsafec, and has no provision
  to build against a system-installed full (non-stubbed) libsafec.
  We add a patch to make that possible.

- Added a configuration option --{enable,disable}-examples to toggle
  examples build by a separate patch.

- There's a configuration option `--enable-jni` which allows to build
  a JNI library for binding libest to Java programs. And that library
  would be using an outdated version of OpenSSL 1.0.
  We fix that by adding support for OpenSSL 1.1 API for that library.

- Fixed a bug when specifying either `--enable-FEATURE` or `--disable-FEATURE`
  has always been enabling the feature.

Signed-off-by: Aleksandr Makarov <aleksandr.o.makarov@gmail.com>
[Thomas:
- Added comments about the upstream status in existing patches
- Added a patch fixing an autoreconf issue
- Added a patch adding a missing "extern" on a variable to fix build
  with gcc 10
- Removed the glibc dependency by using the new libexecinfo package
- Drastically simplified the complex libcoap disabling and client-only
  mode vs. OpenJDK issue. libcoap support is now forcefully disabled,
  and client-mode only option is made invisible when OpenJDK is
  enabled.
- Fixed the license information;
- Added missing host-pkgconf
]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-01-08 14:29:27 +01:00

72 lines
2.0 KiB
Makefile

################################################################################
#
# libest
#
################################################################################
LIBEST_VERSION = 3.2.0
LIBEST_SITE = $(call github,cisco,libest,r$(LIBEST_VERSION))
# We don't build examples, so we're not affected by the OpenSSL
# license
LIBEST_LICENSE = BSD-3-Clause, MIT, W3C
LIBEST_LICENSE_FILES = LICENSE
LIBEST_INSTALL_STAGING = YES
LIBEST_AUTORECONF = YES
LIBEST_DEPENDENCIES = openssl host-pkgconf
# libcoap support is explicitly disabled because it breaks the build
LIBEST_CONF_OPTS = \
--with-ssl-dir=$(STAGING_DIR)/usr \
$(if $(BR2_TOOLCHAIN_HAS_THREADS),--enable-pthreads,--disable-pthreads) \
$(if $(BR2_PACKAGE_LIBEST_BRSKI),--enable-brski,--disable-brski) \
--disable-examples \
--without-libcoap-dir
ifeq ($(BR2_PACKAGE_LIBEXECINFO),y)
LIBEST_DEPENDENCIES += libexecinfo
LIBEST_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -lexecinfo"
endif
ifeq ($(BR2_PACKAGE_LIBEST_MODE_CLIENT_ONLY),y)
LIBEST_CONF_OPTS += --enable-client-only
else
LIBEST_CONF_OPTS += --disable-client-only
endif
ifeq ($(BR2_PACKAGE_OPENJDK),y)
LIBEST_MAKE_ENV += JAVA_HOME=$(HOST_DIR)/lib/jvm
LIBEST_CONF_ENV += JAVA_HOME=$(HOST_DIR)/lib/jvm
LIBEST_CONF_OPTS += --enable-jni
LIBEST_DEPENDENCIES += openjdk
else
LIBEST_CONF_OPTS += --disable-jni
endif
ifeq ($(BR2_PACKAGE_LIBCURL),y)
LIBEST_CONF_OPTS += --with-libcurl-dir=$(STAGING_DIR)/usr
LIBEST_DEPENDENCIES += libcurl
else
LIBEST_CONF_OPTS += --without-libcurl-dir
endif
ifeq ($(BR2_PACKAGE_LIBURIPARSER),y)
LIBEST_CONF_OPTS += --with-uriparser-dir=$(STAGING_DIR)/usr
LIBEST_DEPENDENCIES += liburiparser
else
LIBEST_CONF_OPTS += --without-uriparser-dir
endif
ifeq ($(BR2_PACKAGE_SAFECLIB),y)
LIBEST_CONF_OPTS += --with-system-libsafec
LIBEST_DEPENDENCIES += safeclib
else
LIBEST_CONF_OPTS += --without-system-libsafec
endif
define LIBEST_INSTALL_PC
$(INSTALL) -c -m 0644 $(LIBEST_PKGDIR)/libest.pc \
$(STAGING_DIR)/usr/lib/pkgconfig/libest.pc
endef
LIBEST_POST_INSTALL_STAGING_HOOKS += LIBEST_INSTALL_PC
$(eval $(autotools-package))