px5g: move to Encryption submenu
[openwrt/staging/yousong.git] / package / utils / px5g / Makefile
1 #
2 # Copyright (C) 2010-2015 Jo-Philipp Wich <jo@mein.io>
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=px5g
11 PKG_RELEASE:=4
12 PKG_LICENSE:=LGPL-2.1
13 PKG_BUILD_DIR:=$(BUILD_DIR)/px5g-$(BUILD_VARIANT)
14
15 PKG_USE_MIPS16:=0
16
17 include $(INCLUDE_DIR)/package.mk
18
19 define Package/px5g/Template
20 SECTION:=utils
21 CATEGORY:=Utilities
22 SUBMENU:=Encryption
23 TITLE:=X.509 certificate generator (using $(1))
24 MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
25 DEPENDS:=+lib$(1)
26 PROVIDES:=px5g
27 VARIANT:=$(1)
28 endef
29
30 define Package/px5g-polarssl/description
31 Px5g is a tiny standalone X.509 certificate generator.
32 It suitable to create key files and certificates in DER
33 and PEM format for use with stunnel, uhttpd and others.
34 endef
35
36 Package/px5g-mbedtls=$(call Package/px5g/Template,mbedtls)
37 Package/px5g-polarssl=$(call Package/px5g/Template,polarssl)
38 Package/px5g-mbedtls/description=$(Package/px5g-polarssl/description)
39
40 define Build/Prepare
41 mkdir -p $(PKG_BUILD_DIR)
42 endef
43
44 ifeq ($(BUILD_VARIANT),mbedtls)
45 TARGET_CFLAGS += -DMBEDTLS
46 TARGET_LDFLAGS := -lmbedtls -lmbedx509 -lmbedcrypto
47 else
48 TARGET_LDFLAGS := -lpolarssl
49 endif
50
51 define Build/Compile
52 $(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/px5g px5g.c $(TARGET_LDFLAGS)
53 endef
54
55 define Package/px5g-polarssl/install
56 $(INSTALL_DIR) $(1)/usr/sbin
57 $(INSTALL_BIN) $(PKG_BUILD_DIR)/px5g $(1)/usr/sbin/px5g
58 endef
59
60 Package/px5g-mbedtls/install=$(Package/px5g-polarssl/install)
61
62 $(eval $(call BuildPackage,px5g-polarssl))
63 $(eval $(call BuildPackage,px5g-mbedtls))