ucert: add package
[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-06-10
9 PKG_SOURCE_VERSION:=46eec66b190470254fc01973f208dc056bcb9780
10 PKG_MIRROR_HASH:=43868aa490fd7a8962586d15e9be9bfff437fe02765ac580c8f244616fa4dff4
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 include $(INCLUDE_DIR)/package.mk
21 include $(INCLUDE_DIR)/host-build.mk
22 include $(INCLUDE_DIR)/cmake.mk
23
24 CMAKE_HOST_OPTIONS += -DUCERT_FULL=1 -DUCERT_HOST_BUILD=1
25 HOST_BUILD_DEPENDS:=libubox/host libjson-c/host usign/host
26 PKG_BUILD_DEPENDS:=ucert/host
27 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
28
29 define Package/ucert-full
30 SECTION:=base
31 CATEGORY:=Base system
32 DEPENDS:=+usign +libubox +libjson-c +libblobmsg-json
33 TITLE:=OpenWrt certificate generation and verification utility
34 PROVIDES:=ucert
35 VARIANT:=full
36 endef
37
38 define Package/ucert
39 SECTION:=base
40 CATEGORY:=Base system
41 DEPENDS:=+usign +libubox
42 TITLE:=OpenWrt certificate verification utility
43 CONFLICTS:=ucert-full
44 VARIANT:=tiny
45 endef
46
47 ifeq ($(BUILD_VARIANT),full)
48 CMAKE_OPTIONS += -DUCERT_FULL=1
49 endif
50
51 define Package/ucert/install
52 $(INSTALL_DIR) $(1)/usr/bin
53 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ucert $(1)/usr/bin
54 endef
55
56 Package/ucert-full/install = $(Package/ucert/install)
57
58 $(eval $(call BuildPackage,ucert))
59 $(eval $(call BuildPackage,ucert-full))
60 $(eval $(call HostBuild))