| 1 | ; OpenPGP package signing, key management and offline verification. |
| 2 | defpkgbuild(gnupg, |
| 3 | #:pkgname, "gnupg", |
| 4 | #:pkgver, "2.4.9", |
| 5 | #:pkgrel, 1, |
| 6 | #:pkgdesc, "GnuPG tools and agent for signing and verifying packages", |
| 7 | #:arch, [#:x86-64, #:aarch64], |
| 8 | #:license, "GPL-3.0-or-later", |
| 9 | #:url, "https://gnupg.org/", |
| 10 | #:depends, ["musl", "bzip2", "libassuan", "libgcrypt", "libgpg-error", "libksba", |
| 11 | "npth", "pinentry", "readline", "sqlite", "zlib"], |
| 12 | #:source, ["https://gnupg.org/ftp/gcrypt/gnupg/gnupg-2.4.9.tar.bz2", |
| 13 | "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/0010-avoid-beta-warning.patch", |
| 14 | "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/0020-avoid-regenerating-defsincdate-use-shipped-file.patch", |
| 15 | "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/0110-avoid-simple-memory-dumps-via-ptrace.patch", |
| 16 | "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/0210-dirmngr-hkp-avoid-potential-race-condition-when-some-host-die.patch", |
| 17 | "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/0230-dirmngr-avoid-automatically-checking-upstream-swdb.patch", |
| 18 | "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/0330-gpg-default-to-sha512-for-all-signature-types-on-rsa-keys.patch", |
| 19 | "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/0340-gpg-prefer-sha512-and-sha384-in-personal-digest.patch", |
| 20 | "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/0420-gpg-drop-import-clean-from-default-keyserver-import-options.patch", |
| 21 | "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/fix-i18n.patch", |
| 22 | "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/HACK-revert-rfc4880bis-default.patch", |
| 23 | "check.py"], |
| 24 | #:sha256sums, ["dd17ab2e9a04fd79d39d853f599cbc852062ddb9ab52a4ddeb4176fd8b302964", |
| 25 | "243c3a79295519b3931f9d846cf2af5caa064a78de812ee336dc786c1567b4d0", |
| 26 | "9bd33f7d1b875bf710a9ad58db17d8217e747733a3118ff9403e1856a2c6754a", |
| 27 | "9bb5282a5292f8fe4ff77253ba28bb5a2453d85ba4bdebcc646bf82bb9175c60", |
| 28 | "9b30351f7eff35c27376f7b7c73ee23a1b737b5bb293fdf97e41924ae6851e88", |
| 29 | "a059840eed2d1e0ed977fbc7420108d91031e3c256f95eede1d8fa61e6193ee4", |
| 30 | "1b3b0f879f1cae1d734607a0f29e0ceecb186384e39a37232e60b0adcaa56bc3", |
| 31 | "87b77fe213a66b78866f4865882d62649c8b861df7adf383cffb6a781675ed52", |
| 32 | "6ade15b536c50a88efc2d9dc958433b0ccfaf2908025b7672753e6bfce51c3c6", |
| 33 | "ce409e47ce4a0d8468ba7e791fd5a7311fd600a167e3a2a60f4330d5460b65be", |
| 34 | "f75fdd02ba73ff93e6ce5d36a6ccff3ad06f1b2e08f8918d42c912e073893a3e", |
| 35 | "d8a6178cd60146bdbcd509e570a85bd958b969ead3e896e90e3f085f5da1c6bd"], |
| 36 | #:prepare, fn() { |
| 37 | for-each(fn(file) { |
| 38 | run("patch", "--batch", "-d", "gnupg-2.4.9", "-p1", "-i", string-append("../", file)) |
| 39 | }, list("0010-avoid-beta-warning.patch", |
| 40 | "0020-avoid-regenerating-defsincdate-use-shipped-file.patch", |
| 41 | "0110-avoid-simple-memory-dumps-via-ptrace.patch", |
| 42 | "0210-dirmngr-hkp-avoid-potential-race-condition-when-some-host-die.patch", |
| 43 | "0230-dirmngr-avoid-automatically-checking-upstream-swdb.patch", |
| 44 | "0330-gpg-default-to-sha512-for-all-signature-types-on-rsa-keys.patch", |
| 45 | "0340-gpg-prefer-sha512-and-sha384-in-personal-digest.patch", |
| 46 | "0420-gpg-drop-import-clean-from-default-keyserver-import-options.patch", |
| 47 | "fix-i18n.patch", |
| 48 | "HACK-revert-rfc4880bis-default.patch")) |
| 49 | run("rm", "-f", "gnupg-2.4.9/tests/gpgme/setup.scm") |
| 50 | run("env", "-C", "gnupg-2.4.9", "AUTOCONF=autoconf", "AUTOHEADER=autoheader", "autoreconf", "-fi") |
| 51 | }, |
| 52 | #:build, fn() { |
| 53 | root := get-environment-variable("VPAC_MAKEPKG_ROOT") |
| 54 | ; libksba supplies ksba.pc. The installed gpgrt-config shell script reads |
| 55 | ; that record for configure, including when the target cannot run here. |
| 56 | run("env", string-append("GPGRT_CONFIG=", root, "/usr/bin/gpgrt-config"), |
| 57 | "vinix-configure", "gnupg-2.4.9/configure", |
| 58 | string-append("--with-libgpg-error-prefix=", root, "/usr"), |
| 59 | string-append("--with-libgcrypt-prefix=", root, "/usr"), |
| 60 | string-append("--with-libassuan-prefix=", root, "/usr"), |
| 61 | string-append("--with-libksba-prefix=", root, "/usr"), string-append("--with-npth-prefix=", root, "/usr"), |
| 62 | "--localstatedir=/var", "--disable-nls", "--enable-tofu", "--disable-scdaemon", "--disable-ccid-driver", |
| 63 | "--disable-dirmngr", "--disable-wks-tools", "--disable-ldap", "--disable-doc", "--disable-ntbtls") |
| 64 | run("make") |
| 65 | }, |
| 66 | #:check, fn() { |
| 67 | run("vinix-run", "g10/gpg", "--version") |
| 68 | run("vinix-run", "agent/gpg-agent", "--version") |
| 69 | run("python3", "check.py") |
| 70 | }, |
| 71 | #:package, fn() { |
| 72 | run("make", "install", string-append("DESTDIR=", pkgdir())) |
| 73 | run("rm", "-f", string-append(pkgdir(), "/usr/share/info/dir")) |
| 74 | run("install", "-Dm644", "gnupg-2.4.9/COPYING", string-append(pkgdir(), "/usr/share/licenses/gnupg/COPYING")) |
| 75 | }) |
| 76 | |