ucert: work around short read
[openwrt/openwrt.git] / package / system / ucert / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=ucert
4 PKG_RELEASE:=1
5
6 PKG_SOURCE_PROTO:=git
7 PKG_SOURCE_URL=$(PROJECT_GIT)/project/ucert.git
8 PKG_SOURCE_DATE:=2018-09-18
9 PKG_SOURCE_VERSION:=e1c722b1b6cbf2527b3178342464e56b97825874
10 PKG_MIRROR_HASH:=36dcca7c2d649a6c34a8daaaef4698fbeb808fd6580c6bfb1ca35f4f06825d17
11
12 CMAKE_INSTALL:=1
13 PKG_CHECK_FORMAT_SECURITY:=1
14
15 PKG_LICENSE:=GPL-3.0+
16 PKG_LICENSE_FILES:=COPYING
17
18 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
19
20 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
21
22 include $(INCLUDE_DIR)/package.mk
23 include $(INCLUDE_DIR)/host-build.mk
24 include $(INCLUDE_DIR)/cmake.mk
25
26 CMAKE_HOST_OPTIONS += \
27 -DUCERT_FULL=1 \
28 -DUCERT_HOST_BUILD=1 \
29 -DCMAKE_SKIP_RPATH=FALSE \
30 -DUSE_RPATH="${STAGING_DIR_HOST}/lib"
31
32 HOST_BUILD_DEPENDS:=libubox/host libjson-c/host usign/host
33 HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST)
34 PKG_BUILD_DEPENDS:=ucert/host
35
36 define Package/ucert-full
37 SECTION:=base
38 CATEGORY:=Base system
39 DEPENDS:=+usign +libubox +libjson-c +libblobmsg-json
40 TITLE:=OpenWrt certificate generation and verification utility
41 PROVIDES:=ucert
42 VARIANT:=full
43 endef
44
45 define Package/ucert
46 SECTION:=base
47 CATEGORY:=Base system
48 DEPENDS:=+usign +libubox
49 TITLE:=OpenWrt certificate verification utility
50 CONFLICTS:=ucert-full
51 VARIANT:=tiny
52 endef
53
54 ifeq ($(BUILD_VARIANT),full)
55 CMAKE_OPTIONS += -DUCERT_FULL=1
56 endif
57
58 define Build/Prepare
59 mkdir -p $(PKG_BUILD_DIR)
60 $(call Build/Prepare/Default)
61 endef
62
63 define Package/ucert/install
64 $(INSTALL_DIR) $(1)/usr/bin
65 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ucert $(1)/usr/bin
66 endef
67
68 Package/ucert-full/install = $(Package/ucert/install)
69
70 $(eval $(call BuildPackage,ucert))
71 $(eval $(call BuildPackage,ucert-full))
72 $(eval $(call HostBuild))