xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-support/gnupg/gnupg_2.3.7.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSUMMARY = "GNU Privacy Guard - encryption and signing tools (2.x)"
2*4882a593SmuzhiyunDESCRIPTION = "A complete and free implementation of the OpenPGP standard \
3*4882a593Smuzhiyunas defined by RFC4880 (also known as PGP). GnuPG allows you to encrypt \
4*4882a593Smuzhiyunand sign your data and communications; it features a versatile key \
5*4882a593Smuzhiyunmanagement system, along with access modules for all kinds of public \
6*4882a593Smuzhiyunkey directories."
7*4882a593SmuzhiyunHOMEPAGE = "http://www.gnupg.org/"
8*4882a593SmuzhiyunLICENSE = "GPL-3.0-only & LGPL-3.0-only"
9*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=189af8afca6d6075ba6c9e0aa8077626 \
10*4882a593Smuzhiyun                    file://COPYING.LGPL3;md5=a2b6bf2cb38ee52619e60f30a1fc7257"
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunDEPENDS = "npth libassuan libksba zlib bzip2 readline libgcrypt"
13*4882a593Smuzhiyun
14*4882a593Smuzhiyuninherit autotools gettext texinfo pkgconfig
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunUPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
17*4882a593SmuzhiyunSRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
18*4882a593Smuzhiyun           file://0002-use-pkgconfig-instead-of-npth-config.patch \
19*4882a593Smuzhiyun           file://0004-autogen.sh-fix-find-version-for-beta-checking.patch \
20*4882a593Smuzhiyun           file://0001-Woverride-init-is-not-needed-with-gcc-9.patch \
21*4882a593Smuzhiyun           "
22*4882a593SmuzhiyunSRC_URI:append:class-native = " file://0001-configure.ac-use-a-custom-value-for-the-location-of-.patch \
23*4882a593Smuzhiyun                                file://relocate.patch"
24*4882a593SmuzhiyunSRC_URI:append:class-nativesdk = " file://relocate.patch"
25*4882a593Smuzhiyun
26*4882a593SmuzhiyunSRC_URI[sha256sum] = "ee163a5fb9ec99ffc1b18e65faef8d086800c5713d15a672ab57d3799da83669"
27*4882a593Smuzhiyun
28*4882a593SmuzhiyunEXTRA_OECONF = "--disable-ldap \
29*4882a593Smuzhiyun		--disable-ccid-driver \
30*4882a593Smuzhiyun		--with-zlib=${STAGING_LIBDIR}/.. \
31*4882a593Smuzhiyun		--with-bzip2=${STAGING_LIBDIR}/.. \
32*4882a593Smuzhiyun		--with-readline=${STAGING_LIBDIR}/.. \
33*4882a593Smuzhiyun		--with-mailprog=${sbindir}/sendmail \
34*4882a593Smuzhiyun		--enable-gpg-is-gpg2 \
35*4882a593Smuzhiyun               "
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun# A minimal package containing just enough to run gpg+gpgagent (E.g. use gpgme in opkg)
38*4882a593SmuzhiyunPACKAGES =+ "${PN}-gpg"
39*4882a593SmuzhiyunFILES:${PN}-gpg = " \
40*4882a593Smuzhiyun	${bindir}/gpg \
41*4882a593Smuzhiyun	${bindir}/gpg2 \
42*4882a593Smuzhiyun	${bindir}/gpg-agent \
43*4882a593Smuzhiyun"
44*4882a593Smuzhiyun
45*4882a593Smuzhiyun# Normal package (gnupg) should depend on minimal package (gnupg-gpg)
46*4882a593Smuzhiyun# to ensure all tools are included. This is done only in non-native
47*4882a593Smuzhiyun# builds. Native builds don't have sub-packages, so appending RDEPENDS
48*4882a593Smuzhiyun# in this case breaks recipe parsing.
49*4882a593SmuzhiyunRDEPENDS:${PN} += "${@ "" if ("native" in d.getVar("PN")) else (d.getVar("PN") + "-gpg")}"
50*4882a593Smuzhiyun
51*4882a593SmuzhiyunRRECOMMENDS:${PN} = "pinentry"
52*4882a593Smuzhiyun
53*4882a593Smuzhiyundo_configure:prepend () {
54*4882a593Smuzhiyun	# Else these could be used in prefernce to those in aclocal-copy
55*4882a593Smuzhiyun	rm -f ${S}/m4/gpg-error.m4
56*4882a593Smuzhiyun	rm -f ${S}/m4/libassuan.m4
57*4882a593Smuzhiyun	rm -f ${S}/m4/ksba.m4
58*4882a593Smuzhiyun	rm -f ${S}/m4/libgcrypt.m4
59*4882a593Smuzhiyun}
60*4882a593Smuzhiyun
61*4882a593Smuzhiyundo_install:append() {
62*4882a593Smuzhiyun	ln -sf gpg2 ${D}${bindir}/gpg
63*4882a593Smuzhiyun	ln -sf gpgv2 ${D}${bindir}/gpgv
64*4882a593Smuzhiyun}
65*4882a593Smuzhiyun
66*4882a593Smuzhiyundo_install:append:class-native() {
67*4882a593Smuzhiyun	create_wrappers ${STAGING_BINDIR_NATIVE}
68*4882a593Smuzhiyun}
69*4882a593Smuzhiyun
70*4882a593Smuzhiyundo_install:append:class-nativesdk() {
71*4882a593Smuzhiyun	create_wrappers ${SDKPATHNATIVE}${bindir_nativesdk}
72*4882a593Smuzhiyun}
73*4882a593Smuzhiyun
74*4882a593Smuzhiyuncreate_wrappers() {
75*4882a593Smuzhiyun	for i in gpg2 gpgconf gpg-agent gpg-connect-agent; do
76*4882a593Smuzhiyun		create_wrapper ${D}${bindir}/$i GNUPG_BINDIR=$1
77*4882a593Smuzhiyun	done
78*4882a593Smuzhiyun}
79*4882a593Smuzhiyun
80*4882a593SmuzhiyunPACKAGECONFIG ??= "gnutls"
81*4882a593SmuzhiyunPACKAGECONFIG[gnutls] = "--enable-gnutls, --disable-gnutls, gnutls"
82*4882a593SmuzhiyunPACKAGECONFIG[sqlite3] = "--enable-sqlite, --disable-sqlite, sqlite3"
83*4882a593Smuzhiyun
84*4882a593SmuzhiyunBBCLASSEXTEND = "native nativesdk"
85*4882a593Smuzhiyun
86*4882a593Smuzhiyunlcl_maybe_fortify:mipsarch = ""
87*4882a593Smuzhiyun
88