lede-packages-rs

git clone git://archive.git.mtrnord.blog/MTRNord/lede-packages-rs.git
Log | Files | Refs | README | LICENSE

Makefile (5710B)


      1 #
      2 # Copyright (C) 2005-2016 OpenWrt.org
      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:=gnutls
     11 PKG_VERSION:=3.5.9
     12 PKG_RELEASE:=1
     13 PKG_USE_MIPS16:=0
     14 
     15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
     16 PKG_SOURCE_URL:=ftp://ftp.gnutls.org/gcrypt/gnutls/v3.5
     17 PKG_MD5SUM:=0ab25eb6a1509345dd085bc21a387951
     18 #PKG_FIXUP:=autoreconf gettext-version
     19 PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
     20 PKG_LICENSE:=LGPLv2.1+
     21 
     22 PKG_INSTALL:=1
     23 PKG_LIBTOOL_PATHS:=. lib
     24 PKG_CHECK_FORMAT_SECURITY:=0
     25 
     26 PKG_CONFIG_DEPENDS:= \
     27 	CONFIG_GNUTLS_ALPN \
     28 	CONFIG_GNUTLS_ANON \
     29 	CONFIG_GNUTLS_CRYPTODEV \
     30 	CONFIG_GNUTLS_DTLS_SRTP \
     31 	CONFIG_GNUTLS_EXT_LIBTASN1 \
     32 	CONFIG_GNUTLS_HEARTBEAT \
     33 	CONFIG_GNUTLS_OCSP \
     34 	CONFIG_GNUTLS_OPENPGP \
     35 	CONFIG_GNUTLS_PKCS11 \
     36 	CONFIG_GNUTLS_PSK \
     37 	CONFIG_GNUTLS_SRP \
     38 	CONFIG_GNUTLS_TPM \
     39 	CONFIG_LIBNETTLE_MINI \
     40 
     41 include $(INCLUDE_DIR)/package.mk
     42 
     43 
     44 define Package/gnutls/Default
     45   SUBMENU:=SSL
     46   SECTION:=libs
     47   CATEGORY:=Libraries
     48   TITLE:=GNU TLS
     49   URL:=http://www.gnutls.org/
     50 endef
     51 
     52 define Package/gnutls/Default/description
     53  GnuTLS is a secure communications library implementing the SSL, TLS
     54  and DTLS protocols and technologies around them. It provides a simple
     55  C language application programming interface (API) to access the secure
     56  communications protocols as well as APIs to parse and write X.509, PKCS12,
     57  OpenPGP and other required structures. It is aimed to be portable and
     58  efficient with focus on security and interoperability.
     59 endef
     60 
     61 
     62 define Package/certtool
     63 $(call Package/gnutls/Default)
     64   SECTION:=utils
     65   CATEGORY:=Utilities
     66   SUBMENU:=Encryption
     67   TITLE+= (certool utility)
     68   DEPENDS+= +libgnutls
     69 endef
     70 
     71 define Package/certtool/description
     72 $(call Package/gnutls/Default/description)
     73  This package contains the GnuTLS certtool utility.
     74 endef
     75 
     76 
     77 define Package/gnutls-utils
     78 $(call Package/gnutls/Default)
     79   SECTION:=utils
     80   CATEGORY:=Utilities
     81   SUBMENU:=Encryption
     82   TITLE+= (utilities)
     83   DEPENDS+= +libgnutls
     84 endef
     85 
     86 define Package/gnutls-utils/description
     87 $(call Package/gnutls/Default/description)
     88  This package contains the GnuTLS gnutls-cli, gnutls-serv, psktool,
     89  and srptool utilities.
     90 endef
     91 
     92 define Package/libgnutls/config
     93 	source "$(SOURCE)/Config.in"
     94 endef
     95 
     96 define Package/libgnutls
     97 $(call Package/gnutls/Default)
     98   TITLE+= (library)
     99   DEPENDS+= +libnettle +!LIBNETTLE_MINI:libgmp +GNUTLS_EXT_LIBTASN1:libtasn1 +GNUTLS_PKCS11:p11-kit +GNUTLS_CRYPTODEV:kmod-cryptodev
    100 endef
    101 
    102 define Package/libgnutls/description
    103 $(call Package/gnutls/Default/description)
    104  This package contains the GnuTLS shared library, needed by other programs.
    105 endef
    106 
    107 
    108 CONFIGURE_ARGS+= \
    109 	--enable-shared \
    110 	--enable-static \
    111 	--disable-rpath \
    112 	--disable-libdane \
    113 	--with-included-unistring \
    114 	--disable-guile \
    115 	--disable-nls \
    116 	--without-idn \
    117 	--without-zlib \
    118 	--enable-local-libopts \
    119 	--disable-doc \
    120 	--disable-tests \
    121 	--with-default-trust-store-dir=/etc/ssl/certs/ \
    122 	--disable-crywrap \
    123 	--with-librt-prefix="$(LIBRT_ROOT_DIR)/"
    124 
    125 ifneq ($(CONFIG_GNUTLS_EXT_LIBTASN1),y)
    126 CONFIGURE_ARGS += --with-included-libtasn1
    127 endif
    128 
    129 ifneq ($(CONFIG_GNUTLS_PKCS11),y)
    130 CONFIGURE_ARGS += --without-p11-kit
    131 endif
    132 
    133 ifeq ($(CONFIG_LIBNETTLE_MINI),y)
    134 CONFIGURE_ARGS += --with-nettle-mini
    135 endif
    136 
    137 ifneq ($(CONFIG_GNUTLS_DTLS_SRTP),y)
    138 CONFIGURE_ARGS += --disable-dtls-srtp-support
    139 endif
    140 
    141 ifneq ($(CONFIG_GNUTLS_ALPN),y)
    142 CONFIGURE_ARGS += --disable-alpn-support
    143 endif
    144 
    145 ifneq ($(CONFIG_GNUTLS_HEARTBEAT),y)
    146 CONFIGURE_ARGS += --disable-heartbeat-support
    147 endif
    148 
    149 ifneq ($(CONFIG_GNUTLS_SRP),y)
    150 CONFIGURE_ARGS += --disable-srp-authentication
    151 endif
    152 
    153 ifneq ($(CONFIG_GNUTLS_PSK),y)
    154 CONFIGURE_ARGS += --disable-psk-authentication
    155 endif
    156 
    157 ifneq ($(CONFIG_GNUTLS_OPENPGP),y)
    158 CONFIGURE_ARGS += --disable-openpgp-authentication
    159 endif
    160 
    161 ifneq ($(CONFIG_GNUTLS_ANON),y)
    162 CONFIGURE_ARGS += --disable-anon-authentication
    163 endif
    164 
    165 ifneq ($(CONFIG_GNUTLS_OCSP),y)
    166 CONFIGURE_ARGS += --disable-ocsp
    167 endif
    168 
    169 ifneq ($(CONFIG_GNUTLS_TPM),y)
    170 CONFIGURE_ARGS += --without-tpm
    171 endif
    172 
    173 ifeq ($(CONFIG_GNUTLS_CRYPTODEV),y)
    174 CONFIGURE_ARGS += --enable-cryptodev
    175 endif
    176 
    177 TARGET_CFLAGS += $(FPIC)
    178 
    179 define Build/InstallDev
    180 	$(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
    181 	$(CP) \
    182 		$(PKG_INSTALL_DIR)/usr/lib/libgnutls.so* \
    183 		$(1)/usr/lib/
    184 	$(CP) \
    185 		$(PKG_INSTALL_DIR)/usr/include/gnutls \
    186 		$(1)/usr/include/
    187 	$(CP) \
    188 		$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls.pc \
    189 		$(1)/usr/lib/pkgconfig/
    190 endef
    191 
    192 
    193 define Package/certtool/conffiles
    194 /etc/gnutls/certtool.cfg
    195 endef
    196 
    197 define Package/certtool/install
    198 	$(INSTALL_DIR) $(1)/etc/gnutls
    199 	$(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
    200 	$(INSTALL_DIR) $(1)/usr/bin
    201 	$(CP) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
    202 endef
    203 
    204 
    205 define Package/gnutls-utils/install
    206 	$(INSTALL_DIR) $(1)/usr/bin
    207 ifeq ($(CONFIG_GNUTLS_OCSP),y)
    208 ifeq ($(CONFIG_GNUTLS_ANON),y)
    209 	$(CP) \
    210 		$(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} \
    211 		$(1)/usr/bin/
    212 endif
    213 	$(CP) \
    214 		$(PKG_INSTALL_DIR)/usr/bin/ocsptool \
    215 		$(1)/usr/bin/
    216 endif
    217 ifeq ($(CONFIG_GNUTLS_SRP),y)
    218 	$(CP) \
    219 		$(PKG_INSTALL_DIR)/usr/bin/srptool \
    220 		$(1)/usr/bin/
    221 endif
    222 ifeq ($(CONFIG_GNUTLS_PSK),y)
    223 	$(CP) \
    224 		$(PKG_INSTALL_DIR)/usr/bin/psktool \
    225 		$(1)/usr/bin/
    226 endif
    227 ifeq ($(CONFIG_GNUTLS_PKCS11),y)
    228 	$(CP) \
    229 		$(PKG_INSTALL_DIR)/usr/bin/p11tool \
    230 		$(1)/usr/bin/
    231 endif
    232 ifeq ($(CONFIG_GNUTLS_TPM),y)
    233 	$(CP) \
    234 		$(PKG_INSTALL_DIR)/usr/bin/tpmtool \
    235 		$(1)/usr/bin/
    236 endif
    237 endef
    238 
    239 
    240 define Package/libgnutls/install
    241 	$(INSTALL_DIR) $(1)/usr/lib
    242 	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
    243 endef
    244 
    245 
    246 $(eval $(call BuildPackage,certtool))
    247 $(eval $(call BuildPackage,gnutls-utils))
    248 $(eval $(call BuildPackage,libgnutls))