From 0cad8e8a7e66e69641d01cd48a724a42655b7e7f Mon Sep 17 00:00:00 2001 From: Lukas Voegl Date: Mon, 24 Jun 2024 16:28:11 +0200 Subject: [PATCH] libjcat: add package Signed-off-by: Lukas Voegl --- libs/libjcat/Config.in | 22 +++++++++++ libs/libjcat/Makefile | 83 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 libs/libjcat/Config.in create mode 100644 libs/libjcat/Makefile diff --git a/libs/libjcat/Config.in b/libs/libjcat/Config.in new file mode 100644 index 0000000000..db1528df7e --- /dev/null +++ b/libs/libjcat/Config.in @@ -0,0 +1,22 @@ +menu "Select libjcat options" + depends on PACKAGE_libjcat + +config LIBJCAT_GPG + bool "GPG" + default y + help + Compile libjcat with GPG support + +config LIBJCAT_PKCS7 + bool "PKCS #7" + default y + help + Compile libjcat with PKCS #7 support + +config LIBJCAT_ED25519 + bool "ed25519" + default n + help + Compile libjcat with ed25519 support + +endmenu diff --git a/libs/libjcat/Makefile b/libs/libjcat/Makefile new file mode 100644 index 0000000000..daece53035 --- /dev/null +++ b/libs/libjcat/Makefile @@ -0,0 +1,83 @@ +# +# Copyright (C) 2024 TDT AG +# +# This is free software, licensed under the GNU General Public License v2. +# See https://www.gnu.org/licenses/gpl-2.0.txt for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libjcat +PKG_VERSION:=0.2.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=https://github.com/hughsie/libjcat/releases/download/$(PKG_VERSION) +PKG_HASH:=a6232aeca3c3fab6dbb3bed06ec3832088b49a4b278a7119558d72be60ce921f + +PKG_MAINTAINER:=Lukas Voegl +PKG_LICENSE:=LGPL-2.1-or-later +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=glib2/host + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk +include $(INCLUDE_DIR)/meson.mk + +define Package/libjcat + SECTION:=libs + CATEGORY:=Libraries + TITLE:=libjcat + URL:=https://github.com/hughsie/libjcat + DEPENDS:= \ + +glib2 \ + +json-glib \ + +LIBJCAT_GPG:libgpgme \ + +LIBJCAT_GPG:libgpg-error \ + +LIBJCAT_PKCS7:libgnutls \ + +LIBJCAT_ED25519:libgnutls \ + +LIBJCAT_ED25519:libnettle +endef + +define Package/libjcat/description + libjcat allows reading and writing gzip-compressed JSON catalog files, + which can be used to store GPG, PKCS-7 and SHA-256 checksums for each file. +endef + +define Package/libjcat/config + source "$(SOURCE)/Config.in" +endef + +MESON_ARGS += \ + -Db_lto=true \ + -Dgtkdoc=false \ + -Dintrospection=false \ + -Dvapi=false \ + -Dtests=false \ + -Dman=false \ + -Dcli=false \ + -Dgpg=$(if $(CONFIG_LIBJCAT_GPG),true,false) \ + -Dpkcs7=$(if $(CONFIG_LIBJCAT_PKCS7),true,false) \ + -Ded25519=$(if $(CONFIG_LIBJCAT_ED25519),true,false) + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/libjcat-1 + $(CP) $(PKG_INSTALL_DIR)/usr/include/libjcat-1/jcat.h $(1)/usr/include/libjcat-1/jcat.h + + $(INSTALL_DIR) $(1)/usr/include/libjcat-1/libjcat + $(CP) $(PKG_INSTALL_DIR)/usr/include/libjcat-1/libjcat/*.h $(1)/usr/include/libjcat-1/libjcat + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjcat.so* $(1)/usr/lib + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/jcat.pc $(1)/usr/lib/pkgconfig +endef + +define Package/libjcat/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjcat.so* $(1)/usr/lib +endef + +$(eval $(call BuildPackage,libjcat)) -- 2.30.2