aboutsummaryrefslogtreecommitdiff
path: root/utils/gnupg2/Makefile
blob: 5982d3d1db41f90d025b72a12e92835fac657cfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#
# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=gnupg
PKG_VERSION:=2.2.39
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://gnupg.org/ftp/gcrypt/gnupg
PKG_HASH:=ab74db6685f026d7c0a10b527ecddecd608606a1691d15fda5d0a7f7d27e4c2f

PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=COPYING COPYING.CC0 COPYING.GPL2 COPYING.LGPL21 COPYING.LGPL3 COPYING.other
PKG_CPE_ID:=cpe:/a:gnupg:gnupg

PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk

define Package/gnupg2/Default
  SECTION:=utils
  CATEGORY:=Utilities
  SUBMENU:=Encryption
  DEPENDS:=+libgpg-error +libnpth +libassuan +libksba +libgcrypt +zlib +libncurses +libreadline $(ICONV_DEPENDS) $(INTL_DEPENDS)
  TITLE:=GNU privacy guard (version 2) - a free PGP replacement
  URL:=http://www.gnupg.org/
endef

define Package/gnupg2
  $(call Package/gnupg2/Default)
  MENU:=1
  ALTERNATIVES:=300:/usr/bin/gpg:/usr/bin/gpg2
endef

define Package/gpgv2
  $(call Package/gnupg2/Default)
  TITLE:=GnuPG signature verification only (version 2)
  ALTERNATIVES:=300:/usr/bin/gpgv:/usr/bin/gpgv2
endef

define Package/gnupg2-dirmngr
  $(call Package/gnupg2/Default)
  TITLE:=Keyserver, CRL, and OCSP access for GnuPG (version 2)
endef

define Package/gnupg2-utils
  $(call Package/gnupg2/Default)
  DEPENDS:=gnupg2 +libcurl
  TITLE:=Key management utilities for GnuPG (version 2)
endef

define Package/gnupg2/description
GnuPG is a complete and free implementation of the OpenPGP standard as
defined by RFC4880 (also known as PGP). GnuPG allows you to encrypt and
sign your data and communications; it features a versatile key
management system, along with access modules for all kinds of public
key directories. GnuPG, also known as GPG, is a command line tool with
features for easy integration with other applications. A wealth of
frontend applications and libraries are available. GnuPG also provides
support for S/MIME and Secure Shell (ssh). 
endef

define Package/gpgv2/description
 GPGv is a stripped down version of GnuPG that only checks signatures.
endef

define Package/gnupg2-dirmngr/description
Since version 2.1 of GnuPG, 'dirmngr' takes care of accessing the
OpenPGP keyservers.  As with previous versions it is also used as a
server for managing and downloading certificate revocation lists (CRLs)
for X.509 certificates, downloading X.509 certificates, and providing
access to OCSP providers.  Dirmngr is invoked internally by 'gpg',
'gpgsm', or via the 'gpg-connect-agent' tool.
endef

define Package/gnupg2-utils/description
 Key management utilies for GnuPG (version 2).
 This package is needed to import keys from a keyserver.
endef

CONFIGURE_ARGS += \
	--with-gpg-error-prefix="$(STAGING_DIR)/usr/" \
	--with-libgcrypt-prefix="$(STAGING_DIR)/usr/" \
	--with-libassuan-prefix="$(STAGING_DIR)/usr/" \
	--with-ksba-prefix="$(STAGING_DIR)/usr/" \
	--with-npth-prefix="$(STAGING_DIR)/usr/" \
	--enable-dirmngr \
	--disable-bzip2 \
	--disable-card-support \
	--disable-ccid-driver \
	--disable-gnutls \
	--disable-ldap \
	--disable-ntbtls \
	--disable-rpath \
	--disable-sqlite \
	--disable-tests \
	--disable-zip

TARGET_CFLAGS += $(if $(filter-out 5 6 7 8 9,$(word 1,$(subst ., ,$(call qstrip,$(CONFIG_GCC_VERSION))))),-DEXTERN_UNLESS_MAIN_MODULE=static)

define Package/gnupg2/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gpg $(1)/usr/bin/gpg2
endef

define Package/gpgv2/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gpgv $(1)/usr/bin/gpgv2
endef

define Package/gnupg2-dirmngr/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dirmngr $(1)/usr/bin/dirmngr
endef

define Package/gnupg2-utils/install
	$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gpgtar $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kbxutil $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gpg-wks-server $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gpg-agent $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gpg-connect-agent $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gpgsplit $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gpgparsemail $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gpgsm $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/addgnupghome $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/applygnupgdefaults $(1)/usr/sbin
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/gpg-* $(1)/usr/lib
endef

$(eval $(call BuildPackage,gnupg2))
$(eval $(call BuildPackage,gpgv2))
$(eval $(call BuildPackage,gnupg2-dirmngr))
$(eval $(call BuildPackage,gnupg2-utils))