2 # Copyright (C) 2010-2015 Jo-Philipp Wich <jo@mein.io>
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
13 PKG_BUILD_DIR:=$(BUILD_DIR)/px5g-$(BUILD_VARIANT)
17 include $(INCLUDE_DIR)/package.mk
19 define Package/px5g/Template
22 TITLE:=X.509 certificate generator (using $(1))
23 MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
29 define Package/px5g-polarssl/description
30 Px5g is a tiny standalone X.509 certificate generator.
31 It suitable to create key files and certificates in DER
32 and PEM format for use with stunnel, uhttpd and others.
35 Package/px5g-mbedtls=$(call Package/px5g/Template,mbedtls)
36 Package/px5g-polarssl=$(call Package/px5g/Template,polarssl)
37 Package/px5g-mbedtls/description=$(Package/px5g-polarssl/description)
40 mkdir -p $(PKG_BUILD_DIR)
43 ifeq ($(BUILD_VARIANT),mbedtls)
44 TARGET_CFLAGS += -DMBEDTLS
45 TARGET_LDFLAGS := -lmbedtls -lmbedx509 -lmbedcrypto
47 TARGET_LDFLAGS := -lpolarssl
51 $(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/px5g px5g.c $(TARGET_LDFLAGS)
54 define Package/px5g-polarssl/install
55 $(INSTALL_DIR) $(1)/usr/sbin
56 $(INSTALL_BIN) $(PKG_BUILD_DIR)/px5g $(1)/usr/sbin/px5g
59 Package/px5g-mbedtls/install=$(Package/px5g-polarssl/install)
61 $(eval $(call BuildPackage,px5g-polarssl))
62 $(eval $(call BuildPackage,px5g-mbedtls))